* src/pcf/pcfdrivr.c (PCF_Set_Pixel_Size): Compare heights, not ppem values. (PCF_Set_Point_Size): Don't call PCF_Set_Pixel_Size but provide own code to compare ppem values. * src/bdf/bdfdrivr.c (BDF_Set_Pixel_Size): Compare heights, not ppem values. (BDF_Set_Point_Size): Don't call BDF_Set_Pixel_Size but provide own code to compare ppem values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
diff --git a/ChangeLog b/ChangeLog
index 4265a78..59155c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2004-07-25 Detlef Würkner <TetiSoft@apg.lahn.de>
+
+ * src/pcf/pcfdrivr.c (PCF_Set_Pixel_Size): Compare heights, not
+ ppem values.
+ (PCF_Set_Point_Size): Don't call PCF_Set_Pixel_Size but provide own
+ code to compare ppem values.
+ * src/bdf/bdfdrivr.c (BDF_Set_Pixel_Size): Compare heights, not
+ ppem values.
+ (BDF_Set_Point_Size): Don't call BDF_Set_Pixel_Size but provide own
+ code to compare ppem values.
+
2004-07-25 Kornfeld Eliyahu Peter <peter@e-kadmon.net>
* src/sfnt/sfobjs.c (sfnt_load_face): Handle
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index 8f33d53..1aa3904 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -586,13 +586,9 @@ THE SOFTWARE.
FT_Face root = FT_FACE( face );
FT_UNUSED( char_width );
- FT_UNUSED( char_height );
-
- FT_TRACE4(( "rec %d - pres %d\n",
- size->metrics.y_ppem, root->available_sizes->y_ppem ));
- if ( size->metrics.y_ppem == root->available_sizes->y_ppem >> 6 )
+ if ( char_height == (FT_UInt)root->available_sizes->height )
{
size->metrics.ascender = face->bdffont->font_ascent << 6;
size->metrics.descender = -face->bdffont->font_descent << 6;
@@ -614,12 +610,30 @@ THE SOFTWARE.
FT_UInt horz_resolution,
FT_UInt vert_resolution )
{
+ BDF_Face face = (BDF_Face)FT_SIZE_FACE( size );
+ FT_Face root = FT_FACE( face );
+
FT_UNUSED( char_width );
FT_UNUSED( char_height );
FT_UNUSED( horz_resolution );
FT_UNUSED( vert_resolution );
- return BDF_Set_Pixel_Size( size, 0, 0 );
+
+ FT_TRACE4(( "rec %d - pres %d\n",
+ size->metrics.y_ppem, root->available_sizes->y_ppem ));
+
+ if ( size->metrics.y_ppem == root->available_sizes->y_ppem >> 6 )
+ {
+ size->metrics.ascender = face->bdffont->font_ascent << 6;
+ size->metrics.descender = -face->bdffont->font_descent << 6;
+ size->metrics.height = ( face->bdffont->font_ascent +
+ face->bdffont->font_descent ) << 6;
+ size->metrics.max_advance = face->bdffont->bbx.width << 6;
+
+ return BDF_Err_Ok;
+ }
+ else
+ return BDF_Err_Invalid_Pixel_Size;
}
@@ -629,13 +643,13 @@ THE SOFTWARE.
FT_UInt glyph_index,
FT_Int32 load_flags )
{
- BDF_Face face = (BDF_Face)FT_SIZE_FACE( size );
- FT_Error error = BDF_Err_Ok;
- FT_Bitmap* bitmap = &slot->bitmap;
- bdf_glyph_t glyph;
- int bpp = face->bdffont->bpp;
- int i, j, count;
- unsigned char *p, *pp;
+ BDF_Face face = (BDF_Face)FT_SIZE_FACE( size );
+ FT_Error error = BDF_Err_Ok;
+ FT_Bitmap* bitmap = &slot->bitmap;
+ bdf_glyph_t glyph;
+ int bpp = face->bdffont->bpp;
+ int i, j, count;
+ unsigned char *p, *pp;
FT_UNUSED( load_flags );
diff --git a/src/pcf/pcfdrivr.c b/src/pcf/pcfdrivr.c
index b6b04b9..ddb9b09 100644
--- a/src/pcf/pcfdrivr.c
+++ b/src/pcf/pcfdrivr.c
@@ -369,13 +369,9 @@ THE SOFTWARE.
PCF_Face face = (PCF_Face)FT_SIZE_FACE( size );
FT_UNUSED( pixel_width );
- FT_UNUSED( pixel_height );
- FT_TRACE4(( "rec %d - pres %d\n", size->metrics.y_ppem,
- face->root.available_sizes->y_ppem >> 6 ));
-
- if ( size->metrics.y_ppem == face->root.available_sizes->y_ppem >> 6 )
+ if ( pixel_height == (FT_UInt)face->root.available_sizes->height )
{
size->metrics.ascender = face->accel.fontAscent << 6;
size->metrics.descender = face->accel.fontDescent * (-64);
@@ -391,7 +387,7 @@ THE SOFTWARE.
}
else
{
- FT_TRACE4(( "size WRONG\n" ));
+ FT_TRACE4(( "pixel size WRONG\n" ));
return PCF_Err_Invalid_Pixel_Size;
}
}
@@ -404,12 +400,37 @@ THE SOFTWARE.
FT_UInt horz_resolution,
FT_UInt vert_resolution )
{
+ PCF_Face face = (PCF_Face)FT_SIZE_FACE( size );
+
FT_UNUSED( char_width );
FT_UNUSED( char_height );
FT_UNUSED( horz_resolution );
FT_UNUSED( vert_resolution );
- return PCF_Set_Pixel_Size( size, 0, 0 );
+
+ FT_TRACE4(( "rec %d - pres %d\n",
+ size->metrics.y_ppem,
+ face->root.available_sizes->y_ppem >> 6 ));
+
+ if ( size->metrics.y_ppem == face->root.available_sizes->y_ppem >> 6 )
+ {
+ size->metrics.ascender = face->accel.fontAscent << 6;
+ size->metrics.descender = face->accel.fontDescent * (-64);
+#if 0
+ size->metrics.height = face->accel.maxbounds.ascent << 6;
+#endif
+ size->metrics.height = size->metrics.ascender -
+ size->metrics.descender;
+
+ size->metrics.max_advance = face->accel.maxbounds.characterWidth << 6;
+
+ return PCF_Err_Ok;
+ }
+ else
+ {
+ FT_TRACE4(( "size WRONG\n" ));
+ return PCF_Err_Invalid_Pixel_Size;
+ }
}