Make the check for faux bold match libass's logic for when to embolden

This commit is contained in:
Thomas Goyne 2014-05-07 07:13:32 -07:00
parent 8e5d4c48bc
commit 049142f6f6

View file

@ -133,9 +133,11 @@ FontFileLister::CollectionResult FontConfigFontFileLister::GetFontPaths(std::str
} }
} }
int actual_weight = weight; if (weight > 80) {
if (FcPatternGetInteger(match, FC_WEIGHT, 0, &actual_weight) == FcResultMatch) int actual_weight = weight;
ret.fake_bold = actual_weight < weight; if (FcPatternGetInteger(match, FC_WEIGHT, 0, &actual_weight) == FcResultMatch)
ret.fake_bold = actual_weight <= 80;
}
int actual_slant = slant; int actual_slant = slant;
if (FcPatternGetInteger(match, FC_SLANT, 0, &actual_slant) == FcResultMatch) if (FcPatternGetInteger(match, FC_SLANT, 0, &actual_slant) == FcResultMatch)