Bug 910875

Summary: Google Droid Sans Fallback and fontconfig
Product: [Fedora] Fedora Reporter: Mattias Ellert <mattias.ellert>
Component: google-droid-fontsAssignee: Nicolas Mailhot <nicolas.mailhot>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: fonts-bugs, hobbes1069, nicolas.mailhot, paul, tremble
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-16 16:36:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mattias Ellert 2013-02-13 18:59:08 UTC
Description of problem:

I have a question about the Google Droid Sans Fallback font in Fedora. How am I supposed to find this font using fontconfig?

Finding the non-fallback Google Droid Sans is easy:

[ellert@localhost ~]$ fc-match DroidSans
DroidSans.ttf: "Droid Sans" "Regular"

Also finding the non-latin fonts is easy using lang in the pattern:

[ellert@localhost ~]$ fc-match DroidSans:lang=ja
DroidSansJapanese.ttf: "Droid Sans" "Regular"
[ellert@localhost ~]$ fc-match DroidSans:lang=ar
DroidSansArabic.ttf: "Droid Sans" "Regular"

But what pattern should I use to get the Fallback font? The only idea I have is the following:

[ellert@localhost ~]$ fc-match DroidSansFallback
DroidSans.ttf: "Droid Sans" "Regular"

But as can be seen above this just finds the non-fallback version. Is there some pattern that can be used to find the fallback font I can't figure out?

Version-Release number of selected component (if applicable):
google-droid-sans-fonts-20120715-4.fc18

Comment 1 Nicolas Mailhot 2013-02-16 16:36:41 UTC
While the complete hiding of DroidSansFallback is an unintended side-effect of the method we use to merge Droid fonts in fontconfig I'm pretty sure it does not matter since the merged "Droid Sans" will include all the codepoints of the files we built it from.

Therefore fc-match is correct: in Fedora you should use "Droid Sans" for your DroidSansFallback needs. Our Droid Sans is as complete as DroidSansFallback, except that some DroidSansFallback glyphs are being transparently replaced by better versions from other Droid fonts.

Now of course that only works if your application is using fontconfig properly. If you only use fontconfig to find font files on the system, but do not use the fontconfig substitution engine on a per-glyph basis, things are going to be hard for you.

And this kind of partial fontconfig support is definitely something we do *not* want to encourage in Fedora: use the system glyph substitution rules, if you find holes in them fix them, but do not try to work around them, having different font behaviour in apps because they're making shortcuts in their fontconfig plumbing is not something that is helping users at all.