Request for review and advice on wqy-bitmap-fonts fontconfig settings

Nicolas Mailhot nicolas.mailhot at laposte.net
Sat Nov 24 14:21:54 UTC 2007


Le vendredi 23 novembre 2007 à 23:25 -0500, Qianqian Fang a écrit :

Hi Qianqian,

> 4. Questions
> 
> That's all I want to learn from you: do you see a robust implementation
> of fontconfig font selection mechanism to achieve my goals above?
> if yes, how? if no, to whom should I file bug reports to?

I'm not sure if I've assimilated all your goals, but here are some
comments on your fontconfig file:

> <?xml version="1.0"?>
> <!DOCTYPE fontconfig SYSTEM "fonts.dtd">

You probably want ../fonts.dtd there but that's general XML fontconfig
brokenness most everyone is guilty of.

>     <match target="pattern">

I suppose this is protected by the selectfont pattern before but I'd
avoid playing any complex substitution games when the name of an
existing on-system font is given, and only substitute either fonts not
available at all or synthetic fonts like sans-serif and friends.

Also, please use a simple match with a test for family inside instead of
this pattern indirection, as documented on:
http://fedoraproject.org/wiki/SIGs/Fonts/Packaging/Fontconfig

>         <test equal="any" compare="eq" name="lang">

>                 <string>en</string>
>                 <string>en-us</string>

You have no business touching non CJK locales, please remove this. If
for some reason an app does not tag text with the correct locale,
complain to its authors. 

http://fedoraproject.org/wiki/SIGs/Fonts/Dev/LanguageAwarenessProblem

These two lines are probably responsible for most of your problem
reports.

>                 <string>zh-cn</string>
>                 <string>zh-tw</string>
>                 <string>zh-hk</string>
>                 <string>zh-sg</string>
>         </test>

>         <test compare="more_eq" name="pixelsize">
>                 <double>11</double>
>         </test>
>         <test compare="less_eq" name="pixelsize">
>                 <double>16</double>
>         </test>

Are you sure of the 11-16 pixel range?

>         <edit name="family" mode="prepend_first">
>                 <string>WenQuanYi Bitmap Song</string>
>         </edit>
>     </match>

>     <match target="pattern">

[…]

>         <test compare="more_eq" name="size">
>                 <double>8</double>
>         </test>
>         <test compare="less_eq" name="size">
>                 <double>12</double>
>         </test>

Point sizes have no meaning for bitmap fonts, unless you assume a fixed
point/pixel ratio, which is not hardware reality. Dump this match block
it's actively evil.

>         <edit name="family" mode="prepend_first">
>                 <string>WenQuanYi Bitmap Song</string>
>         </edit>
>    </match>


>     <match target="pattern">
>         <test equal="any" compare="eq" name="family">
>                 <string>WenQuanYi Bitmap Song</string>
>         </test>
>         <test equal="any" compare="eq" name="family">
>                 <string>monospace</string>
>         </test>
>         <edit name="family" mode="prepend">
>                 <string>Bitstream Vera Sans Mono</string>
>         </edit>
>         <edit name="family" mode="prepend" binding="strong">
>                 <string>DejaVu LGC Sans Mono</string>
>         </edit>
>     </match>

If you didn't touch non-CJK locales before you wouldn't need this
bandaid. Also you're assuming some other fonts are present on system
which may not be the case. Our default latin font list is dynamic and
changes from release to release, and depending on what font packages
users actually install.

If you really want Vera or DejaVu to override WenQuanYi Bitmap Song
contents, the override should be added to the fontconfig file those
fonts ship.

Wouldn't a simple 
http://fedoraproject.org/wiki/SIGs/Fonts/Packaging/Fontconfig#local-specific-default-font-overrides
rule with additional pixel range restriction be sufficient for your
needs?


Regards,

-- 
Nicolas Mailhot
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Ceci est une partie de message num?riquement sign?e
URL: <http://listman.redhat.com/archives/fedora-fonts-list/attachments/20071124/89701ac8/attachment.sig>


More information about the Fedora-fonts-list mailing list