+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>
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,
#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
#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
;
#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
{ FC_LANG, FcTypeLangSet },
{ FC_FONTVERSION, FcTypeInteger },
{ FC_CAPABILITY, FcTypeString },
+ { FC_FONTFORMAT, FcTypeString },
};
#define NUM_OBJECT_TYPES (sizeof _FcBaseObjectTypes / sizeof _FcBaseObjectTypes[0])