emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: set-fontset-font


From: Kenichi Handa
Subject: Re: set-fontset-font
Date: Wed, 16 Jul 2008 15:55:27 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

In article <address@hidden>, Miles Bader <address@hidden> writes:

> In a fresh emacs, started with "emacs -Q", I can change the font used
> for e.g. japanese characters by doing:

>    (set-fontset-font "fontset-default" 'kana "メイリオ")
>    (set-fontset-font "fontset-default" 'han "メイリオ")

> where "メイリオ" is the name of the font.  This works fine.

> However in my normal emacs, it _doesn't_ work -- the font emacs uses for
> Japanse character doesn't change.

I have not yet decided how to manage non-ASCII
family/foundry/adstyle names.  Currently, perhaps this will
work:

   (set-fontset-font "fontset-default" 'kana
      (encode-coding-string "メイリオ" 'utf-8))
   (set-fontset-font "fontset-default" 'ha
      (encode-coding-string "メイリオ" 'utf-8))

In the future, of course, I'll fix the code so that your
original setting work.

> What does "fontset-default" really mean, anyway?

A fontset maps a non-ASCII character to a group of fonts
(font-group).

Usually, two fontsets "fontset-startup" and
"fontset-default" are active.  "fontset-startup" is made
automatically and it maps Latin characters to the default
font and set the fallback font to the default font.  The
mapping of both fonts may be modified by a user.

To decide a font for a non-ASCII character CH, Emacs does
this:

(1) Check "fontset-startup".  If CH is mapped to a
    font-gourp and one of the font supports CH, that font is
    used.  Otherwise...

(2) Check "fontset-default".  If CH is mapped to a
    font-gourp and one of the font supports CH, that font is
    used.  Otherwise...

(3) Check the fallback font-group of "fontset-startup".  If
    CH is mapped....   Otherwise...

(4) Check the fallback font-group of "fontset-default".  If
    CH is mapped....   Otherwise...

(5) Give up finding a font for CH.

So, in short, "fontset-default" gives the default
information about fonts to support each character
(e.g. Devanagari fonts requires this and that OTF features).


---
Kenichi Handa
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]