diff options
| author | Eskil Abrahamsen Blomfeldt <[email protected]> | 2014-01-29 11:57:08 +0100 |
|---|---|---|
| committer | The Qt Project <[email protected]> | 2014-01-29 21:37:15 +0100 |
| commit | b04d87b2263fd5d9b2b57799098a2eb5a3c91dfc (patch) | |
| tree | bb5b65c0cb575695eee128d83b83074f316ce4c7 /src | |
| parent | ff70c39ebcc63cf77a457b2af662e6f7de09e6c5 (diff) | |
REG: Fix font matching in FontConfig
Change a4ff400e25c76a32ec8252285dda043f07b19c15 exposed a bug in
the font matching in the FontConfig engine. FcFontMatch is
documented to not work unless you call FcConfigSubstitute()
and FcDefaultSubstitute() on the pattern first. We were neglecting
to do this, but hiding the bug before since we were doing our own
font matching and never reading back the file name from FC's match.
When we started doing this, suddenly DejaVu Sans (for instance)
would match its bold variant instead.
Change-Id: Ie6b7026de24cfb0353dc892fa862d6ee79604f38
Reviewed-by: Simon Hausmann <[email protected]>
Reviewed-by: Konstantin Ritt <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp index 28f895f3b9a..c1ffa1b4fa4 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp +++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp @@ -547,6 +547,10 @@ QFontEngine *QFontconfigDatabase::fontEngine(const QFontDef &f, QChar::Script sc FcPatternAdd(pattern,FC_INDEX,value,true); FcResult result; + + FcConfigSubstitute(0, pattern, FcMatchPattern); + FcDefaultSubstitute(pattern); + FcPattern *match = FcFontMatch(0, pattern, &result); QFontEngineFT *engine = new QFontEngineFT(fontDef); |
