|
|
|
@ -99,11 +99,12 @@ |
|
|
|
|
/* They can be implemented by format-specific interfaces. */ |
|
|
|
|
/* */ |
|
|
|
|
static FT_Error |
|
|
|
|
Get_Kerning( TT_Face face, |
|
|
|
|
Get_Kerning( FT_Face ttface, /* TT_Face */ |
|
|
|
|
FT_UInt left_glyph, |
|
|
|
|
FT_UInt right_glyph, |
|
|
|
|
FT_Vector* kerning ) |
|
|
|
|
{ |
|
|
|
|
TT_Face face = (TT_Face)ttface; |
|
|
|
|
TT_Kern0_Pair pair; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -194,12 +195,13 @@ |
|
|
|
|
/* FreeType error code. 0 means success. */ |
|
|
|
|
/* */ |
|
|
|
|
static FT_Error |
|
|
|
|
Set_Char_Sizes( TT_Size size, |
|
|
|
|
Set_Char_Sizes( FT_Size ttsize, /* TT_Size */ |
|
|
|
|
FT_F26Dot6 char_width, |
|
|
|
|
FT_F26Dot6 char_height, |
|
|
|
|
FT_UInt horz_resolution, |
|
|
|
|
FT_UInt vert_resolution ) |
|
|
|
|
{ |
|
|
|
|
TT_Size size = (TT_Size)ttsize; |
|
|
|
|
FT_Size_Metrics* metrics = &size->root.metrics; |
|
|
|
|
FT_Size_Metrics* metrics2 = &size->metrics; |
|
|
|
|
TT_Face face = (TT_Face)size->root.face; |
|
|
|
@ -259,8 +261,16 @@ |
|
|
|
|
/* FreeType error code. 0 means success. */ |
|
|
|
|
/* */ |
|
|
|
|
static FT_Error |
|
|
|
|
Set_Pixel_Sizes( TT_Size size ) |
|
|
|
|
Set_Pixel_Sizes( FT_Size ttsize, /* TT_Size */ |
|
|
|
|
FT_UInt pixel_width, |
|
|
|
|
FT_UInt pixel_height ) |
|
|
|
|
{ |
|
|
|
|
TT_Size size = (TT_Size)ttsize; |
|
|
|
|
|
|
|
|
|
FT_UNUSED( pixel_width ); |
|
|
|
|
FT_UNUSED( pixel_height ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* many things have been pre-computed by the base layer */ |
|
|
|
|
|
|
|
|
|
size->metrics = size->root.metrics; |
|
|
|
@ -300,12 +310,14 @@ |
|
|
|
|
/* FreeType error code. 0 means success. */ |
|
|
|
|
/* */ |
|
|
|
|
static FT_Error |
|
|
|
|
Load_Glyph( TT_GlyphSlot slot, |
|
|
|
|
TT_Size size, |
|
|
|
|
Load_Glyph( FT_GlyphSlot ttslot, /* TT_GlyphSlot */ |
|
|
|
|
FT_Size ttsize, /* TT_Size */ |
|
|
|
|
FT_UInt glyph_index, |
|
|
|
|
FT_Int32 load_flags ) |
|
|
|
|
{ |
|
|
|
|
FT_Error error; |
|
|
|
|
TT_GlyphSlot slot = (TT_GlyphSlot)ttslot; |
|
|
|
|
TT_Size size = (TT_Size)ttsize; |
|
|
|
|
FT_Error error; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( !slot ) |
|
|
|
@ -377,7 +389,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static FT_Module_Interface |
|
|
|
|
tt_get_interface( TT_Driver driver, |
|
|
|
|
tt_get_interface( FT_Module driver, /* TT_Driver */ |
|
|
|
|
const char* tt_interface ) |
|
|
|
|
{ |
|
|
|
|
FT_Module_Interface result; |
|
|
|
@ -390,12 +402,12 @@ |
|
|
|
|
return result; |
|
|
|
|
|
|
|
|
|
/* only return the default interface from the SFNT module */ |
|
|
|
|
sfntd = FT_Get_Module( driver->root.root.library, "sfnt" ); |
|
|
|
|
sfntd = FT_Get_Module( driver->library, "sfnt" ); |
|
|
|
|
if ( sfntd ) |
|
|
|
|
{ |
|
|
|
|
sfnt = (SFNT_Service)( sfntd->clazz->module_interface ); |
|
|
|
|
if ( sfnt ) |
|
|
|
|
return sfnt->get_interface( FT_MODULE( driver ), tt_interface ); |
|
|
|
|
return sfnt->get_interface( driver, tt_interface ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
@ -424,30 +436,29 @@ |
|
|
|
|
|
|
|
|
|
(void*)0, /* driver specific interface */ |
|
|
|
|
|
|
|
|
|
(FT_Module_Constructor)tt_driver_init, |
|
|
|
|
(FT_Module_Destructor) tt_driver_done, |
|
|
|
|
(FT_Module_Requester) tt_get_interface, |
|
|
|
|
tt_driver_init, |
|
|
|
|
tt_driver_done, |
|
|
|
|
tt_get_interface, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
sizeof ( TT_FaceRec ), |
|
|
|
|
sizeof ( TT_SizeRec ), |
|
|
|
|
sizeof ( FT_GlyphSlotRec ), |
|
|
|
|
|
|
|
|
|
tt_face_init, |
|
|
|
|
tt_face_done, |
|
|
|
|
tt_size_init, |
|
|
|
|
tt_size_done, |
|
|
|
|
0, /* FT_Slot_InitFunc */ |
|
|
|
|
0, /* FT_Slot_DoneFunc */ |
|
|
|
|
|
|
|
|
|
(FT_Face_InitFunc) tt_face_init, |
|
|
|
|
(FT_Face_DoneFunc) tt_face_done, |
|
|
|
|
(FT_Size_InitFunc) tt_size_init, |
|
|
|
|
(FT_Size_DoneFunc) tt_size_done, |
|
|
|
|
(FT_Slot_InitFunc) 0, |
|
|
|
|
(FT_Slot_DoneFunc) 0, |
|
|
|
|
|
|
|
|
|
(FT_Size_ResetPointsFunc)Set_Char_Sizes, |
|
|
|
|
(FT_Size_ResetPixelsFunc)Set_Pixel_Sizes, |
|
|
|
|
(FT_Slot_LoadFunc) Load_Glyph, |
|
|
|
|
Set_Char_Sizes, |
|
|
|
|
Set_Pixel_Sizes, |
|
|
|
|
Load_Glyph, |
|
|
|
|
|
|
|
|
|
(FT_Face_GetKerningFunc) Get_Kerning, |
|
|
|
|
(FT_Face_AttachFunc) 0, |
|
|
|
|
(FT_Face_GetAdvancesFunc)0 |
|
|
|
|
Get_Kerning, |
|
|
|
|
0, /* FT_Face_AttachFunc */ |
|
|
|
|
0 /* FT_Face_GetAdvancesFunc */ |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|