]> git.wh0rd.org Git - fontconfig.git/commitdiff
Create FC_FONTFORMAT from FT_Get_X11_Font_Format function where available.
authorKeith Packard <keithp@keithp.com>
Sun, 5 Dec 2004 00:26:06 +0000 (00:26 +0000)
committerKeith Packard <keithp@keithp.com>
Sun, 5 Dec 2004 00:26:06 +0000 (00:26 +0000)
    This provides font file format information (BDF, Type 1, PCF, TrueType)
    for each font. Closes #109.

ChangeLog
configure.in
fontconfig/fontconfig.h
src/fcfreetype.c
src/fcname.c

index b89f20b1146e5bd195c2f29deb9575c62d85156e..fa19016680d449102f2f3bb95a99559e3872675c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2004-12-04  Keith Packard  <keithp@keithp.com>
+
+       * configure.in:
+       * fontconfig/fontconfig.h:
+       * src/fcfreetype.c: (FcFreeTypeQuery):
+       * src/fcname.c:
+       Create FC_FONTFORMAT from FT_Get_X11_Font_Format function where
+       available.  This provides font file format information (BDF, Type 1,
+       PCF, TrueType) for each font.  Closes #109.
+
 2004-12-04  Daniel Glassey <danglassey@ntlworld.com>
 
        reviewed by: Keith Packard  <keithp@keithp.com>
index 71f67421e85d004061d9125fe8ede5b99bdd004f..d28c7bf598ad8f3a299df316bc94faac5e37eafb 100644 (file)
@@ -134,7 +134,7 @@ fontconfig_save_libs="$LIBS"
 fontconfig_save_cflags="$CFLAGS"
 LIBS="$LIBS $FREETYPE_LIBS"
 CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
-AC_CHECK_FUNCS(FT_Get_Next_Char FT_Get_BDF_Property FT_Get_PS_Font_Info FT_Has_PS_Glyph_Names)
+AC_CHECK_FUNCS(FT_Get_Next_Char FT_Get_BDF_Property FT_Get_PS_Font_Info FT_Has_PS_Glyph_Names FT_Get_X11_Font_Format)
 AC_CHECK_MEMBER(FT_Bitmap_Size.y_ppem,
                HAVE_FT_BITMAP_SIZE_Y_PPEM=1,
                HAVE_FT_BITMAP_SIZE_Y_PPEM=0,
index 6758f276e6c4ee3a15d985b70e234c0aad701fae..fbccbbf8e3e8dedb883ca7129f970b58fd8c7fb7 100644 (file)
@@ -94,6 +94,7 @@ typedef int           FcBool;
 #define FC_STYLELANG       "stylelang"         /* String RFC 3066 langs */
 #define FC_FULLNAMELANG            "fullnamelang"      /* String RFC 3066 langs */
 #define FC_CAPABILITY       "capability"       /* String */
+#define FC_FONTFORMAT      "fontformat"        /* String */
 
 #define FC_DIR_CACHE_FILE          "fonts.cache-"FC_CACHE_VERSION
 #define FC_USER_CACHE_FILE         ".fonts.cache-"FC_CACHE_VERSION
index 0c2eafd6e66c31d81ebba8e8dcec11042ab59e3e..7ca65fdeec36504f7b2f6e7f79b89d62ae26a2c1 100644 (file)
@@ -58,6 +58,9 @@
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_SFNT_H
 #include FT_INTERNAL_TRUETYPE_TYPES_H
+#if HAVE_FT_GET_X11_FONT_FORMAT
+#include FT_XFREE86_H
+#endif
 
 #if HAVE_FT_GET_BDF_PROPERTY
 #include FT_BDF_H
@@ -1614,6 +1617,17 @@ FcFreeTypeQuery (const FcChar8   *file,
         ;
 #endif
     }
+#if HAVE_FT_GET_X11_FONT_FORMAT
+    /*
+     * Use the (not well documented or supported) X-specific function
+     * from FreeType to figure out the font format
+     */
+    {
+       const char *font_format = FT_Get_X11_Font_Format (face);
+       if (font_format)
+           FcPatternAddString (pat, FC_FONTFORMAT, font_format);
+    }
+#endif
 
     /*
      * Drop our reference to the charset
index 776fba863adbee08aaf6c9f62097ebb254d4e45b..c3b7698b8d1dfb44daa3183b7c3f87dcd9a8d4b7 100644 (file)
@@ -68,6 +68,7 @@ static const FcObjectType _FcBaseObjectTypes[] = {
     { FC_LANG,         FcTypeLangSet },
     { FC_FONTVERSION,  FcTypeInteger },
     { FC_CAPABILITY,   FcTypeString },
+    { FC_FONTFORMAT,   FcTypeString },
 };
 
 #define NUM_OBJECT_TYPES    (sizeof _FcBaseObjectTypes / sizeof _FcBaseObjectTypes[0])