* 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.
This commit is contained in:
Werner Lemberg 2004-07-25 21:18:29 +00:00
parent 91d0f1ebbe
commit 2541a40d95
3 changed files with 78 additions and 32 deletions

View File

@ -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

View File

@ -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 );

View File

@ -369,11 +369,48 @@ 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 ( pixel_height == (FT_UInt)face->root.available_sizes->height )
{
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(( "pixel size WRONG\n" ));
return PCF_Err_Invalid_Pixel_Size;
}
}
FT_CALLBACK_DEF( FT_Error )
PCF_Set_Point_Size( FT_Size size,
FT_F26Dot6 char_width,
FT_F26Dot6 char_height,
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 );
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 )
{
@ -397,22 +434,6 @@ THE SOFTWARE.
}
FT_CALLBACK_DEF( FT_Error )
PCF_Set_Point_Size( FT_Size size,
FT_F26Dot6 char_width,
FT_F26Dot6 char_height,
FT_UInt horz_resolution,
FT_UInt vert_resolution )
{
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_CALLBACK_DEF( FT_Error )
PCF_Glyph_Load( FT_GlyphSlot slot,
FT_Size size,