From 6c2120a7cb4a6fd648ef37ad8f0d961cbd60f500 Mon Sep 17 00:00:00 2001 From: Rodger Combs Date: Sat, 23 Mar 2019 08:30:16 -0500 Subject: [PATCH] fontselect: expose the freetype-provided family as well --- libass/ass_fontselect.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/libass/ass_fontselect.c b/libass/ass_fontselect.c index 651fc7a..9c4bb3b 100644 --- a/libass/ass_fontselect.c +++ b/libass/ass_fontselect.c @@ -766,6 +766,13 @@ get_font_info(FT_Library lib, FT_Face face, ASS_FontProviderMetaData *info) if (!(face->face_flags & FT_FACE_FLAG_SCALABLE)) return false; + if (face->family_name) { + families[0] = strdup(face->family_name); + if (families[0] == NULL) + goto error; + num_family++; + } + for (i = 0; i < num_names; i++) { FT_SfntName name; @@ -793,15 +800,6 @@ get_font_info(FT_Library lib, FT_Face face, ASS_FontProviderMetaData *info) num_family++; } } - - } - - // check if we got a valid family - if not use whatever FreeType gives us - if (num_family == 0 && face->family_name) { - families[0] = strdup(face->family_name); - if (families[0] == NULL) - goto error; - num_family++; } // we absolutely need a name -- 2.40.0