[pfr] Signature fixes.
This commit is contained in:
parent
3297a7a9e0
commit
19aca9666e
|
@ -24,17 +24,18 @@
|
||||||
|
|
||||||
|
|
||||||
FT_CALLBACK_DEF( FT_Error )
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
pfr_cmap_init( PFR_CMap cmap,
|
pfr_cmap_init( FT_CMap cmap, /* PFR_CMap */
|
||||||
FT_Pointer pointer )
|
FT_Pointer pointer )
|
||||||
{
|
{
|
||||||
FT_Error error = FT_Err_Ok;
|
PFR_CMap pfrcmap = (PFR_CMap)cmap;
|
||||||
PFR_Face face = (PFR_Face)FT_CMAP_FACE( cmap );
|
FT_Error error = FT_Err_Ok;
|
||||||
|
PFR_Face face = (PFR_Face)FT_CMAP_FACE( cmap );
|
||||||
|
|
||||||
FT_UNUSED( pointer );
|
FT_UNUSED( pointer );
|
||||||
|
|
||||||
|
|
||||||
cmap->num_chars = face->phy_font.num_chars;
|
pfrcmap->num_chars = face->phy_font.num_chars;
|
||||||
cmap->chars = face->phy_font.chars;
|
pfrcmap->chars = face->phy_font.chars;
|
||||||
|
|
||||||
/* just for safety, check that the character entries are correctly */
|
/* just for safety, check that the character entries are correctly */
|
||||||
/* sorted in increasing character code order */
|
/* sorted in increasing character code order */
|
||||||
|
@ -42,9 +43,9 @@
|
||||||
FT_UInt n;
|
FT_UInt n;
|
||||||
|
|
||||||
|
|
||||||
for ( n = 1; n < cmap->num_chars; n++ )
|
for ( n = 1; n < pfrcmap->num_chars; n++ )
|
||||||
{
|
{
|
||||||
if ( cmap->chars[n - 1].char_code >= cmap->chars[n].char_code )
|
if ( pfrcmap->chars[n - 1].char_code >= pfrcmap->chars[n].char_code )
|
||||||
{
|
{
|
||||||
error = FT_THROW( Invalid_Table );
|
error = FT_THROW( Invalid_Table );
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
@ -58,26 +59,30 @@
|
||||||
|
|
||||||
|
|
||||||
FT_CALLBACK_DEF( void )
|
FT_CALLBACK_DEF( void )
|
||||||
pfr_cmap_done( PFR_CMap cmap )
|
pfr_cmap_done( FT_CMap cmap ) /* PFR_CMap */
|
||||||
{
|
{
|
||||||
cmap->chars = NULL;
|
PFR_CMap pfrcmap = (PFR_CMap)cmap;
|
||||||
cmap->num_chars = 0;
|
|
||||||
|
|
||||||
|
pfrcmap->chars = NULL;
|
||||||
|
pfrcmap->num_chars = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_CALLBACK_DEF( FT_UInt )
|
FT_CALLBACK_DEF( FT_UInt )
|
||||||
pfr_cmap_char_index( PFR_CMap cmap,
|
pfr_cmap_char_index( FT_CMap cmap, /* PFR_CMap */
|
||||||
FT_UInt32 char_code )
|
FT_UInt32 char_code )
|
||||||
{
|
{
|
||||||
FT_UInt min = 0;
|
PFR_CMap pfrcmap = (PFR_CMap)cmap;
|
||||||
FT_UInt max = cmap->num_chars;
|
FT_UInt min = 0;
|
||||||
FT_UInt mid = min + ( max - min ) / 2;
|
FT_UInt max = pfrcmap->num_chars;
|
||||||
|
FT_UInt mid = min + ( max - min ) / 2;
|
||||||
PFR_Char gchar;
|
PFR_Char gchar;
|
||||||
|
|
||||||
|
|
||||||
while ( min < max )
|
while ( min < max )
|
||||||
{
|
{
|
||||||
gchar = cmap->chars + mid;
|
gchar = pfrcmap->chars + mid;
|
||||||
|
|
||||||
if ( gchar->char_code == char_code )
|
if ( gchar->char_code == char_code )
|
||||||
return mid + 1;
|
return mid + 1;
|
||||||
|
@ -97,9 +102,10 @@
|
||||||
|
|
||||||
|
|
||||||
FT_CALLBACK_DEF( FT_UInt )
|
FT_CALLBACK_DEF( FT_UInt )
|
||||||
pfr_cmap_char_next( PFR_CMap cmap,
|
pfr_cmap_char_next( FT_CMap cmap, /* PFR_CMap */
|
||||||
FT_UInt32 *pchar_code )
|
FT_UInt32 *pchar_code )
|
||||||
{
|
{
|
||||||
|
PFR_CMap pfrcmap = (PFR_CMap)cmap;
|
||||||
FT_UInt result = 0;
|
FT_UInt result = 0;
|
||||||
FT_UInt32 char_code = *pchar_code + 1;
|
FT_UInt32 char_code = *pchar_code + 1;
|
||||||
|
|
||||||
|
@ -107,14 +113,14 @@
|
||||||
Restart:
|
Restart:
|
||||||
{
|
{
|
||||||
FT_UInt min = 0;
|
FT_UInt min = 0;
|
||||||
FT_UInt max = cmap->num_chars;
|
FT_UInt max = pfrcmap->num_chars;
|
||||||
FT_UInt mid = min + ( max - min ) / 2;
|
FT_UInt mid = min + ( max - min ) / 2;
|
||||||
PFR_Char gchar;
|
PFR_Char gchar;
|
||||||
|
|
||||||
|
|
||||||
while ( min < max )
|
while ( min < max )
|
||||||
{
|
{
|
||||||
gchar = cmap->chars + mid;
|
gchar = pfrcmap->chars + mid;
|
||||||
|
|
||||||
if ( gchar->char_code == char_code )
|
if ( gchar->char_code == char_code )
|
||||||
{
|
{
|
||||||
|
@ -143,9 +149,9 @@
|
||||||
/* we didn't find it, but we have a pair just above it */
|
/* we didn't find it, but we have a pair just above it */
|
||||||
char_code = 0;
|
char_code = 0;
|
||||||
|
|
||||||
if ( min < cmap->num_chars )
|
if ( min < pfrcmap->num_chars )
|
||||||
{
|
{
|
||||||
gchar = cmap->chars + min;
|
gchar = pfrcmap->chars + min;
|
||||||
result = min;
|
result = min;
|
||||||
if ( result != 0 )
|
if ( result != 0 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -449,15 +449,16 @@
|
||||||
|
|
||||||
/* load bitmap strikes lists */
|
/* load bitmap strikes lists */
|
||||||
FT_CALLBACK_DEF( FT_Error )
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
pfr_extra_item_load_bitmap_info( FT_Byte* p,
|
pfr_extra_item_load_bitmap_info( FT_Byte* p,
|
||||||
FT_Byte* limit,
|
FT_Byte* limit,
|
||||||
PFR_PhyFont phy_font )
|
void* phy_font_ )
|
||||||
{
|
{
|
||||||
FT_Memory memory = phy_font->memory;
|
PFR_PhyFont phy_font = (PFR_PhyFont)phy_font_;
|
||||||
PFR_Strike strike;
|
FT_Memory memory = phy_font->memory;
|
||||||
FT_UInt flags0;
|
PFR_Strike strike;
|
||||||
FT_UInt n, count, size1;
|
FT_UInt flags0;
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_UInt n, count, size1;
|
||||||
|
FT_Error error = FT_Err_Ok;
|
||||||
|
|
||||||
|
|
||||||
PFR_CHECK( 5 );
|
PFR_CHECK( 5 );
|
||||||
|
@ -549,13 +550,14 @@
|
||||||
* family.
|
* family.
|
||||||
*/
|
*/
|
||||||
FT_CALLBACK_DEF( FT_Error )
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
pfr_extra_item_load_font_id( FT_Byte* p,
|
pfr_extra_item_load_font_id( FT_Byte* p,
|
||||||
FT_Byte* limit,
|
FT_Byte* limit,
|
||||||
PFR_PhyFont phy_font )
|
void* phy_font_ )
|
||||||
{
|
{
|
||||||
FT_Error error = FT_Err_Ok;
|
PFR_PhyFont phy_font = (PFR_PhyFont)phy_font_;
|
||||||
FT_Memory memory = phy_font->memory;
|
FT_Error error = FT_Err_Ok;
|
||||||
FT_UInt len = (FT_UInt)( limit - p );
|
FT_Memory memory = phy_font->memory;
|
||||||
|
FT_UInt len = (FT_UInt)( limit - p );
|
||||||
|
|
||||||
|
|
||||||
if ( phy_font->font_id )
|
if ( phy_font->font_id )
|
||||||
|
@ -575,14 +577,15 @@
|
||||||
|
|
||||||
/* load stem snap tables */
|
/* load stem snap tables */
|
||||||
FT_CALLBACK_DEF( FT_Error )
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
pfr_extra_item_load_stem_snaps( FT_Byte* p,
|
pfr_extra_item_load_stem_snaps( FT_Byte* p,
|
||||||
FT_Byte* limit,
|
FT_Byte* limit,
|
||||||
PFR_PhyFont phy_font )
|
void* phy_font_ )
|
||||||
{
|
{
|
||||||
FT_UInt count, num_vert, num_horz;
|
PFR_PhyFont phy_font = (PFR_PhyFont)phy_font_;
|
||||||
FT_Int* snaps = NULL;
|
FT_UInt count, num_vert, num_horz;
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Int* snaps = NULL;
|
||||||
FT_Memory memory = phy_font->memory;
|
FT_Error error = FT_Err_Ok;
|
||||||
|
FT_Memory memory = phy_font->memory;
|
||||||
|
|
||||||
|
|
||||||
if ( phy_font->vertical.stem_snaps )
|
if ( phy_font->vertical.stem_snaps )
|
||||||
|
@ -619,10 +622,11 @@
|
||||||
|
|
||||||
/* load kerning pair data */
|
/* load kerning pair data */
|
||||||
FT_CALLBACK_DEF( FT_Error )
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
pfr_extra_item_load_kerning_pairs( FT_Byte* p,
|
pfr_extra_item_load_kerning_pairs( FT_Byte* p,
|
||||||
FT_Byte* limit,
|
FT_Byte* limit,
|
||||||
PFR_PhyFont phy_font )
|
void* phy_font_ )
|
||||||
{
|
{
|
||||||
|
PFR_PhyFont phy_font = (PFR_PhyFont)phy_font_;
|
||||||
PFR_KernItem item = NULL;
|
PFR_KernItem item = NULL;
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
FT_Memory memory = phy_font->memory;
|
FT_Memory memory = phy_font->memory;
|
||||||
|
@ -715,10 +719,10 @@
|
||||||
|
|
||||||
static const PFR_ExtraItemRec pfr_phy_font_extra_items[] =
|
static const PFR_ExtraItemRec pfr_phy_font_extra_items[] =
|
||||||
{
|
{
|
||||||
{ 1, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_bitmap_info },
|
{ 1, pfr_extra_item_load_bitmap_info },
|
||||||
{ 2, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_font_id },
|
{ 2, pfr_extra_item_load_font_id },
|
||||||
{ 3, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_stem_snaps },
|
{ 3, pfr_extra_item_load_stem_snaps },
|
||||||
{ 4, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_kerning_pairs },
|
{ 4, pfr_extra_item_load_kerning_pairs },
|
||||||
{ 0, NULL }
|
{ 0, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue