Skip to content

Commit

Permalink
Query FC_CAPABILITY once per pattern
Browse files Browse the repository at this point in the history
Change-Id: I5f1219d5a476f1bd09e8c01847fe886f342b28a0
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
  • Loading branch information
KonstantinRitt committed Apr 27, 2016
1 parent 6493bca commit 75bd795
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,12 @@ static void populateFromPattern(FcPattern *pattern)
}

#if FC_VERSION >= 20297
FcChar8 *cap = Q_NULLPTR;
for (int j = 1; j < QFontDatabase::WritingSystemsCount; ++j) {
if (writingSystems.supported(QFontDatabase::WritingSystem(j))
&& requiresOpenType(j) && openType[j]) {
FcChar8 *cap;
res = FcPatternGetString (pattern, FC_CAPABILITY, 0, &cap);
if (cap == Q_NULLPTR)
res = FcPatternGetString(pattern, FC_CAPABILITY, 0, &cap);
if (res == FcResultMatch && strstr(reinterpret_cast<const char *>(cap), openType[j]) == 0)
writingSystems.setSupported(QFontDatabase::WritingSystem(j),false);
}
Expand Down

0 comments on commit 75bd795

Please sign in to comment.