PostScript Name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

A while back I sent a patch which made fontconfig catch PostScript names. I apologize for the long gap of time, but here is an updated patch with the FC_CACHE_CONTENT_VERSION incremented.

Please let me no if there is anything preventing this patch being applied to the main repository.

Thanks,
- Isaiah Beerbower

--
www.ipaqah.com
diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h
index cd650a1..831b53e 100644
--- a/fontconfig/fontconfig.h
+++ b/fontconfig/fontconfig.h
@@ -81,6 +81,7 @@ typedef int		FcBool;
 #define FC_PIXEL_SIZE	    "pixelsize"		/* Double */
 #define FC_SPACING	    "spacing"		/* Int */
 #define FC_FOUNDRY	    "foundry"		/* String */
+#define FC_POSTSCRIPT_NAME	    "postscriptname"		/* String */
 #define FC_ANTIALIAS	    "antialias"		/* Bool (depends) */
 #define FC_HINTING	    "hinting"		/* Bool (true) */
 #define FC_HINT_STYLE	    "hintstyle"		/* Int */
diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index a79308c..c041249 100644
--- a/src/fcfreetype.c
+++ b/src/fcfreetype.c
@@ -1121,6 +1121,7 @@ FcFreeTypeQueryFace (const FT_Face  face,
 #endif
     FcChar8	    *complex;
     const FcChar8   *foundry = 0;
+    const FcChar8   *psname = 0;
     int		    spacing;
     TT_OS2	    *os2;
 #if HAVE_FT_GET_PS_FONT_INFO
@@ -1370,6 +1371,13 @@ FcFreeTypeQueryFace (const FT_Face  face,
 	++nfamily;
     }
 
+	psname = (const FcChar8 *) FT_Get_Postscript_Name(face);
+	if (psname)
+	{
+    if (!FcPatternAddString (pat, FC_POSTSCRIPT_NAME, psname))
+	goto bail1;
+	}
+
     if (!FcPatternAddString (pat, FC_FILE, file))
 	goto bail1;
 
diff --git a/src/fcint.h b/src/fcint.h
index 8912d16..5f1baa4 100644
--- a/src/fcint.h
+++ b/src/fcint.h
@@ -410,7 +410,7 @@ typedef struct _FcCaseFold {
 
 #define FC_CACHE_MAGIC_MMAP	    0xFC02FC04
 #define FC_CACHE_MAGIC_ALLOC	    0xFC02FC05
-#define FC_CACHE_CONTENT_VERSION    2
+#define FC_CACHE_CONTENT_VERSION    3
 
 struct _FcAtomic {
     FcChar8	*file;		/* original file name */
@@ -849,7 +849,8 @@ FcListPatternMatchAny (const FcPattern *p,
 #define FC_EMBEDDED_BITMAP_OBJECT	39
 #define FC_DECORATIVE_OBJECT	40
 #define FC_LCD_FILTER_OBJECT	41
-#define FC_MAX_BASE_OBJECT	FC_LCD_FILTER_OBJECT
+#define FC_POSTSCRIPT_NAME_OBJECT	42
+#define FC_MAX_BASE_OBJECT	FC_POSTSCRIPT_NAME_OBJECT
 
 FcPrivate FcBool
 FcNameBool (const FcChar8 *v, FcBool *result);
diff --git a/src/fcmatch.c b/src/fcmatch.c
index f104e05..a7c2878 100644
--- a/src/fcmatch.c
+++ b/src/fcmatch.c
@@ -187,66 +187,70 @@ static FcMatcher _FcMatchers [] = {
     { FC_FOUNDRY_OBJECT,	FcCompareString,	0, 0 },
 #define MATCH_FOUNDRY	    0
 #define MATCH_FOUNDRY_INDEX 0
+
+    { FC_POSTSCRIPT_NAME_OBJECT,	FcCompareString,	1, 1 },
+#define MATCH_POSTSCRIPT_NAME	    1
+#define MATCH_POSTSCRIPT_NAME_INDEX 1
     
-    { FC_CHARSET_OBJECT,	FcCompareCharSet,	1, 1 },
-#define MATCH_CHARSET	    1
-#define MATCH_CHARSET_INDEX 1
+    { FC_CHARSET_OBJECT,	FcCompareCharSet,	2, 2 },
+#define MATCH_CHARSET	    2
+#define MATCH_CHARSET_INDEX 2
     
-    { FC_FAMILY_OBJECT,    	FcCompareFamily,	2, 4 },
-#define MATCH_FAMILY	    2
-#define MATCH_FAMILY_STRONG_INDEX   2
-#define MATCH_FAMILY_WEAK_INDEX	    4
+    { FC_FAMILY_OBJECT,    	FcCompareFamily,	3, 5 },
+#define MATCH_FAMILY	    3
+#define MATCH_FAMILY_STRONG_INDEX   3
+#define MATCH_FAMILY_WEAK_INDEX	    5
     
-    { FC_LANG_OBJECT,		FcCompareLang,	3, 3 },
-#define MATCH_LANG	    3
-#define MATCH_LANG_INDEX    3
+    { FC_LANG_OBJECT,		FcCompareLang,	4, 4 },
+#define MATCH_LANG	    4
+#define MATCH_LANG_INDEX    4
     
-    { FC_SPACING_OBJECT,	FcCompareNumber,	5, 5 },
-#define MATCH_SPACING	    4
-#define MATCH_SPACING_INDEX 5
+    { FC_SPACING_OBJECT,	FcCompareNumber,	6, 6 },
+#define MATCH_SPACING	    5
+#define MATCH_SPACING_INDEX 6
     
-    { FC_PIXEL_SIZE_OBJECT,	FcCompareSize,	6, 6 },
-#define MATCH_PIXEL_SIZE    5
-#define MATCH_PIXEL_SIZE_INDEX	6
+    { FC_PIXEL_SIZE_OBJECT,	FcCompareSize,	7, 7 },
+#define MATCH_PIXEL_SIZE    6
+#define MATCH_PIXEL_SIZE_INDEX	7
     
-    { FC_STYLE_OBJECT,		FcCompareString,	7, 7 },
-#define MATCH_STYLE	    6
-#define MATCH_STYLE_INDEX   7
+    { FC_STYLE_OBJECT,		FcCompareString,	8, 8 },
+#define MATCH_STYLE	    7
+#define MATCH_STYLE_INDEX   8
     
-    { FC_SLANT_OBJECT,		FcCompareNumber,	8, 8 },
-#define MATCH_SLANT	    7
-#define MATCH_SLANT_INDEX   8
+    { FC_SLANT_OBJECT,		FcCompareNumber,	9, 9 },
+#define MATCH_SLANT	    8
+#define MATCH_SLANT_INDEX   9
     
-    { FC_WEIGHT_OBJECT,		FcCompareNumber,	9, 9 },
-#define MATCH_WEIGHT	    8
-#define MATCH_WEIGHT_INDEX  9
+    { FC_WEIGHT_OBJECT,		FcCompareNumber,	10, 10 },
+#define MATCH_WEIGHT	    9
+#define MATCH_WEIGHT_INDEX  10
     
-    { FC_WIDTH_OBJECT,		FcCompareNumber,	10, 10 },
-#define MATCH_WIDTH	    9
-#define MATCH_WIDTH_INDEX   10
+    { FC_WIDTH_OBJECT,		FcCompareNumber,	11, 11 },
+#define MATCH_WIDTH	    10
+#define MATCH_WIDTH_INDEX   11
     
-    { FC_DECORATIVE_OBJECT,	FcCompareBool,		11, 11 },
-#define MATCH_DECORATIVE	10
-#define MATCH_DECORATIVE_INDEX	11
+    { FC_DECORATIVE_OBJECT,	FcCompareBool,		12, 12 },
+#define MATCH_DECORATIVE	11
+#define MATCH_DECORATIVE_INDEX	12
 
-    { FC_ANTIALIAS_OBJECT,	FcCompareBool,		12, 12 },
-#define MATCH_ANTIALIAS		    11
-#define MATCH_ANTIALIAS_INDEX	    12
+    { FC_ANTIALIAS_OBJECT,	FcCompareBool,		13, 13 },
+#define MATCH_ANTIALIAS		    12
+#define MATCH_ANTIALIAS_INDEX	    13
     
-    { FC_RASTERIZER_OBJECT,	FcCompareString,	13, 13 },
-#define MATCH_RASTERIZER	    12
-#define MATCH_RASTERIZER_INDEX	    13
+    { FC_RASTERIZER_OBJECT,	FcCompareString,	14, 14 },
+#define MATCH_RASTERIZER	    13
+#define MATCH_RASTERIZER_INDEX	    14
 
-    { FC_OUTLINE_OBJECT,	FcCompareBool,		14, 14 },
-#define MATCH_OUTLINE		    13
-#define MATCH_OUTLINE_INDEX	    14
+    { FC_OUTLINE_OBJECT,	FcCompareBool,		15, 15 },
+#define MATCH_OUTLINE		    14
+#define MATCH_OUTLINE_INDEX	    15
 
-    { FC_FONTVERSION_OBJECT,	FcCompareNumber,	15, 15 },
-#define MATCH_FONTVERSION	    14
-#define MATCH_FONTVERSION_INDEX	    15
+    { FC_FONTVERSION_OBJECT,	FcCompareNumber,	16, 16 },
+#define MATCH_FONTVERSION	    15
+#define MATCH_FONTVERSION_INDEX	    16
 };
 
-#define NUM_MATCH_VALUES    16
+#define NUM_MATCH_VALUES    17
 
 static FcMatcher*
 FcObjectToMatcher (FcObject object)
@@ -257,6 +261,8 @@ FcObjectToMatcher (FcObject object)
     switch (object) {
     case FC_FOUNDRY_OBJECT:
 	i = MATCH_FOUNDRY; break;
+    case FC_POSTSCRIPT_NAME_OBJECT:
+	i = MATCH_POSTSCRIPT_NAME; break;
     case FC_FONTVERSION_OBJECT:
 	i = MATCH_FONTVERSION; break;
     case FC_FAMILY_OBJECT:
diff --git a/src/fcname.c b/src/fcname.c
index 7a5371b..fd32e41 100644
--- a/src/fcname.c
+++ b/src/fcname.c
@@ -75,7 +75,8 @@ static const FcObjectType _FcBaseObjectTypes[] = {
     { FC_EMBOLDEN,	FcTypeBool },
     { FC_EMBEDDED_BITMAP,   FcTypeBool },
     { FC_DECORATIVE,	FcTypeBool },
-    { FC_LCD_FILTER,	FcTypeInteger }, /* 41 */
+    { FC_LCD_FILTER,	FcTypeInteger },
+    { FC_POSTSCRIPT_NAME,	FcTypeString, }, /* 42 */
 };
 
 #define NUM_OBJECT_TYPES    (sizeof _FcBaseObjectTypes / sizeof _FcBaseObjectTypes[0])
_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig

[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux