unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: emacs-devel@gnu.org
Subject: Re: Implementing charset-aware X font names
Date: Thu, 1 May 2003 20:13:34 +0900 (JST)	[thread overview]
Message-ID: <200305011113.UAA15169@etlken.m17n.org> (raw)
In-Reply-To: <87fzo24xj4.fsf@tleepslib.sk.tsukuba.ac.jp> (stephen@xemacs.org)

In article <87fzo24xj4.fsf@tleepslib.sk.tsukuba.ac.jp>, "Stephen J. Turnbull" <stephen@xemacs.org> writes:
>>>>>>  "Kenichi" == Kenichi Handa <handa@m17n.org> writes:
Kenichi>  We connect charsets to font registries vis fontset.  And
Kenichi>  in the emacs-unicode version, we have enhanced it so that
Kenichi>  we can connect scripts, charsets, range of characters to
Kenichi>  multiple font specs.

> Is this documented outside of source code?

It is documented as the docstring of set-fontset-font (as
attached at the tail).  Internally, a fontset is implemented
by a char-table of a special format.

> How does it compare to the specifier interface used by XEmacs?  XEmacs
> specifiers allow a face to automatically select the correct font by
> X11 font registry, but there must also be a similer mechanism for
> Windows, so this must be somewhat more general than "font registry".
> Also, specifiers implement both inheritance and repeated queries (eg,
> you can have both "arial" and "helvetica" fonts for ascii/latin-1, and
> they will be tried in a specified order, usually "last added first",
> until the face can be displayed).

I don't know about "the specifiers interface of XEmacs".  In
Emacs, a face can have an attribute `fontset'.  In that
case, for displaying a non-ASCII character CHAR by that
face, the fontset is looked up.  If a face doesn't have
`fontset' attribute, the default fontset is looked up.  If a
multiple font specs are found for CHAR, one font spec is
selected as below:

(1) For each font spec, find the encoding charset (a charset
    that maps a character code to a glyph code).

(2) Sort the font specs by using that encoding charset as a
    key according to the charset priority of the current
    language environment.  So, for instance, in Japanese
    lang. env., most Han characters are displayed by a
    Japanese font.

(3) Select the first font spec whose repertory contains CHAR.

The font spec is merged with font related attributes of the
face, then the best matching font is selected.

Kenichi>  In addtion, in emacs-unicode, we separate the concept of
Kenichi>  font encoding and font repertory, and for *-iso10646-1
Kenichi>  fonts, we checks the font contents to get the true
Kenichi>  repertory as a char table.

> Ah, I'll have to ask Ben if he's handled that in the devel branch.
> That sounds like a very good interface, and if possible I'd like to
> use it in XEmacs too.  I assume it is exported so Lisp programs can
> find out the repertoire?

Currently no.  As the repertoire is checked automatically in
a fontset handler, for the moment, I see no necessity in
exporting that to Lisp.

---
Ken'ichi HANDA
handa@m17n.org

----------------------------------------------------------------------
set-fontset-font is a built-in function.
(set-fontset-font NAME CHARACTER FONT-SPEC &optional FRAME ADD)

Modify fontset NAME to use FONT-SPEC for CHARACTER.

CHARACTER may be a cons; (FROM . TO), where FROM and TO are
characters.  In that case, use FONT-SPEC for all characters in the
range FROM and TO (inclusive).

CHARACTER may be a script name symbol.  In that case, use FONT-SPEC
for all characters that belong to the script.

CHARACTER may be a charset which has a :code-offset attribute and the
attribute value is greater than the maximum Unicode character
(#x10FFFF).  In that case, use FONT-SPEC for all characters in the
charset.

FONT-SPEC may be:
 * A vector [ FAMILY WEIGHT SLANT WIDTH ADSTYLE REGISTRY ].
   See the documentation of `set-face-attribute' for the detail of
   these vector elements;
 * A cons (FAMILY . REGISTRY), where FAMILY is a font family name and
   REGISTRY is a font registry name;
 * A font name string.

Optional 4th argument FRAME, if non-nil, is a frame.  This argument is
kept for backward compatibility and has no meaning.

Optional 5th argument ADD, if non-nil, specifies how to add FONT-SPEC
to the font specifications for RANGE previously set.  If it is
`prepend', FONT-SPEC is prepended.  If it is `append', FONT-SPEC is
appended.  By default, FONT-SPEC overrides the previous settings.

  reply	other threads:[~2003-05-01 11:13 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-25 16:12 Cyrillic vs UTF-8 Simon Josefsson
2003-04-25 16:40 ` Eli Zaretskii
2003-04-25 17:09   ` Simon Josefsson
2003-04-25 22:39     ` Eli Zaretskii
2003-04-26  8:11     ` Kenichi Handa
2003-04-26 12:25       ` Simon Josefsson
2003-04-28  9:18         ` Kenichi Handa
2003-04-28 11:11           ` Simon Josefsson
2003-04-26 16:21       ` Benjamin Riefenstahl
2003-04-26 16:27         ` Benjamin Riefenstahl
2003-04-28  4:38       ` Richard Stallman
2003-05-01  8:27         ` Kenichi Handa
2003-05-02  7:06           ` Richard Stallman
2003-05-02 21:51             ` Eli Zaretskii
2003-05-03 13:37               ` Juanma Barranquero
2003-05-03 19:04                 ` Eli Zaretskii
2003-05-04 13:03               ` Richard Stallman
2003-05-04 11:04           ` Dave Love
2003-05-04 12:01             ` Simon Josefsson
2003-05-04 17:13               ` Dave Love
2003-05-04 18:03                 ` Simon Josefsson
2003-05-05  8:47             ` Kenichi Handa
2003-04-26 13:44     ` Richard Stallman
2003-04-26 14:10       ` Simon Josefsson
2003-04-28 21:49     ` Stefan Monnier
2003-04-28 22:29       ` Simon Josefsson
2003-04-29 13:49         ` Stefan Monnier
2003-04-29 14:27           ` Simon Josefsson
2003-04-30  4:42             ` Stephen J. Turnbull
2003-04-30  5:43           ` Richard Stallman
2003-05-19  0:40       ` Kenichi Handa
2003-05-19  0:52         ` Stefan Monnier
2003-05-19  2:31           ` Kenichi Handa
2003-05-19 13:28             ` Stefan Monnier
2003-05-19 13:49               ` Stefan Monnier
2003-04-25 16:54 ` Simon Josefsson
2003-04-26  3:55   ` Implementing charset-aware X font names [was: Cyrillic vs UTF-8] Stephen J. Turnbull
2003-04-28 11:09     ` Kenichi Handa
2003-04-28 12:27       ` Implementing charset-aware X font names Stephen J. Turnbull
2003-05-01 11:13         ` Kenichi Handa [this message]
2003-05-01 14:14           ` Alex Schroeder
2003-05-01 23:16             ` Kenichi Handa
2003-04-26  7:59   ` Cyrillic vs UTF-8 Kenichi Handa
2003-04-26 12:14     ` Simon Josefsson
2003-05-01  7:20       ` Kenichi Handa
2003-05-01 14:06         ` Alex Schroeder
2003-05-01 18:03         ` Customizing fontsets (was: Cyrillic vs UTF-8) Oliver Scholz
2003-05-02  5:17           ` Customizing fontsets Alex Schroeder
2003-05-02  6:32             ` Kenichi Handa
2003-05-02 13:25               ` Stefan Monnier
2003-05-03  0:40               ` Oliver Scholz
2003-05-03  1:50                 ` Kenichi Handa
2003-05-03 12:08                   ` Oliver Scholz
2003-05-07  1:22                     ` Kenichi Handa
2003-05-03  0:33             ` Oliver Scholz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200305011113.UAA15169@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).