Comment 82 for bug 521163

Revision history for this message
In , Nicolas-mailhot-laposte (nicolas-mailhot-laposte) wrote :

If 65-nonlatin.conf is to be changed please do it properly. Do not mix info about different fonts in the same file so users and distros and users can change one font prio just by renaming a link (I still think those files should be provided by font packages themselves but at least use a model any font packager can emulate for its package).

1. sort fonts by fontconfig generic and target lang

2. for each generic, and each target lang, create a series of files named

65-<X>-<lang>-<fontname>.conf

Where X is a two-digit number prefix, lang is "zh", "ja" or whatever, and "fontname" is the name of the font being described. Judicious use of X will allow you to order fonts within the 65 level

Make each of those files contain the following (fontconfig forces you to use contains to specify multiple langs, it is not safe, contains foo can match foo- or -foo, kittens will be hurt someday)

<match>
  <test name="lang" compare="contains">
    <string>[lang]</string>
  </test>
  <test name="family">
    <string>[generic]</string>
  </test>
  <edit name="family" mode="prepend" binding="same">
    <string>[font name]</string>
  </edit>
</match>
<alias>
  <family>[font name]</family>
  <default>
    <family>[generic]</family>
  </default>
</alias>

Distros will be able to override this ordering by renaming symlinks or dropping files at 64-XX

And *please* stop messing with the system default fonts, cjk files have no business deciding if the distro wants dejavu, or liberation, or vera first for latin glyphs

(I realise this is not completely satisfying, but I don't see how we can make it work reliably without being able to blacklist non-<lang> content of this kind of font)