]> git.wh0rd.org Git - fontconfig.git/commitdiff
Use code from HEAD in computing pixel sizes of fonts so that vageries in
authorKeith Packard <keithp@keithp.com>
Tue, 30 Mar 2004 17:17:20 +0000 (17:17 +0000)
committerKeith Packard <keithp@keithp.com>
Tue, 30 Mar 2004 17:17:20 +0000 (17:17 +0000)
    FreeType over y_ppem/height issues don't affect what pixel size values
    are used.

ChangeLog
src/fcfreetype.c

index f71330fe6136a99058066b73b0abeffb8dfe0bc5..9d50541cdaae4f3e37afe5606848fdec60d63453 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-03-30  Keith Packard  <keithp@keithp.com>
+
+       * src/fcfreetype.c: (FcGetPixelSize), (FcFreeTypeQuery):
+       Use code from HEAD in computing pixel sizes of fonts
+       so that vageries in FreeType over y_ppem/height issues
+       don't affect what pixel size values are used.
+
 2004-03-30  Keith Packard  <keithp@keithp.com>
 
        Bug #387 - usr352@wanadoo.es (Pedro Gimeno)
index 1211dc69fbe0832e8ced35d7674f5c15d8daa3e4..d9282246ebff72882a923ef2e4bfc12aca9beaa5 100644 (file)
@@ -256,6 +256,26 @@ FcVendorFoundry(const char *vendor)
     return 0;
 }
 
+static double
+FcGetPixelSize (FT_Face face, int i)
+{
+#if HAVE_FT_GET_BDF_PROPERTY
+    if (face->num_fixed_sizes == 1)
+    {
+       BDF_PropertyRec prop;
+       int             rc;
+
+       rc = MY_Get_BDF_Property (face, "PIXEL_SIZE", &prop);
+       if (rc == 0 && prop.type == BDF_PROPERTY_TYPE_INTEGER)
+           return (double) prop.u.integer;
+    }
+#endif
+#if HAVE_FT_BITMAP_SIZE_Y_PPEM
+    return (double) face->available_sizes[i].y_ppem / 64.0;
+#else
+    return (double) face->available_sizes[i].height;
+#endif
+}
 
 FcPattern *
 FcFreeTypeQuery (const FcChar8 *file,
@@ -908,7 +928,7 @@ FcFreeTypeQuery (const FcChar8      *file,
     {
        for (i = 0; i < face->num_fixed_sizes; i++)
            if (!FcPatternAddDouble (pat, FC_PIXEL_SIZE,
-                                    (double) face->available_sizes[i].height))
+                                    FcGetPixelSize (face, i)))
                goto bail1;
        if (!FcPatternAddBool (pat, FC_ANTIALIAS, FcFalse))
            goto bail1;