freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Problems with font naming and Xft


From: Owen Taylor
Subject: [Devel] Problems with font naming and Xft
Date: Mon, 25 Mar 2002 16:42:18 -0500 (EST)
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/21.1

It's been reported to me (http://bugzilla.gnome.org/show_bug.cgi?id=68113)
that GTK+-2.0, when using Xft has problems with some Japanese fonts of 
not displaying any name at all.

The problem seems to be that Xft is simply using the family_name field
of FT_Face and this field is initialized in a rather haphazard way.

>From reading the code in FreeType, it looks like what it does is it
picks a (more or less) random Unicode name from the font, which could
be for any language, and then converts that from Unicode to "ASCII"
by assigning each character of the result to one byte of the Unicode
character. (If there is only an Apple Roman name, and no unicode names,
it similarly assumes that Apple Roman is ASCII.)

Now, I can probably figure out some way of using FT_Get_Sfnt_Name()
directly, bypassing Xft, but it seems to me that that freetype could
do better on a couple of counts when setting the family_name field:

 - If there is a name for the English language ID, it should use
   that. Yes, this is English-centric, but, it can't be less useful
   to pick the English name than a completely random name, and it's
   much more likely that the English name is going to be in the
   ASCII subset of Unicode.

 - When converting from a different encoding into ASCII, if there
   characters with values greater than 127, replace them with
   ? or some other substitute character rather than the low byte.

Regards,
                                        Owen

[
 I think fontconfig should have some way of getting the name for a
 font localized into a particular language... my best idea as to an API
 would be to have a call like:

  char *FcConfigGetLocalizedName (FcConfig *config, FcPattern *p, const char 
*langid);

 the FC_LANG_* constants are not appropriate for the langid here, so you'd
 need something different.
]



reply via email to

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