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.
This commit is contained in:
Keith Packard 2004-12-05 00:26:06 +00:00
parent dbf68dd5fe
commit 537e3d23fa
5 changed files with 27 additions and 1 deletions

View File

@ -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> 2004-12-04 Daniel Glassey <danglassey@ntlworld.com>
reviewed by: Keith Packard <keithp@keithp.com> reviewed by: Keith Packard <keithp@keithp.com>

View File

@ -134,7 +134,7 @@ fontconfig_save_libs="$LIBS"
fontconfig_save_cflags="$CFLAGS" fontconfig_save_cflags="$CFLAGS"
LIBS="$LIBS $FREETYPE_LIBS" LIBS="$LIBS $FREETYPE_LIBS"
CFLAGS="$CFLAGS $FREETYPE_CFLAGS" 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, AC_CHECK_MEMBER(FT_Bitmap_Size.y_ppem,
HAVE_FT_BITMAP_SIZE_Y_PPEM=1, HAVE_FT_BITMAP_SIZE_Y_PPEM=1,
HAVE_FT_BITMAP_SIZE_Y_PPEM=0, HAVE_FT_BITMAP_SIZE_Y_PPEM=0,

View File

@ -94,6 +94,7 @@ typedef int FcBool;
#define FC_STYLELANG "stylelang" /* String RFC 3066 langs */ #define FC_STYLELANG "stylelang" /* String RFC 3066 langs */
#define FC_FULLNAMELANG "fullnamelang" /* String RFC 3066 langs */ #define FC_FULLNAMELANG "fullnamelang" /* String RFC 3066 langs */
#define FC_CAPABILITY "capability" /* String */ #define FC_CAPABILITY "capability" /* String */
#define FC_FONTFORMAT "fontformat" /* String */
#define FC_DIR_CACHE_FILE "fonts.cache-"FC_CACHE_VERSION #define FC_DIR_CACHE_FILE "fonts.cache-"FC_CACHE_VERSION
#define FC_USER_CACHE_FILE ".fonts.cache-"FC_CACHE_VERSION #define FC_USER_CACHE_FILE ".fonts.cache-"FC_CACHE_VERSION

View File

@ -58,6 +58,9 @@
#include FT_INTERNAL_STREAM_H #include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_SFNT_H #include FT_INTERNAL_SFNT_H
#include FT_INTERNAL_TRUETYPE_TYPES_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 #if HAVE_FT_GET_BDF_PROPERTY
#include FT_BDF_H #include FT_BDF_H
@ -1614,6 +1617,17 @@ FcFreeTypeQuery (const FcChar8 *file,
; ;
#endif #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 * Drop our reference to the charset

View File

@ -68,6 +68,7 @@ static const FcObjectType _FcBaseObjectTypes[] = {
{ FC_LANG, FcTypeLangSet }, { FC_LANG, FcTypeLangSet },
{ FC_FONTVERSION, FcTypeInteger }, { FC_FONTVERSION, FcTypeInteger },
{ FC_CAPABILITY, FcTypeString }, { FC_CAPABILITY, FcTypeString },
{ FC_FONTFORMAT, FcTypeString },
}; };
#define NUM_OBJECT_TYPES (sizeof _FcBaseObjectTypes / sizeof _FcBaseObjectTypes[0]) #define NUM_OBJECT_TYPES (sizeof _FcBaseObjectTypes / sizeof _FcBaseObjectTypes[0])