[Fontconfig] fontconfig: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon May 25 09:49:24 UTC 2020


 doc/fontconfig-devel.sgml |    1 +
 doc/fontconfig-user.sgml  |    1 +
 fontconfig/fontconfig.h   |    1 +
 src/fcdefault.c           |    3 +++
 src/fcfreetype.c          |    2 ++
 src/fcmatch.c             |    1 +
 src/fcobjs.h              |    1 +
 7 files changed, 10 insertions(+)

New commits:
commit 68d021b634d1bc53cf3ec1bd28a306500c68c23a
Author: Akira TAGOH <akira at tagoh.org>
Date:   Mon May 25 18:22:18 2020 +0900

    Add FC_ORDER property into cache
    
    "fontversion" used to be modified to sort out fonts as a technique.
    But that lost the original purpose to do the version control between
    releases.
    
    This change adds the dedicated property into the cache.
    
    Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/226

diff --git a/doc/fontconfig-devel.sgml b/doc/fontconfig-devel.sgml
index c4d7537..a1ec613 100644
--- a/doc/fontconfig-devel.sgml
+++ b/doc/fontconfig-devel.sgml
@@ -212,6 +212,7 @@ convenience for the application's rendering mechanism.
     fontvariations FC_FONT_VARIATIONS     String  comma-separated string of axes in variable font
     variable       FC_VARIABLE            Bool    Whether font is Variable Font
     fonthashint    FC_FONT_HAS_HINT       Bool    Whether font has hinting
+    order          FC_ORDER               Int     Order number of the font
     </programlisting>
   </sect2>
 </sect1>
diff --git a/doc/fontconfig-user.sgml b/doc/fontconfig-user.sgml
index c4e8312..cf154ae 100644
--- a/doc/fontconfig-user.sgml
+++ b/doc/fontconfig-user.sgml
@@ -141,6 +141,7 @@ convenience for the applications' rendering mechanism.
   prgname         String  String  Name of the running program
   postscriptname  String  Font family name in PostScript
   fonthashint     Bool    Whether the font has hinting
+  order           Int     Order number of the font
     </programlisting>
   </refsect2>
   <refsect2>
diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h
index c795245..50ecdf8 100644
--- a/fontconfig/fontconfig.h
+++ b/fontconfig/fontconfig.h
@@ -127,6 +127,7 @@ typedef int		FcBool;
 #define FC_HASH		    "hash"		/* String (deprecated) */
 #define FC_POSTSCRIPT_NAME  "postscriptname"	/* String */
 #define FC_FONT_HAS_HINT    "fonthashint"	/* Bool - true if font has hinting */
+#define FC_ORDER	    "order"		/* Integer */
 
 #define FC_CACHE_SUFFIX		    ".cache-" FC_CACHE_VERSION
 #define FC_DIR_CACHE_FILE	    "fonts.cache-" FC_CACHE_VERSION
diff --git a/src/fcdefault.c b/src/fcdefault.c
index f3addca..a9a3b72 100644
--- a/src/fcdefault.c
+++ b/src/fcdefault.c
@@ -335,6 +335,9 @@ FcDefaultSubstitute (FcPattern *pattern)
 	if (prgname)
 	    FcPatternObjectAddString (pattern, FC_PRGNAME_OBJECT, prgname);
     }
+
+    if (!FcPatternFindObjectIter (pattern, &iter, FC_ORDER_OBJECT))
+	FcPatternObjectAddInteger (pattern, FC_ORDER_OBJECT, 0);
 }
 #define __fcdefault__
 #include "fcaliastail.h"
diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index bfbd5d7..90d84fa 100644
--- a/src/fcfreetype.c
+++ b/src/fcfreetype.c
@@ -1824,6 +1824,8 @@ FcFreeTypeQueryFaceInternal (const FT_Face  face,
 	if (!FcPatternObjectAddInteger (pat, FC_FONTVERSION_OBJECT, 0))
 	    goto bail1;
     }
+    if (!FcPatternObjectAddInteger (pat, FC_ORDER_OBJECT, 0))
+	goto bail1;
 
     if (os2 && os2->version >= 0x0001 && os2->version != 0xffff)
     {
diff --git a/src/fcmatch.c b/src/fcmatch.c
index 3bc352b..e370e8b 100644
--- a/src/fcmatch.c
+++ b/src/fcmatch.c
@@ -347,6 +347,7 @@ typedef enum _FcMatcherPriority {
     PRI1(ANTIALIAS),
     PRI1(RASTERIZER),
     PRI1(OUTLINE),
+    PRI1(ORDER),
     PRI1(FONTVERSION),
     PRI_END
 } FcMatcherPriority;
diff --git a/src/fcobjs.h b/src/fcobjs.h
index dd4a6ec..acc0471 100644
--- a/src/fcobjs.h
+++ b/src/fcobjs.h
@@ -73,4 +73,5 @@ FC_OBJECT (SYMBOL,		FcTypeBool,	FcCompareBool)
 FC_OBJECT (FONT_VARIATIONS,	FcTypeString,	NULL)
 FC_OBJECT (VARIABLE,		FcTypeBool,	FcCompareBool)
 FC_OBJECT (FONT_HAS_HINT,	FcTypeBool,	FcCompareBool)
+FC_OBJECT (ORDER,		FcTypeInteger,	FcCompareNumber)
 /* ^-------------- Add new objects here. */


More information about the Fontconfig mailing list