[Fontconfig] Heads up: Droid fonts update in Rawhide

Raimund Steger rs at mytum.de
Fri Jul 27 07:01:26 PDT 2012


On Fri, July 27, 2012 12:42, Akira TAGOH wrote:
> On Fri, Jul 27, 2012 at 6:05 PM, Raimund Steger <rs at mytum.de> wrote:
>> [...]
>> 'lang'. Conversely, if someone expects to *always* get Y regardless of
>> language when asking for it, they won't be able to do it with the
>> target="scan" rule. (This has the potential to cause some user
>> frustration I
>> think.)
>
> Not really. I managed to do it with mode="prepend" instead of
> mode="append" for this case.

But how would you do that (I mean, getting DroidSans.ttf just by its name
regardless of locale)? I just tried the following:

  <match target="scan">
    <test name="family"><string>Droid Sans Japanese</string></test>
    <edit mode="prepend" name="family">
      <string>Droid Sans</string>
    </edit>
  </match>

Now what I'm getting is:

wlm2s092:~)LC_CTYPE=ja fc-match 'Droid Sans'
DroidSansJapanese.ttf: "Droid Sans" "Regular"

wlm2s092:~)LC_CTYPE=en fc-match 'Droid Sans'
DroidSans.ttf: "Droid Sans" "Regular"

To get DroidSans.ttf by its original family name when running in locale
'ja', when that rule is in place, it is necessary to apply an additional
'lang=en' to the pattern.

wlm2s092:~)LC_CTYPE=ja fc-match 'Droid Sans:lang=en'
DroidSans.ttf: "Droid Sans" "Regular"

(Actually I didn't observe any changed behavior compared to "append" in
this case.)

Now of course this seems to be what we want, otherwise it would be a bad
"composite font".

But I'm just saying that an application that uses
XftFontOpenName(...,"Droid Sans") and XftDrawString* to draw some ASCII
content, might draw only empty boxes when running in a 'ja' locale where
it gets "Droid Sans Japanese" instead, but work fine in an 'en' locale.

Well, I do realize that's a pretty far-fetched example and with Pango that
shouldn't be a problem anyway.

Otherwise I think your configuration should work fine. Because of the
mode="prepend", the GTK picker even hides the original family names (at
least my old GTK 2.18 picker does). But as you said, that might depend on
applications. (Still I don't think that future Fedora users would
completely freak out if they happened to spot a 'Droid Sans XYZ' string in
a picker somewhere, but that's just my opinion.)

(I gather the 'fontversion' properties are used to apply an additional
precedence to the Droid variants, so that removing 'ja' from 'Droid Sans
Fallback' would be unnecessary when the latter has a lower version, and
vice versa?)

Raimund



-- 
Worringer Str 31 Duesseldorf 40211 Germany +49-179-2981632 icq 16845346



More information about the Fontconfig mailing list