From 049142f6f63e28d2acbe3c01754c567336e7dc5c Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 7 May 2014 07:13:32 -0700 Subject: [PATCH] Make the check for faux bold match libass's logic for when to embolden --- src/font_file_lister_fontconfig.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/font_file_lister_fontconfig.cpp b/src/font_file_lister_fontconfig.cpp index d0de8e18c..bc9d29804 100644 --- a/src/font_file_lister_fontconfig.cpp +++ b/src/font_file_lister_fontconfig.cpp @@ -133,9 +133,11 @@ FontFileLister::CollectionResult FontConfigFontFileLister::GetFontPaths(std::str } } - int actual_weight = weight; - if (FcPatternGetInteger(match, FC_WEIGHT, 0, &actual_weight) == FcResultMatch) - ret.fake_bold = actual_weight < weight; + if (weight > 80) { + int actual_weight = weight; + if (FcPatternGetInteger(match, FC_WEIGHT, 0, &actual_weight) == FcResultMatch) + ret.fake_bold = actual_weight <= 80; + } int actual_slant = slant; if (FcPatternGetInteger(match, FC_SLANT, 0, &actual_slant) == FcResultMatch)