]> granicus.if.org Git - libass/commitdiff
font: don't faux-bold fonts that are already bold enough
authorRodger Combs <rodger.combs@gmail.com>
Fri, 12 Oct 2018 05:33:37 +0000 (00:33 -0500)
committerOleg Oshmyan <chortos@inbox.lv>
Thu, 26 Sep 2019 13:48:42 +0000 (16:48 +0300)
And conversely, do faux-bold fonts that are too thin

The offset of 150 matches VSFilter's behavior

libass/ass_font.c

index d2fd76df45c3f1ea6c62101b8658c27f9fc2314a..d17b1281460ca98861565489636a438f5b2a0e39 100644 (file)
@@ -557,8 +557,7 @@ FT_Glyph ass_font_get_glyph(ASS_Font *font, int face_index, int index,
         FT_GlyphSlot_Oblique(face->glyph);
     }
 
-    if (!(face->style_flags & FT_STYLE_FLAG_BOLD) &&
-        (font->desc.bold > 400)) {
+    if (font->desc.bold > ass_face_get_weight(face) + 150) {
         ass_glyph_embolden(face->glyph);
     }
     error = FT_Get_Glyph(face->glyph, &glyph);