]> granicus.if.org Git - libass/commitdiff
fontselect: load actual weight instead of a guess, when possible
authorRodger Combs <rodger.combs@gmail.com>
Fri, 12 Oct 2018 05:35:18 +0000 (00:35 -0500)
committerOleg Oshmyan <chortos@inbox.lv>
Thu, 26 Sep 2019 13:48:42 +0000 (16:48 +0300)
libass/ass_fontselect.c

index 87815b3e6f9844e65a85de3076cb134c0464133e..85ff0dcbcff2a89fe42d42ac003f3f4f46a53239 100644 (file)
@@ -810,7 +810,7 @@ get_font_info(FT_Library lib, FT_Face face, ASS_FontProviderMetaData *info)
 
     // calculate sensible slant and weight from style attributes
     slant  = 110 * !!(face->style_flags & FT_STYLE_FLAG_ITALIC);
-    weight = 300 * !!(face->style_flags & FT_STYLE_FLAG_BOLD) + 400;
+    weight = ass_face_get_weight(face);
 
     // fill our struct
     info->slant  = slant;