emacs-devel
[Top][All Lists]
Advanced

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

Re: Ntemacs chooses wrong font.


From: Jason Rumney
Subject: Re: Ntemacs chooses wrong font.
Date: Wed, 11 Jun 2008 13:34:44 +0100
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

Kenichi Handa wrote:
I currently explicitly generate a unibyte string for font
names just to avoid the font name encoding problem until the
font-backend codes gets stable.

Does that mean that the encoding will eventually be done in generic code, so I should avoid fixing this in w32font.c?

Emacs at first checks if a charater is supported by the
frame font (here "Monaco-10") to avoid unnecessary looking
up of fontset table .  If supported, the frame font is used.
And, in your case, the font backend on Windows says that the
frame font supports it.  That is the problem.

The problem appears to be that the system API used in one of the encode_char functions on Windows (I don't know whether it is uniscribe or gdi) seems to return a space glyph for unsupported characters in some fonts, instead of 0 (which is ".notdef" according to the truetype spec).

Perhaps C-u C-x = should also report which font backend a font belongs to, to make tracking these sorts of bugs down easier.

It seems that you saved the file with some of legacy
encoding (e.g. euc-cn, big5).  On reading such a file, Emacs
adds a charset text-property (e.g. chinese-gb2312, big5),
and if a character has such a property, Emacs doesn't try
the frame font, but does a normal fontset looking up
(because `charset' information may change the priority of
fonts).  So, your fontset setting above takes effect.

Ah, that explains a lot.

Perhaps, we should not try the frame font for a certain
group of charcters (e.g. han, indic, ??).

Where is the has_char function used? On Windows, this should work to filter out unsuitable fonts, as it checks the character against the font's supported scripts.





reply via email to

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