]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcfreetype.c
Eliminate unused vars reported by Intel's compiler.
[fontconfig.git] / src / fcfreetype.c
index 8cdc647c2cd6fd419049ec3b4e94cd3246e933dc..4ce9f961c6259684e3fb51e006e3048271fc1985 100644 (file)
@@ -97,7 +97,7 @@ FcFreeTypeIsExclusiveLang (const FcChar8  *lang)
 
     for (i = 0; i < NUM_CODE_PAGE_RANGE; i++)
     {
-       if (FcLangCompare (lang, FcCodePageRange[i].lang) != FcLangDifferentLang)
+       if (FcLangCompare (lang, FcCodePageRange[i].lang) == FcLangEqual)
            return FcTrue;
     }
     return FcFalse;
@@ -1000,6 +1000,7 @@ FcFreeTypeQuery (const FcChar8    *file,
     FcChar8        *family = 0;
 #endif
     FcChar8        *complex;
+    FcChar8        *file2;
     const FcChar8   *foundry = 0;
     int                    spacing;
     TT_OS2         *os2;
@@ -1280,8 +1281,13 @@ FcFreeTypeQuery (const FcChar8   *file,
                printf ("Saving unique fullname %s\n", full);
     }
 
-    if (!FcPatternAddString (pat, FC_FILE, (FcChar8 *)basename((char *)FcStrCopy(file))))
+    file2 = FcStrCopy (file);
+    if (!FcPatternAddString (pat, FC_FILE, (FcChar8 *)basename((char *)file2)))
+    {
+       FcStrFree (file2);
        goto bail1;
+    }
+    FcStrFree (file2);
 
     FcPatternAddFullFname (pat, (const char *)FcStrCopy (file));
 
@@ -1555,17 +1561,20 @@ FcFreeTypeQuery (const FcChar8  *file,
     }
 #endif
 
-#if 0
     /*
      * Skip over PCF fonts that have no encoded characters; they're
      * usually just Unicode fonts transcoded to some legacy encoding
+     * ftglue.c forces us to approximate whether a font is a PCF font
+     * or not by whether it has any BDF properties.  Try PIXEL_SIZE;
+     * I don't know how to get a list of BDF properties on the font. -PL
      */
     if (FcCharSetCount (cs) == 0)
     {
-       if (!strcmp(FT_MODULE_CLASS(&face->driver->root)->module_name, "pcf"))
+#if HAVE_FT_GET_BDF_PROPERTY
+       if(FT_Get_BDF_Property(face, "PIXEL_SIZE", &prop) == 0)
            goto bail2;
-    }
 #endif
+    }
 
     if (!FcPatternAddCharSet (pat, FC_CHARSET, cs))
        goto bail2;
@@ -1591,15 +1600,20 @@ FcFreeTypeQuery (const FcChar8  *file,
        for (i = 0; i < face->num_fixed_sizes; i++)
            if (!FcPatternAddDouble (pat, FC_PIXEL_SIZE,
                                     FcGetPixelSize (face, i)))
-               goto bail1;
+               goto bail2;
        if (!FcPatternAddBool (pat, FC_ANTIALIAS, FcFalse))
-           goto bail1;
+           goto bail2;
 #if HAVE_FT_GET_BDF_PROPERTY
         if(face->num_fixed_sizes == 1) {
             int rc;
             int value;
             BDF_PropertyRec prop;
 
+           /* skip bitmap fonts which do not even have a family name */
+           rc =  FT_Get_BDF_Property(face, "FAMILY_NAME", &prop);
+           if (rc != 0 || prop.type != BDF_PROPERTY_TYPE_ATOM)
+               goto bail2;
+
             rc = FT_Get_BDF_Property(face, "POINT_SIZE", &prop);
             if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_INTEGER)
                 value = prop.u.integer;
@@ -2419,7 +2433,7 @@ FcFreeTypeCheckGlyph (FT_Face face, FcChar32 ucs4,
 FcCharSet *
 FcFreeTypeCharSetAndSpacing (FT_Face face, FcBlanks *blanks, int *spacing)
 {
-    FcChar32       page, off, max, ucs4;
+    FcChar32       page, off, ucs4;
 #ifdef CHECK
     FcChar32       font_max = 0;
 #endif
@@ -2500,7 +2514,6 @@ FcFreeTypeCharSetAndSpacing (FT_Face face, FcBlanks *blanks, int *spacing)
        {
            FT_UInt gindex;
          
-           max = fcFontDecoders[o].max;
            /*
             * Find the first encoded character in the font
             */