]> granicus.if.org Git - libass/commitdiff
fontconfig: read PostScript names
authorOleg Oshmyan <chortos@inbox.lv>
Mon, 19 Oct 2015 13:52:34 +0000 (16:52 +0300)
committerOleg Oshmyan <chortos@inbox.lv>
Thu, 22 Oct 2015 23:36:44 +0000 (02:36 +0300)
And fix two wrong comments.

Bump the Fontconfig version requirement to 2.10.92 (2.11 RC2), released
on 2013-03-29, to ensure Fontconfig caches and exposes PostScript names.

configure.ac
libass/ass_fontconfig.c

index 8a2c7a8716e22a024d4742e4df74243a1a55757d..cb4e71ca582b54f593cea01632ee13550f876d6b 100644 (file)
@@ -152,7 +152,7 @@ PKG_CHECK_MODULES([FRIBIDI], fribidi >= 0.19.0, [
     ])
 
 if test x$enable_fontconfig != xno; then
-PKG_CHECK_MODULES([FONTCONFIG], fontconfig >= 2.4.2, [
+PKG_CHECK_MODULES([FONTCONFIG], fontconfig >= 2.10.92, [
     CFLAGS="$CFLAGS $FONTCONFIG_CFLAGS"
     LIBS="$LIBS $FONTCONFIG_LIBS"
     AC_DEFINE(CONFIG_FONTCONFIG, 1, [found fontconfig via pkg-config])
@@ -231,7 +231,7 @@ fi
 pkg_requires="freetype2 >= 9.10.3"
 pkg_requires="fribidi >= 0.19.0, ${pkg_requires}"
 if test x$fontconfig = xtrue; then
-    pkg_requires="fontconfig >= 2.4.2, ${pkg_requires}"
+    pkg_requires="fontconfig >= 2.10.92, ${pkg_requires}"
 fi
 if test x$harfbuzz = xtrue; then
     pkg_requires="harfbuzz >= 0.9.5, ${pkg_requires}"
index 8f885c8faf9c4af83db0bcf65e78c4a03e51721d..c9bb2f9d79d355948f52d5f95e7f230e1614cf0d 100644 (file)
@@ -117,7 +117,7 @@ static void scan_fonts(FcConfig *config, ASS_FontProvider *provider)
         if (result != FcResultMatch)
             continue;
 
-        // read and strdup fullnames
+        // read family names
         meta.n_family = 0;
         while (FcPatternGetString(pat, FC_FAMILY, meta.n_family,
                     (FcChar8 **)&families[meta.n_family]) == FcResultMatch
@@ -125,7 +125,7 @@ static void scan_fonts(FcConfig *config, ASS_FontProvider *provider)
             meta.n_family++;
         meta.families = families;
 
-        // read and strdup fullnames
+        // read fullnames
         meta.n_fullname = 0;
         while (FcPatternGetString(pat, FC_FULLNAME, meta.n_fullname,
                     (FcChar8 **)&fullnames[meta.n_fullname]) == FcResultMatch
@@ -133,6 +133,11 @@ static void scan_fonts(FcConfig *config, ASS_FontProvider *provider)
             meta.n_fullname++;
         meta.fullnames = fullnames;
 
+        // read PostScript name
+        meta.postscript_name = NULL;
+        FcPatternGetString(pat, FC_POSTSCRIPT_NAME, 0,
+                           (FcChar8 **)&meta.postscript_name);
+
         ass_font_provider_add_font(provider, &meta, path, index, (void *)pat);
     }
 }