[gf] Added GF_Size_Request and GF_Size_Select functions.
This commit is contained in:
parent
577efd8f17
commit
265cc448fd
|
@ -144,11 +144,59 @@
|
|||
//TO-DO
|
||||
}
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
GF_Size_Select( FT_Size size,
|
||||
FT_ULong strike_index )
|
||||
{
|
||||
GF_Face face = (GF_Face)size->face;
|
||||
|
||||
FT_UNUSED( strike_index );
|
||||
|
||||
|
||||
FT_Select_Metrics( size->face, 0 );
|
||||
|
||||
size->metrics.ascender = /* */ ;
|
||||
size->metrics.descender = /* */ ;
|
||||
size->metrics.max_advance = /* */ ;
|
||||
|
||||
return FT_Err_Ok;
|
||||
|
||||
}
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
GF_Size_Request( FT_Size size,
|
||||
FT_Size_Request req )
|
||||
{
|
||||
//TO-DO
|
||||
GF_Face face = (GF_Face)size->face;
|
||||
FT_Bitmap_Size* bsize = size->face->available_sizes;
|
||||
FT_Error error = FT_ERR( Invalid_Pixel_Size );
|
||||
FT_Long height;
|
||||
|
||||
|
||||
height = FT_REQUEST_HEIGHT( req );
|
||||
height = ( height + 32 ) >> 6;
|
||||
|
||||
switch ( req->type )
|
||||
{
|
||||
case FT_SIZE_REQUEST_TYPE_NOMINAL:
|
||||
if ( height == ( ( bsize->y_ppem + 32 ) >> 6 ) )
|
||||
error = FT_Err_Ok;
|
||||
break;
|
||||
|
||||
case FT_SIZE_REQUEST_TYPE_REAL_DIM:
|
||||
if ( height == /* */ )
|
||||
error = FT_Err_Ok;
|
||||
break;
|
||||
|
||||
default:
|
||||
error = FT_THROW( Unimplemented_Feature );
|
||||
break;
|
||||
}
|
||||
|
||||
if ( error )
|
||||
return error;
|
||||
else
|
||||
return GF_Size_Select( size, 0 );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue