From a71d524ecad48837e0124a03124bc05f59a48be7 Mon Sep 17 00:00:00 2001 From: marha Date: Thu, 30 Apr 2015 23:24:30 +0200 Subject: fontconfig pixman libX11 mesa git update 30 Apr 2015 libX11 commit d3415d1f052530760b4617db45affcb984cfe35c pixman commit e0c0153d8e5d42c08c2b9bd2cf2123bff2c48d75 fontconfig commit 4a6f5efd5f6a468e1872d58e589bcf30ba88e2fd mesa commit 1ac7db07b363207e8ded9259f84bbcaa084b8667 --- fontconfig/src/fcfreetype.c | 84 +++++++-------------------------------------- 1 file changed, 12 insertions(+), 72 deletions(-) (limited to 'fontconfig/src') diff --git a/fontconfig/src/fcfreetype.c b/fontconfig/src/fcfreetype.c index 50ff3489c..afbd9ac1e 100644 --- a/fontconfig/src/fcfreetype.c +++ b/fontconfig/src/fcfreetype.c @@ -978,76 +978,6 @@ FcNoticeFoundry(const FT_String *notice) return 0; } -static FcBool -FcVendorMatch(const FT_Char vendor[4], const FT_Char *vendor_string) -{ - /* vendor is not necessarily NUL-terminated. */ - int i, len; - - len = strlen((char *) vendor_string); - if (memcmp(vendor, vendor_string, len) != 0) - return FcFalse; - for (i = len; i < 4; i++) - if (vendor[i] != ' ' && vendor[i] != '\0') - return FcFalse; - return FcTrue; -} - -/* This table is partly taken from ttmkfdir by Joerg Pommnitz. */ - -/* It should not contain useless entries (such as UNKN) nor duplicate - entries for padding both with spaces and NULs. */ - -static const struct { - const FT_Char vendor[5]; - const FcChar8 foundry[13]; -} FcVendorFoundries[] = { - { "ADBE", "adobe"}, - { "AGFA", "agfa"}, - { "ALTS", "altsys"}, - { "APPL", "apple"}, - { "ARPH", "arphic"}, - { "ATEC", "alltype"}, - { "B&H", "b&h"}, - { "BITS", "bitstream"}, - { "CANO", "cannon"}, - { "CLM", "culmus"}, - { "DYNA", "dynalab"}, - { "EPSN", "epson"}, - { "FJ", "fujitsu"}, - { "IBM", "ibm"}, - { "ITC", "itc"}, - { "IMPR", "impress"}, - { "LARA", "larabiefonts"}, - { "LEAF", "interleaf"}, - { "LETR", "letraset"}, - { "LINO", "linotype"}, - { "MACR", "macromedia"}, - { "MONO", "monotype"}, - { "MS", "microsoft"}, - { "MT", "monotype"}, - { "NEC", "nec"}, - { "PARA", "paratype"}, - { "QMSI", "qms"}, - { "RICO", "ricoh"}, - { "URW", "urw"}, - { "Y&Y", "y&y"} -}; - -#define NUM_VENDOR_FOUNDRIES (int) (sizeof (FcVendorFoundries) / sizeof (FcVendorFoundries[0])) - -static const FcChar8 * -FcVendorFoundry(const FT_Char vendor[4]) -{ - int i; - - if (vendor) - for(i = 0; i < NUM_VENDOR_FOUNDRIES; i++) - if (FcVendorMatch (vendor, FcVendorFoundries[i].vendor)) - return FcVendorFoundries[i].foundry; - return 0; -} - typedef struct _FcStringConst { const FcChar8 *name; int value; @@ -1239,7 +1169,7 @@ FcFreeTypeQueryFace (const FT_Face face, #if 0 FcChar8 *family = 0; #endif - FcChar8 *complex_; + FcChar8 *complex_, *foundry_ = NULL; const FcChar8 *foundry = 0; int spacing; TT_OS2 *os2; @@ -1315,7 +1245,15 @@ FcFreeTypeQueryFace (const FT_Face face, */ if (os2 && os2->version >= 0x0001 && os2->version != 0xffff) - foundry = FcVendorFoundry(os2->achVendID); + { + if (os2->achVendID && os2->achVendID[0] != 0) + { + foundry_ = (FcChar8 *) malloc (sizeof (os2->achVendID) + 1); + memcpy ((void *)foundry_, os2->achVendID, sizeof (os2->achVendID)); + foundry_[sizeof (os2->achVendID)] = 0; + foundry = foundry_; + } + } if (FcDebug () & FC_DBG_SCANV) printf ("\n"); @@ -1946,6 +1884,8 @@ bail2: FcCharSetDestroy (cs); bail1: FcPatternDestroy (pat); + if (foundry_) + free (foundry_); bail0: return NULL; } -- cgit v1.2.3