Closed Bug 857922 Opened 11 years ago Closed 11 years ago

fontconfig change breaks webfonts rendering under linux

Categories

(Core :: Graphics, defect)

20 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: elad, Unassigned)

References

Details

See downstream bug https://bugzilla.redhat.com/show_bug.cgi?id=946859

Basically, this fontconfig change http://cgit.freedesktop.org/fontconfig/commit/?id=95af7447dba7c54ed162b667c0bb2ea6500e8f32 makes passing a filename to all FC queries mandatory. Firefox passes an empty string, which makes fontconfig matching fail and as a result webfonts fail to render and Firefox uses system fonts instead.
Component: Untriaged → Graphics
Product: Firefox → Core
According to fontconfig docs:

<quote src="http://www.freedesktop.org/software/fontconfig/fontconfig-devel/fcfreetypequeryface.html">
  FcFreeTypeQueryFace -- compute pattern from FT_Face
  Synopsis

  #include <fontconfig.h>
  #include <fcfreetype.h>
	

  FcPattern * FcFreeTypeQueryFace(const FT_Face face, const FcChar8 *file, int id, FcBlanks *blanks);

  Description

  Constructs a pattern representing 'face'. 'file' and 'id' are used solely as data for pattern elements (FC_FILE, FC_INDEX and sometimes FC_FAMILY).
</quote>

it doesn't look as though the filename should be required here, if we don't care about it being available as a pattern element. Indeed, with a downloaded font, there *is* no filename - the font data associated with the FT_Face exists only in RAM, it is not stored in a file.

So this looks to me like a breaking change in the semantics of the fontconfig API. :(
Fedora's fontconfig maintainer replied:
>Well, you were just relying on the undocumented behavior. it didn't even mention whether giving an empty string as file is acceptable or not. that said I'm working on supporting such case in fontconfig now.

This issue is fixed in fontconfig-2.10.92-3.fc19, but:

>moving back to fontconfig for hash issue but you may still see another issue with regard to removing FC_FILE from the pattern.
fyi, possttibly related.

this firefox-vs-fontconfig-vs-webfont issue has manifested here:

https://bugzilla.mozilla.org/show_bug.cgi?id=870481#c8

summary:

webfonts display with 'new' fontconfig breaks completely on ALL tested Firefox versions
webfonts display with 'old' fontconfig breaks paritally on current/old tested Firefox versions
webfonts display with 'old' fontconfig works on next (aurora/nightly) tested Firefox versions

not just on Fedora; openSUSE (& at least 1 windows instance of FF) are affected
You probably didn't read my previous comment, so read again:

> it was fixed in fontconfig-2.10.92-3.fc19

since I don't see any other issues here (and fontconfig is not used on Windows), I suggest you contact the fontconfig maintainer in openSUSE and ask them to make an update.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.