[Fontconfig] Localizing font family and style names

Phil Race Phil.Race at Sun.COM
Tue Nov 30 09:08:56 EST 2004


Keith,

Keith Packard wrote:
> Around 12 o'clock on Nov 29, Phil Race wrote:
> 
> 
>>If the names are used to populate a font menu for example, then
>>its important that there's some way to select the name that's
>>most appropriate for the user's locale.
> 
> 
> (the following is intentionally contentiously dialectic to try and find 
> the best solution)
> 
> This is surely the case for fonts used to display text in that locale, but
> I'm not sure as convincing a case can be made for fonts used to display
> text for other locales.  In fact, I would be unsurprised if multi-lingual
> users would prefer to see each font name presented in the appropriate
> language; that would certainly make it easier to select useful fonts.

Yes, users would want that.
But also what I was getting at here was to say "please don't make
the English name the only name, and probably not even the preferred name".
It sounds like you concur that users probably want font names they
can read.

But even that although useful is not always what you need.
A font can be commonly specified some times with its English name
and sometimes with its localized name. Imagine a document that has
font names embedded. If it was embedded by someone running in Locale A
and read by someone in Locale B, I wouldn't want to be unable to find
the font just because the document creator used his preferred name.

> 
> Relevant here is the fact that the bulk of the fonts I've seen with 
> multiple language names is that they simply add an English name alongside 
> the existing "real" name, presumably so that English-only UIs (like 
> Fontconfig today) can present something to the user.  

The bulk perhaps but I've seen fonts with many localised names.
Perhaps I've spent too long looking at windows fonts where they
have names in Spanish, French, etc, etc, for Pan-European fonts
like Arial.

English names are a fairly pragmatic fall back as an alternative
to (say) a Chinese name for a Chinese font.
I can't think of all the reasons but they probably include that
the font developers themselves often read English, so prefer
that over (say) a German name, and expect being able to recognize
latin characters is fairly widespread and they very probably also
included Latin glyphs in the font, so they know its displayable by
their own font - I suspect most fonts like to have the right code
points to display all their own names .. of course barcode fonts don't etc .

> 
> It could be argued that supporting multiple names is unnecessary in this
> environment; English users are unlikely to want to use these fonts for
> presenting English text, steering them away by presenting the names so that
> they can't read them might actually be considered a feature.  Is it not useful 
> to discourage non-Chinese speakers from using the Arphic fonts?

As I noted above, presentation of the name in the language a user will
recognize is important, but also important is being able to quickly
match a name obtained from some archived source against all known
localised names. That's not really for subsequent user presentation
of the font name, its for selecting the intended font for some other
usage such as displaying text using that font.

I don't think not having a localized name is a safe way to decide if
a font supports a language. I expect there are perfectly decent Latin
fonts that don't have an Italian name.

> 
> 
>>I have come across fonts that have ONLY a Chinese name,
>>so its impossible to insist on the Latin name being the name.
>>If the font doesn't have a Latin name, I don't know a good solution.
>>I suppose you could use the postscript name but that's not really
>>the right thing from the perspective of the Chinese user.
> 
> 
> If the postscript name is the only one available in the font, then that's 
> what fontconfig will use today.  I agree that we should figure out how to 
> identify the 'native' name of the font and try and present that most of 
> the time.  This, however, contradicts your suggestion above that we try to 
> present names in the current locale...

I didn't intend it to contradict this. Its a different case.
If there is no name for this locale then should you synthesise one?
If a font has only a Chinese name than a Postscript name may be
a reasonable fall back for languages using Latin, but a
postscript name in Latin is not always interesting to an Arabic reader.

Having said that, in practice what I do to select as the "preferred name"
is use the first one of :
- Name for user's language
- English name
- First name in the font (I assume there's at least one name!)

I do the above because at some point you have to have a name ..
the obvious difference from fontconfig is that I ignore the postscript name.

> 
> 
>>We'd end up having to resolve these to file names to see that they were the
>>same font, and even then I'm not at all sure what we'd do when its a TTC
>>file.
> 
> 
> Fontconfig includes both a file name and an 'index' into the font to 
> identify elements of TTC files, so at least it would be possible (if 
> painful) to identify shared fonts.
> 
> 
>>So I think providing 'all the names in one font' is the most useful.
>>Without that I know we'd not be able to use fontconfig for font
>>enumeration. We'd have to continue to parse the fonts ourselves
>>to extract that information.
> 
> 
> Ok, so the question remains as to whether we should continue to also 
> present the non-native names for the font (assuming we can correctly 
> identify the native names for all fonts).

I am curious about the term 'native' name
I'm not sure that there is really a "distinguished" name.
ie in the TrueType font file they are all just names and its
the context in which you use them.

> 
> 
>>[[Although so long as only family names are listed, then we need
>>to do that to extract the full face names too, ie add FC_FACENAME
>>or similar.]]
> 
> 
> I'd like to know why the full face names are interesting given the 
> availability of the family and style names.  Is there additional 
> information missing here from (some, many, all) fonts?

Yes. Full Face names are sometimes not the same string as
Family Name + SPACE + Style Name

and :
- We need to support API which lists all the face names
- We need to support cases where a full face name has been specified
and we need to locate the corresponding font.

I can't remember offhand how frequently this occurs but its something
that can and does happen and we have to deal with it.

-phil.

> 
> This does point out that we really need to convert the cache file format 
> to something mmap'able so that all applications can share the same pages 
> for this data.  That's a post-2.3 activity though; I'd really like to 
> finish up this release if we can find a good solution to the localized 
> name issue...
> 
> -keith
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> fontconfig mailing list
> fontconfig at freedesktop.org
> http://freedesktop.org/mailman/listinfo/fontconfig



More information about the Fontconfig mailing list