diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h index c9f20cc..b783ae4 100644 --- a/fontconfig/fontconfig.h +++ b/fontconfig/fontconfig.h @@ -112,6 +112,30 @@ typedef int FcBool; #define FC_DECORATIVE "decorative" /* Bool - true if style is a decorative variant */ #define FC_LCD_FILTER "lcdfilter" /* Int */ +#define FC_TT_COPYRIGHT "ttcopyright" /* String */ +#define FC_TT_COPYRIGHTLANG "ttcopyrightlang" /* String RFC 3066 langs */ +#define FC_TT_VERSIONSTRING "ttversionstring" /* String */ +#define FC_TT_VERSIONSTRINGLANG "ttversionstringlang" /* String RFC 3066 langs */ +#define FC_TT_TRADEMARK "tttrademark" /* String */ +#define FC_TT_TRADEMARKLANG "tttrademarklang" /* String RFC 3066 langs */ +#define FC_TT_MANUFACTURER "ttmanufacturer" /* String */ +#define FC_TT_MANUFACTURERLANG "ttmanufacturerlang" /* String RFC 3066 langs */ +#define FC_TT_DESIGNER "ttdesigner" /* String */ +#define FC_TT_DESIGNERLANG "ttdesignerlang" /* String RFC 3066 langs */ +#define FC_TT_DESCRIPTION "ttdescription" /* String */ +#define FC_TT_DESCRIPTIONLANG "ttdescriptionlang" /* String RFC 3066 langs */ +#define FC_TT_VENDORURL "ttvendorurl" /* String */ +#define FC_TT_VENDORURLLANG "ttvendorurllang" /* String RFC 3066 langs */ +#define FC_TT_DESIGNERURL "ttdesignerurl" /* String */ +#define FC_TT_DESIGNERURLLANG "ttdesignerurllang" /* String RFC 3066 langs */ +#define FC_TT_LICENSE "ttlicense" /* String */ +#define FC_TT_LICENSELANG "ttlicenselang" /* String RFC 3066 langs */ +#define FC_TT_LICENSEURL "ttlicenseurl" /* String */ +#define FC_TT_LICENSEURLLANG "ttlicenseurllang" /* String RFC 3066 langs */ +#define FC_TT_SAMPLETEXT "ttsampletext" /* String */ +#define FC_TT_SAMPLETEXTLANG "ttsampletextlang" /* String RFC 3066 langs */ + + #define FC_CACHE_SUFFIX ".cache-"FC_CACHE_VERSION #define FC_DIR_CACHE_FILE "fonts.cache-"FC_CACHE_VERSION #define FC_USER_CACHE_FILE ".fonts.cache-"FC_CACHE_VERSION diff --git a/src/fcfreetype.c b/src/fcfreetype.c index 0eb7710..d922272 100644 --- a/src/fcfreetype.c +++ b/src/fcfreetype.c @@ -1106,6 +1106,15 @@ static const FT_UShort nameid_order[] = { TT_NAME_ID_FONT_SUBFAMILY, TT_NAME_ID_TRADEMARK, TT_NAME_ID_MANUFACTURER, + TT_NAME_ID_COPYRIGHT, + TT_NAME_ID_VERSION_STRING, + TT_NAME_ID_DESIGNER, + TT_NAME_ID_DESCRIPTION, + TT_NAME_ID_VENDOR_URL, + TT_NAME_ID_DESIGNER_URL, + TT_NAME_ID_LICENSE, + TT_NAME_ID_LICENSE_URL, + TT_NAME_ID_SAMPLE_TEXT, }; #define NUM_NAMEID_ORDER (sizeof (nameid_order) / sizeof (nameid_order[0])) @@ -1150,6 +1159,22 @@ FcFreeTypeQueryFace (const FT_Face face, int p, platform; int n, nameid; +#define DECLARE_N_STRING( s ) \ + int n ## s = 0, n ## s ## _lang = 0 + DECLARE_N_STRING( ttcopyright ); + DECLARE_N_STRING( ttversionstring ); + DECLARE_N_STRING( tttrademark ); + DECLARE_N_STRING( ttmanufacturer ); + DECLARE_N_STRING( ttdesigner ); + DECLARE_N_STRING( ttdescription ); + DECLARE_N_STRING( ttvendorurl ); + DECLARE_N_STRING( ttdesignerurl ); + DECLARE_N_STRING( ttlicense ); + DECLARE_N_STRING( ttlicenseurl ); + DECLARE_N_STRING( ttsampletext ); +#undef DECLARE_N_STRING + + FcChar8 *style = 0; int st; @@ -1292,12 +1317,43 @@ FcFreeTypeQueryFace (const FT_Face face, np = &nstyle; nlangp = &nstyle_lang; break; + +#define SET_FC_ELT( s0, s1 ) \ + elt = s0 ; \ + eltlang = s0 ## LANG ; \ + np = &( n ## s1 ); \ + nlangp = &( n ## s1 ## _lang ); \ + break + + case TT_NAME_ID_COPYRIGHT: + SET_FC_ELT( FC_TT_COPYRIGHT, ttcopyright ); + case TT_NAME_ID_VERSION_STRING: + SET_FC_ELT( FC_TT_VERSIONSTRING, ttversionstring ); case TT_NAME_ID_TRADEMARK: + /* If the foundry wasn't found in the OS/2 table, look here */ + if(!foundry) + foundry = FcNoticeFoundry((FT_String *) utf8); + SET_FC_ELT( FC_TT_TRADEMARK, tttrademark ); case TT_NAME_ID_MANUFACTURER: /* If the foundry wasn't found in the OS/2 table, look here */ if(!foundry) foundry = FcNoticeFoundry((FT_String *) utf8); - break; + SET_FC_ELT( FC_TT_MANUFACTURER, ttmanufacturer ); + case TT_NAME_ID_DESIGNER: + SET_FC_ELT( FC_TT_DESIGNER, ttdesigner ); + case TT_NAME_ID_DESCRIPTION: + SET_FC_ELT( FC_TT_DESCRIPTION, ttdescription ); + case TT_NAME_ID_VENDOR_URL: + SET_FC_ELT( FC_TT_VENDORURL, ttvendorurl ); + case TT_NAME_ID_DESIGNER_URL: + SET_FC_ELT( FC_TT_DESIGNERURL, ttdesignerurl ); + case TT_NAME_ID_LICENSE: + SET_FC_ELT( FC_TT_LICENSE, ttlicense ); + case TT_NAME_ID_LICENSE_URL: + SET_FC_ELT( FC_TT_LICENSEURL, ttlicenseurl ); + case TT_NAME_ID_SAMPLE_TEXT: + SET_FC_ELT( FC_TT_SAMPLETEXT, ttsampletext ); +#undef SET_FC_ELT } if (elt) { diff --git a/src/fcint.h b/src/fcint.h index 46b6ddd..e0335ee 100644 --- a/src/fcint.h +++ b/src/fcint.h @@ -837,7 +837,30 @@ 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_TT_COPYRIGHT_OBJECT 42 +#define FC_TT_COPYRIGHTLANG_OBJECT 43 +#define FC_TT_VERSIONSTRING_OBJECT 44 +#define FC_TT_VERSIONSTRINGLANG_OBJECT 45 +#define FC_TT_TRADEMARK_OBJECT 46 +#define FC_TT_TRADEMARKLANG_OBJECT 47 +#define FC_TT_MANUFACTURER_OBJECT 48 +#define FC_TT_MANUFACTURERLANG_OBJECT 49 +#define FC_TT_DESIGNER_OBJECT 50 +#define FC_TT_DESIGNERLANG_OBJECT 51 +#define FC_TT_DESCRIPTION_OBJECT 52 +#define FC_TT_DESCRIPTIONLANG_OBJECT 53 +#define FC_TT_VENDORURL_OBJECT 54 +#define FC_TT_VENDORURLLANG_OBJECT 55 +#define FC_TT_DESIGNERURL_OBJECT 56 +#define FC_TT_DESIGNERURLLANG_OBJECT 57 +#define FC_TT_LICENSE_OBJECT 58 +#define FC_TT_LICENSELANG_OBJECT 59 +#define FC_TT_LICENSEURL_OBJECT 60 +#define FC_TT_LICENSEURLLANG_OBJECT 61 +#define FC_TT_SAMPLETEXT_OBJECT 62 +#define FC_TT_SAMPLETEXTLANG_OBJECT 63 + +#define FC_MAX_BASE_OBJECT FC_TT_SAMPLETEXTLANG_OBJECT FcPrivate FcBool FcNameBool (const FcChar8 *v, FcBool *result); diff --git a/src/fcname.c b/src/fcname.c index 5b0a932..4f39525 100644 --- a/src/fcname.c +++ b/src/fcname.c @@ -76,6 +76,28 @@ static const FcObjectType _FcBaseObjectTypes[] = { { FC_EMBEDDED_BITMAP, FcTypeBool }, { FC_DECORATIVE, FcTypeBool }, { FC_LCD_FILTER, FcTypeInteger }, /* 41 */ + { FC_TT_COPYRIGHT, FcTypeString }, + { FC_TT_COPYRIGHTLANG, FcTypeString }, + { FC_TT_VERSIONSTRING, FcTypeString }, + { FC_TT_VERSIONSTRINGLANG, FcTypeString }, + { FC_TT_TRADEMARK, FcTypeString }, + { FC_TT_TRADEMARKLANG, FcTypeString }, + { FC_TT_MANUFACTURER, FcTypeString }, + { FC_TT_MANUFACTURERLANG, FcTypeString }, + { FC_TT_DESIGNER, FcTypeString }, + { FC_TT_DESIGNERLANG, FcTypeString }, + { FC_TT_DESCRIPTION, FcTypeString }, + { FC_TT_DESCRIPTIONLANG, FcTypeString }, + { FC_TT_VENDORURL, FcTypeString }, + { FC_TT_VENDORURLLANG, FcTypeString }, + { FC_TT_DESIGNERURL, FcTypeString }, + { FC_TT_DESIGNERURLLANG, FcTypeString }, + { FC_TT_LICENSE, FcTypeString }, + { FC_TT_LICENSELANG, FcTypeString }, + { FC_TT_LICENSEURL, FcTypeString }, + { FC_TT_LICENSEURLLANG, FcTypeString }, + { FC_TT_SAMPLETEXT, FcTypeString }, + { FC_TT_SAMPLETEXTLANG, FcTypeString }, /* 63 */ }; #define NUM_OBJECT_TYPES (sizeof _FcBaseObjectTypes / sizeof _FcBaseObjectTypes[0])