[Fontconfig] ISO 15924 font selection

Keith Packard keithp at keithp.com
Sun Dec 2 19:13:56 PST 2007


On Sun, 2007-12-02 at 13:43 +0100, Gerrit Sangel wrote:
> Hello,
> 
> Sorry if this was asked before, but I could not find anything in the archive.
> 
> Has fontconfig the option to define fonts according to ISO 15924 (and not only 
> according to ISO 639)?

I chose to use ISO 639 because this tagging already existed in the HTML
standard, and because I could readily find orthographies identifiable
with specific ISO 639 languages.

Adding support for the 15924 values seems like it would be easy to do in
a compatible fashion; as those values do not conflict with either 639-1
or 639-2, we could simply add orthographies for the script codes and
things should 'just work'.

> In my opinion, it is much more flexible than defining fonts according to a 
> specific region (e.g. TW or CN). In some cases, it is even necessary, because 
> the region does not differ.

Yeah, conflicts among multiple scripts used for the same langauge in the
same territory do exist, which fontconfig doesn't handle well at all.

> Do I understand this correctly, that the user can specify a font in the config 
> file according to a specific language?

You can match on the language and prepend a family name to make that
preferred.

> I see this in Firefox (even though it does not seem to use fontconfig, but I 
> guess an addon could be written to solve it)

firefox does use fontconfig, although the language-based selection is
internal, not based on modifying fontconfig matching rules.

> So I think a possible way would be to define a general rule for a language 
> (according to ISO-639) or a script (ISO 15924) at first and then a specific 
> rule for a language or script which would override the general rule.

The pattern matching and editing rules should be able to handle this
without change, execpt for the addition of ISO 15924 script codes to the
existing set of language/territory pairs.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20071202/eb7e2dc5/attachment.pgp 


More information about the Fontconfig mailing list