Changeset 1540


Ignore:
Timestamp:
Apr 18, 2016, 11:40:05 PM (9 years ago)
Author:
dmik
Message:

fontconfig: Properly recognize Type1 fonts listed in OS/2 PM Registry.

These fonts were skipped before because they are stored as .OFM files in PM_Fonts
while Freetype only understands .PFB files.

Location:
fontconfig/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified fontconfig/trunk/src/fcdir.c

    r1217 r1540  
    272272            char *key = buf;
    273273            char font [CCHMAXPATH];
     274            int len;
    274275
    275276            while (*key)
    276277            {
    277                 if (PrfQueryProfileString (HINI_USERPROFILE, "PM_Fonts", key, NULL, font, CCHMAXPATH) > 0)
     278                if ((len = PrfQueryProfileString (HINI_USERPROFILE, "PM_Fonts", key, NULL, font, CCHMAXPATH)) > 0)
    278279                {
    279280                    FcBool ok = FcFalse;
    280                     FcChar8 *f = FcStrCanonFilename ((FcChar8 *)font);
     281                    FcChar8 *f;
     282
     283                    /* PM_Fonts stores .OFM files for Type1 fonts while Freetype needs .PFB */
     284                    if (len >= 5 && stricmp (&font [len - 5], ".OFM") == 0)
     285                        strcpy (&font [len - 5], ".PFB");
     286
     287                    f = FcStrCanonFilename ((FcChar8 *)font);
    281288                    if (f)
    282289                    {
  • TabularUnified fontconfig/trunk/src/fcstat.c

    r1217 r1540  
    350350                if ((len = PrfQueryProfileString (HINI_USERPROFILE, "PM_Fonts", key, NULL, font, CCHMAXPATH)) > 0)
    351351                {
     352                    /* PM_Fonts stores .OFM files for Type1 fonts while Freetype needs .PFB */
     353                    if (len >= 5 && stricmp (&font [len - 5], ".OFM") == 0)
     354                        strcpy (&font [len - 5], ".PFB");
     355
    352356                    Adler32Update (&ctx, font, len);
    353357
Note: See TracChangeset for help on using the changeset viewer.