* src/pfr/pfrobjs.c, src/pfr/pfrobjs.h (pfr_face_init,
pfr_face_done, pfr_face_get_kerning, pfr_slot_init, pfr_slot_done, pfr_slot_load): Don't use PFR_XXX but FT_XXX arguments which are typecast to the proper PFR_XXX types within the function. Update code accordingly. * src/pfr/pfrdrivr.c (pfr_get_kerning, pfr_get_advance, pfr_get_metrics, pfr_get_service): Don't use PFR_XXX but FT_XXX arguments which are typecast to the proper PFR_XXX types within the function. Update code accordingly. Use FT_CALLBACK_DEF throughout. (pfr_metrics_service_rec, pfr_driver_class): Remove casts.
This commit is contained in:
parent
17f4b8b6f0
commit
b78c554d65
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
||||||
|
2004-05-07 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
* src/pfr/pfrobjs.c, src/pfr/pfrobjs.h (pfr_face_init,
|
||||||
|
pfr_face_done, pfr_face_get_kerning, pfr_slot_init, pfr_slot_done,
|
||||||
|
pfr_slot_load): Don't use PFR_XXX but FT_XXX arguments which are
|
||||||
|
typecast to the proper PFR_XXX types within the function.
|
||||||
|
Update code accordingly.
|
||||||
|
|
||||||
|
* src/pfr/pfrdrivr.c (pfr_get_kerning, pfr_get_advance,
|
||||||
|
pfr_get_metrics, pfr_get_service): Don't use PFR_XXX but FT_XXX
|
||||||
|
arguments which are typecast to the proper PFR_XXX types within the
|
||||||
|
function.
|
||||||
|
Update code accordingly.
|
||||||
|
Use FT_CALLBACK_DEF throughout.
|
||||||
|
(pfr_metrics_service_rec, pfr_driver_class): Remove casts.
|
||||||
|
|
||||||
2004-05-06 Masatake YAMATO <jet@gyve.org>
|
2004-05-06 Masatake YAMATO <jet@gyve.org>
|
||||||
|
|
||||||
* src/truetype/ttgxvar.c (ft_var_load_gvar): Use FT_FACE_STREAM.
|
* src/truetype/ttgxvar.c (ft_var_load_gvar): Use FT_FACE_STREAM.
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/* */
|
/* */
|
||||||
/* FreeType PFR driver interface (body). */
|
/* FreeType PFR driver interface (body). */
|
||||||
/* */
|
/* */
|
||||||
/* Copyright 2002, 2003 by */
|
/* Copyright 2002, 2003, 2004 by */
|
||||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of the FreeType project, and may only be used, */
|
/* This file is part of the FreeType project, and may only be used, */
|
||||||
|
@ -27,16 +27,17 @@
|
||||||
#include "pfrerror.h"
|
#include "pfrerror.h"
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
pfr_get_kerning( PFR_Face face,
|
pfr_get_kerning( FT_Face pfrface, /* PFR_Face */
|
||||||
FT_UInt left,
|
FT_UInt left,
|
||||||
FT_UInt right,
|
FT_UInt right,
|
||||||
FT_Vector *avector )
|
FT_Vector *avector )
|
||||||
{
|
{
|
||||||
|
PFR_Face face = (PFR_Face)pfrface;
|
||||||
PFR_PhyFont phys = &face->phy_font;
|
PFR_PhyFont phys = &face->phy_font;
|
||||||
|
|
||||||
|
|
||||||
pfr_face_get_kerning( face, left, right, avector );
|
pfr_face_get_kerning( pfrface, left, right, avector );
|
||||||
|
|
||||||
/* convert from metrics to outline units when necessary */
|
/* convert from metrics to outline units when necessary */
|
||||||
if ( phys->outline_resolution != phys->metrics_resolution )
|
if ( phys->outline_resolution != phys->metrics_resolution )
|
||||||
|
@ -59,11 +60,12 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
pfr_get_advance( PFR_Face face,
|
pfr_get_advance( FT_Face pfrface, /* PFR_Face */
|
||||||
FT_UInt gindex,
|
FT_UInt gindex,
|
||||||
FT_Pos *anadvance )
|
FT_Pos *anadvance )
|
||||||
{
|
{
|
||||||
|
PFR_Face face = (PFR_Face)pfrface;
|
||||||
FT_Error error = PFR_Err_Bad_Argument;
|
FT_Error error = PFR_Err_Bad_Argument;
|
||||||
|
|
||||||
|
|
||||||
|
@ -84,13 +86,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
pfr_get_metrics( PFR_Face face,
|
pfr_get_metrics( FT_Face pfrface, /* PFR_Face */
|
||||||
FT_UInt *anoutline_resolution,
|
FT_UInt *anoutline_resolution,
|
||||||
FT_UInt *ametrics_resolution,
|
FT_UInt *ametrics_resolution,
|
||||||
FT_Fixed *ametrics_x_scale,
|
FT_Fixed *ametrics_x_scale,
|
||||||
FT_Fixed *ametrics_y_scale )
|
FT_Fixed *ametrics_y_scale )
|
||||||
{
|
{
|
||||||
|
PFR_Face face = (PFR_Face)pfrface;
|
||||||
PFR_PhyFont phys = &face->phy_font;
|
PFR_PhyFont phys = &face->phy_font;
|
||||||
FT_Fixed x_scale, y_scale;
|
FT_Fixed x_scale, y_scale;
|
||||||
FT_Size size = face->root.size;
|
FT_Size size = face->root.size;
|
||||||
|
@ -127,9 +130,9 @@
|
||||||
FT_CALLBACK_TABLE_DEF
|
FT_CALLBACK_TABLE_DEF
|
||||||
const FT_Service_PfrMetricsRec pfr_metrics_service_rec =
|
const FT_Service_PfrMetricsRec pfr_metrics_service_rec =
|
||||||
{
|
{
|
||||||
(FT_PFR_GetMetricsFunc)pfr_get_metrics,
|
pfr_get_metrics,
|
||||||
(FT_PFR_GetKerningFunc)pfr_face_get_kerning,
|
pfr_face_get_kerning,
|
||||||
(FT_PFR_GetAdvanceFunc)pfr_get_advance
|
pfr_get_advance
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -146,11 +149,11 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static FT_Module_Interface
|
FT_CALLBACK_DEF( FT_Module_Interface )
|
||||||
pfr_get_service( FT_Driver driver,
|
pfr_get_service( FT_Module module,
|
||||||
const FT_String* service_id )
|
const FT_String* service_id )
|
||||||
{
|
{
|
||||||
FT_UNUSED( driver );
|
FT_UNUSED( module );
|
||||||
|
|
||||||
return ft_service_list_lookup( pfr_services, service_id );
|
return ft_service_list_lookup( pfr_services, service_id );
|
||||||
}
|
}
|
||||||
|
@ -171,29 +174,29 @@
|
||||||
|
|
||||||
NULL,
|
NULL,
|
||||||
|
|
||||||
(FT_Module_Constructor)NULL,
|
0,
|
||||||
(FT_Module_Destructor) NULL,
|
0,
|
||||||
(FT_Module_Requester) pfr_get_service
|
pfr_get_service
|
||||||
},
|
},
|
||||||
|
|
||||||
sizeof( PFR_FaceRec ),
|
sizeof( PFR_FaceRec ),
|
||||||
sizeof( PFR_SizeRec ),
|
sizeof( PFR_SizeRec ),
|
||||||
sizeof( PFR_SlotRec ),
|
sizeof( PFR_SlotRec ),
|
||||||
|
|
||||||
(FT_Face_InitFunc) pfr_face_init,
|
pfr_face_init,
|
||||||
(FT_Face_DoneFunc) pfr_face_done,
|
pfr_face_done,
|
||||||
(FT_Size_InitFunc) NULL,
|
0, /* FT_Size_InitFunc */
|
||||||
(FT_Size_DoneFunc) NULL,
|
0, /* FT_Size_DoneFunc */
|
||||||
(FT_Slot_InitFunc) pfr_slot_init,
|
pfr_slot_init,
|
||||||
(FT_Slot_DoneFunc) pfr_slot_done,
|
pfr_slot_done,
|
||||||
|
|
||||||
(FT_Size_ResetPointsFunc)NULL,
|
0, /* FT_Size_ResetPointsFunc */
|
||||||
(FT_Size_ResetPixelsFunc)NULL,
|
0, /* FT_Size_ResetPixelsFunc */
|
||||||
(FT_Slot_LoadFunc) pfr_slot_load,
|
pfr_slot_load,
|
||||||
|
|
||||||
(FT_Face_GetKerningFunc) pfr_get_kerning,
|
pfr_get_kerning,
|
||||||
(FT_Face_AttachFunc) 0,
|
0, /* FT_Face_AttachFunc */
|
||||||
(FT_Face_GetAdvancesFunc)0
|
0 /* FT_Face_GetAdvancesFunc */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/* */
|
/* */
|
||||||
/* FreeType PFR object methods (body). */
|
/* FreeType PFR object methods (body). */
|
||||||
/* */
|
/* */
|
||||||
/* Copyright 2002, 2003 by */
|
/* Copyright 2002, 2003, 2004 by */
|
||||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of the FreeType project, and may only be used, */
|
/* This file is part of the FreeType project, and may only be used, */
|
||||||
|
@ -39,30 +39,32 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
FT_LOCAL_DEF( void )
|
FT_LOCAL_DEF( void )
|
||||||
pfr_face_done( PFR_Face face )
|
pfr_face_done( FT_Face pfrface ) /* PFR_Face */
|
||||||
{
|
{
|
||||||
FT_Memory memory = face->root.driver->root.memory;
|
PFR_Face face = (PFR_Face)pfrface;
|
||||||
|
FT_Memory memory = pfrface->driver->root.memory;
|
||||||
|
|
||||||
|
|
||||||
/* we don't want dangling pointers */
|
/* we don't want dangling pointers */
|
||||||
face->root.family_name = NULL;
|
pfrface->family_name = NULL;
|
||||||
face->root.style_name = NULL;
|
pfrface->style_name = NULL;
|
||||||
|
|
||||||
/* finalize the physical font record */
|
/* finalize the physical font record */
|
||||||
pfr_phy_font_done( &face->phy_font, FT_FACE_MEMORY( face ) );
|
pfr_phy_font_done( &face->phy_font, FT_FACE_MEMORY( face ) );
|
||||||
|
|
||||||
/* no need to finalize the logical font or the header */
|
/* no need to finalize the logical font or the header */
|
||||||
FT_FREE( face->root.available_sizes );
|
FT_FREE( pfrface->available_sizes );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( FT_Error )
|
FT_LOCAL_DEF( FT_Error )
|
||||||
pfr_face_init( FT_Stream stream,
|
pfr_face_init( FT_Stream stream,
|
||||||
PFR_Face face,
|
FT_Face pfrface,
|
||||||
FT_Int face_index,
|
FT_Int face_index,
|
||||||
FT_Int num_params,
|
FT_Int num_params,
|
||||||
FT_Parameter* params )
|
FT_Parameter* params )
|
||||||
{
|
{
|
||||||
|
PFR_Face face = (PFR_Face)pfrface;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
|
||||||
FT_UNUSED( num_params );
|
FT_UNUSED( num_params );
|
||||||
|
@ -92,13 +94,13 @@
|
||||||
if ( error )
|
if ( error )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
face->root.num_faces = num_faces;
|
pfrface->num_faces = num_faces;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( face_index < 0 )
|
if ( face_index < 0 )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
if ( face_index >= face->root.num_faces )
|
if ( face_index >= pfrface->num_faces )
|
||||||
{
|
{
|
||||||
FT_ERROR(( "pfr_face_init: invalid face index\n" ));
|
FT_ERROR(( "pfr_face_init: invalid face index\n" ));
|
||||||
error = PFR_Err_Invalid_Argument;
|
error = PFR_Err_Invalid_Argument;
|
||||||
|
@ -122,75 +124,74 @@
|
||||||
|
|
||||||
/* now, set-up all root face fields */
|
/* now, set-up all root face fields */
|
||||||
{
|
{
|
||||||
FT_Face root = FT_FACE( face );
|
|
||||||
PFR_PhyFont phy_font = &face->phy_font;
|
PFR_PhyFont phy_font = &face->phy_font;
|
||||||
|
|
||||||
|
|
||||||
root->face_index = face_index;
|
pfrface->face_index = face_index;
|
||||||
root->num_glyphs = phy_font->num_chars;
|
pfrface->num_glyphs = phy_font->num_chars;
|
||||||
root->face_flags = FT_FACE_FLAG_SCALABLE;
|
pfrface->face_flags = FT_FACE_FLAG_SCALABLE;
|
||||||
|
|
||||||
if ( (phy_font->flags & PFR_PHY_PROPORTIONAL) == 0 )
|
if ( (phy_font->flags & PFR_PHY_PROPORTIONAL) == 0 )
|
||||||
root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
|
pfrface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
|
||||||
|
|
||||||
if ( phy_font->flags & PFR_PHY_VERTICAL )
|
if ( phy_font->flags & PFR_PHY_VERTICAL )
|
||||||
root->face_flags |= FT_FACE_FLAG_VERTICAL;
|
pfrface->face_flags |= FT_FACE_FLAG_VERTICAL;
|
||||||
else
|
else
|
||||||
root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
|
pfrface->face_flags |= FT_FACE_FLAG_HORIZONTAL;
|
||||||
|
|
||||||
if ( phy_font->num_strikes > 0 )
|
if ( phy_font->num_strikes > 0 )
|
||||||
root->face_flags |= FT_FACE_FLAG_FIXED_SIZES;
|
pfrface->face_flags |= FT_FACE_FLAG_FIXED_SIZES;
|
||||||
|
|
||||||
if ( phy_font->num_kern_pairs > 0 )
|
if ( phy_font->num_kern_pairs > 0 )
|
||||||
root->face_flags |= FT_FACE_FLAG_KERNING;
|
pfrface->face_flags |= FT_FACE_FLAG_KERNING;
|
||||||
|
|
||||||
/* If no family name was found in the "undocumented" auxiliary
|
/* If no family name was found in the "undocumented" auxiliary
|
||||||
* data, use the font ID instead. This sucks but is better than
|
* data, use the font ID instead. This sucks but is better than
|
||||||
* nothing.
|
* nothing.
|
||||||
*/
|
*/
|
||||||
root->family_name = phy_font->family_name;
|
pfrface->family_name = phy_font->family_name;
|
||||||
if ( root->family_name == NULL )
|
if ( pfrface->family_name == NULL )
|
||||||
root->family_name = phy_font->font_id;
|
pfrface->family_name = phy_font->font_id;
|
||||||
|
|
||||||
/* note that the style name can be NULL in certain PFR fonts,
|
/* note that the style name can be NULL in certain PFR fonts,
|
||||||
* probably meaning "Regular"
|
* probably meaning "Regular"
|
||||||
*/
|
*/
|
||||||
root->style_name = phy_font->style_name;
|
pfrface->style_name = phy_font->style_name;
|
||||||
|
|
||||||
root->num_fixed_sizes = 0;
|
pfrface->num_fixed_sizes = 0;
|
||||||
root->available_sizes = 0;
|
pfrface->available_sizes = 0;
|
||||||
|
|
||||||
root->bbox = phy_font->bbox;
|
pfrface->bbox = phy_font->bbox;
|
||||||
root->units_per_EM = (FT_UShort)phy_font->outline_resolution;
|
pfrface->units_per_EM = (FT_UShort)phy_font->outline_resolution;
|
||||||
root->ascender = (FT_Short) phy_font->bbox.yMax;
|
pfrface->ascender = (FT_Short) phy_font->bbox.yMax;
|
||||||
root->descender = (FT_Short) phy_font->bbox.yMin;
|
pfrface->descender = (FT_Short) phy_font->bbox.yMin;
|
||||||
root->height = (FT_Short)(
|
pfrface->height = (FT_Short)(
|
||||||
( ( root->ascender - root->descender ) * 12 ) / 10 );
|
( ( pfrface->ascender - pfrface->descender ) * 12 ) / 10 );
|
||||||
|
|
||||||
if ( phy_font->num_strikes > 0 )
|
if ( phy_font->num_strikes > 0 )
|
||||||
{
|
{
|
||||||
FT_UInt n, count = phy_font->num_strikes;
|
FT_UInt n, count = phy_font->num_strikes;
|
||||||
FT_Bitmap_Size* size;
|
FT_Bitmap_Size* size;
|
||||||
PFR_Strike strike;
|
PFR_Strike strike;
|
||||||
FT_Memory memory = root->stream->memory;
|
FT_Memory memory = pfrface->stream->memory;
|
||||||
|
|
||||||
|
|
||||||
if ( FT_NEW_ARRAY( root->available_sizes, count ) )
|
if ( FT_NEW_ARRAY( pfrface->available_sizes, count ) )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
size = root->available_sizes;
|
size = pfrface->available_sizes;
|
||||||
strike = phy_font->strikes;
|
strike = phy_font->strikes;
|
||||||
for ( n = 0; n < count; n++, size++, strike++ )
|
for ( n = 0; n < count; n++, size++, strike++ )
|
||||||
{
|
{
|
||||||
size->height = (FT_UShort)strike->y_ppm;
|
size->height = (FT_UShort)strike->y_ppm;
|
||||||
size->width = (FT_UShort)strike->x_ppm;
|
size->width = (FT_UShort)strike->x_ppm;
|
||||||
}
|
}
|
||||||
root->num_fixed_sizes = count;
|
pfrface->num_fixed_sizes = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now compute maximum advance width */
|
/* now compute maximum advance width */
|
||||||
if ( ( phy_font->flags & PFR_PHY_PROPORTIONAL ) == 0 )
|
if ( ( phy_font->flags & PFR_PHY_PROPORTIONAL ) == 0 )
|
||||||
root->max_advance_width = (FT_Short)phy_font->standard_advance;
|
pfrface->max_advance_width = (FT_Short)phy_font->standard_advance;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FT_Int max = 0;
|
FT_Int max = 0;
|
||||||
|
@ -204,20 +205,20 @@
|
||||||
max = gchar->advance;
|
max = gchar->advance;
|
||||||
}
|
}
|
||||||
|
|
||||||
root->max_advance_width = (FT_Short)max;
|
pfrface->max_advance_width = (FT_Short)max;
|
||||||
}
|
}
|
||||||
|
|
||||||
root->max_advance_height = root->height;
|
pfrface->max_advance_height = pfrface->height;
|
||||||
|
|
||||||
root->underline_position = (FT_Short)( - root->units_per_EM / 10 );
|
pfrface->underline_position = (FT_Short)( -pfrface->units_per_EM / 10 );
|
||||||
root->underline_thickness = (FT_Short)( root->units_per_EM / 30 );
|
pfrface->underline_thickness = (FT_Short)( pfrface->units_per_EM / 30 );
|
||||||
|
|
||||||
/* create charmap */
|
/* create charmap */
|
||||||
{
|
{
|
||||||
FT_CharMapRec charmap;
|
FT_CharMapRec charmap;
|
||||||
|
|
||||||
|
|
||||||
charmap.face = root;
|
charmap.face = pfrface;
|
||||||
charmap.platform_id = 3;
|
charmap.platform_id = 3;
|
||||||
charmap.encoding_id = 1;
|
charmap.encoding_id = 1;
|
||||||
charmap.encoding = FT_ENCODING_UNICODE;
|
charmap.encoding = FT_ENCODING_UNICODE;
|
||||||
|
@ -226,14 +227,14 @@
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* Select default charmap */
|
/* Select default charmap */
|
||||||
if (root->num_charmaps)
|
if ( pfrface->num_charmaps )
|
||||||
root->charmap = root->charmaps[0];
|
pfrface->charmap = pfrface->charmaps[0];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check whether we've loaded any kerning pairs */
|
/* check whether we've loaded any kerning pairs */
|
||||||
if ( phy_font->num_kern_pairs )
|
if ( phy_font->num_kern_pairs )
|
||||||
root->face_flags |= FT_FACE_FLAG_KERNING;
|
pfrface->face_flags |= FT_FACE_FLAG_KERNING;
|
||||||
}
|
}
|
||||||
|
|
||||||
Exit:
|
Exit:
|
||||||
|
@ -250,9 +251,11 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
FT_LOCAL_DEF( FT_Error )
|
FT_LOCAL_DEF( FT_Error )
|
||||||
pfr_slot_init( PFR_Slot slot )
|
pfr_slot_init( FT_GlyphSlot pfrslot ) /* PFR_Slot */
|
||||||
{
|
{
|
||||||
FT_GlyphLoader loader = slot->root.internal->loader;
|
PFR_Slot slot = (PFR_Slot)pfrslot;
|
||||||
|
FT_GlyphLoader loader = pfrslot->internal->loader;
|
||||||
|
|
||||||
|
|
||||||
pfr_glyph_init( &slot->glyph, loader );
|
pfr_glyph_init( &slot->glyph, loader );
|
||||||
|
|
||||||
|
@ -261,22 +264,27 @@
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( void )
|
FT_LOCAL_DEF( void )
|
||||||
pfr_slot_done( PFR_Slot slot )
|
pfr_slot_done( FT_GlyphSlot pfrslot ) /* PFR_Slot */
|
||||||
{
|
{
|
||||||
|
PFR_Slot slot = (PFR_Slot)pfrslot;
|
||||||
|
|
||||||
|
|
||||||
pfr_glyph_done( &slot->glyph );
|
pfr_glyph_done( &slot->glyph );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( FT_Error )
|
FT_LOCAL_DEF( FT_Error )
|
||||||
pfr_slot_load( PFR_Slot slot,
|
pfr_slot_load( FT_GlyphSlot pfrslot, /* PFR_Slot */
|
||||||
PFR_Size size,
|
FT_Size pfrsize, /* PFR_Size */
|
||||||
FT_UInt gindex,
|
FT_UInt gindex,
|
||||||
FT_Int32 load_flags )
|
FT_Int32 load_flags )
|
||||||
{
|
{
|
||||||
|
PFR_Slot slot = (PFR_Slot)pfrslot;
|
||||||
|
PFR_Size size = (PFR_Size)pfrsize;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
PFR_Face face = (PFR_Face)slot->root.face;
|
PFR_Face face = (PFR_Face)pfrslot->face;
|
||||||
PFR_Char gchar;
|
PFR_Char gchar;
|
||||||
FT_Outline* outline = &slot->root.outline;
|
FT_Outline* outline = &pfrslot->outline;
|
||||||
FT_ULong gps_offset;
|
FT_ULong gps_offset;
|
||||||
|
|
||||||
|
|
||||||
|
@ -301,7 +309,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
gchar = face->phy_font.chars + gindex;
|
gchar = face->phy_font.chars + gindex;
|
||||||
slot->root.format = FT_GLYPH_FORMAT_OUTLINE;
|
pfrslot->format = FT_GLYPH_FORMAT_OUTLINE;
|
||||||
outline->n_points = 0;
|
outline->n_points = 0;
|
||||||
outline->n_contours = 0;
|
outline->n_contours = 0;
|
||||||
gps_offset = face->header.gps_section_offset;
|
gps_offset = face->header.gps_section_offset;
|
||||||
|
@ -313,7 +321,7 @@
|
||||||
if ( !error )
|
if ( !error )
|
||||||
{
|
{
|
||||||
FT_BBox cbox;
|
FT_BBox cbox;
|
||||||
FT_Glyph_Metrics* metrics = &slot->root.metrics;
|
FT_Glyph_Metrics* metrics = &pfrslot->metrics;
|
||||||
FT_Pos advance;
|
FT_Pos advance;
|
||||||
FT_Int em_metrics, em_outline;
|
FT_Int em_metrics, em_outline;
|
||||||
FT_Bool scaling;
|
FT_Bool scaling;
|
||||||
|
@ -327,7 +335,7 @@
|
||||||
outline->flags &= ~FT_OUTLINE_OWNER;
|
outline->flags &= ~FT_OUTLINE_OWNER;
|
||||||
outline->flags |= FT_OUTLINE_REVERSE_FILL;
|
outline->flags |= FT_OUTLINE_REVERSE_FILL;
|
||||||
|
|
||||||
if ( size && size->root.metrics.y_ppem < 24 )
|
if ( size && pfrsize->metrics.y_ppem < 24 )
|
||||||
outline->flags |= FT_OUTLINE_HIGH_PRECISION;
|
outline->flags |= FT_OUTLINE_HIGH_PRECISION;
|
||||||
|
|
||||||
/* compute the advance vector */
|
/* compute the advance vector */
|
||||||
|
@ -346,8 +354,8 @@
|
||||||
else
|
else
|
||||||
metrics->horiAdvance = advance;
|
metrics->horiAdvance = advance;
|
||||||
|
|
||||||
slot->root.linearHoriAdvance = metrics->horiAdvance;
|
pfrslot->linearHoriAdvance = metrics->horiAdvance;
|
||||||
slot->root.linearVertAdvance = metrics->vertAdvance;
|
pfrslot->linearVertAdvance = metrics->vertAdvance;
|
||||||
|
|
||||||
/* make-up vertical metrics(?) */
|
/* make-up vertical metrics(?) */
|
||||||
metrics->vertBearingX = 0;
|
metrics->vertBearingX = 0;
|
||||||
|
@ -372,8 +380,8 @@
|
||||||
if ( scaling )
|
if ( scaling )
|
||||||
{
|
{
|
||||||
FT_Int n;
|
FT_Int n;
|
||||||
FT_Fixed x_scale = size->root.metrics.x_scale;
|
FT_Fixed x_scale = pfrsize->metrics.x_scale;
|
||||||
FT_Fixed y_scale = size->root.metrics.y_scale;
|
FT_Fixed y_scale = pfrsize->metrics.y_scale;
|
||||||
FT_Vector* vec = outline->points;
|
FT_Vector* vec = outline->points;
|
||||||
|
|
||||||
|
|
||||||
|
@ -411,20 +419,19 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
FT_LOCAL_DEF( void )
|
FT_LOCAL_DEF( FT_Error )
|
||||||
pfr_face_get_kerning( PFR_Face face,
|
pfr_face_get_kerning( FT_Face pfrface, /* PFR_Face */
|
||||||
FT_UInt glyph1,
|
FT_UInt glyph1,
|
||||||
FT_UInt glyph2,
|
FT_UInt glyph2,
|
||||||
FT_Vector* kerning )
|
FT_Vector* kerning )
|
||||||
{
|
{
|
||||||
|
PFR_Face face = (PFR_Face)pfrface;
|
||||||
FT_Error error = PFR_Err_Ok;
|
FT_Error error = PFR_Err_Ok;
|
||||||
PFR_PhyFont phy_font = &face->phy_font;
|
PFR_PhyFont phy_font = &face->phy_font;
|
||||||
PFR_KernPair pairs = phy_font->kern_pairs;
|
PFR_KernPair pairs = phy_font->kern_pairs;
|
||||||
FT_UInt32 idx = PFR_KERN_INDEX( glyph1, glyph2 );
|
FT_UInt32 idx = PFR_KERN_INDEX( glyph1, glyph2 );
|
||||||
FT_UInt min, max;
|
FT_UInt min, max;
|
||||||
|
|
||||||
FT_UNUSED( error ); /* just needed as syntactical sugar */
|
|
||||||
|
|
||||||
|
|
||||||
kerning->x = 0;
|
kerning->x = 0;
|
||||||
kerning->y = 0;
|
kerning->y = 0;
|
||||||
|
@ -450,6 +457,8 @@
|
||||||
else
|
else
|
||||||
max = mid;
|
max = mid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/* */
|
/* */
|
||||||
/* FreeType PFR object methods (specification). */
|
/* FreeType PFR object methods (specification). */
|
||||||
/* */
|
/* */
|
||||||
/* Copyright 2002, 2003 by */
|
/* Copyright 2002, 2003, 2004 by */
|
||||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of the FreeType project, and may only be used, */
|
/* This file is part of the FreeType project, and may only be used, */
|
||||||
|
@ -58,34 +58,34 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
FT_LOCAL( FT_Error )
|
FT_LOCAL( FT_Error )
|
||||||
pfr_face_init( FT_Stream stream,
|
pfr_face_init( FT_Stream stream,
|
||||||
PFR_Face face,
|
FT_Face face, /* PFR_Face */
|
||||||
FT_Int face_index,
|
FT_Int face_index,
|
||||||
FT_Int num_params,
|
FT_Int num_params,
|
||||||
FT_Parameter* params );
|
FT_Parameter* params );
|
||||||
|
|
||||||
FT_LOCAL( void )
|
FT_LOCAL( void )
|
||||||
pfr_face_done( PFR_Face face );
|
pfr_face_done( FT_Face face ); /* PFR_Face */
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL( void )
|
FT_LOCAL( FT_Error )
|
||||||
pfr_face_get_kerning( PFR_Face face,
|
pfr_face_get_kerning( FT_Face face, /* PFR_Face */
|
||||||
FT_UInt glyph1,
|
FT_UInt glyph1,
|
||||||
FT_UInt glyph2,
|
FT_UInt glyph2,
|
||||||
FT_Vector* kerning );
|
FT_Vector* kerning );
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL( FT_Error )
|
FT_LOCAL( FT_Error )
|
||||||
pfr_slot_init( PFR_Slot slot );
|
pfr_slot_init( FT_GlyphSlot slot ); /* PFR_Slot */
|
||||||
|
|
||||||
FT_LOCAL( void )
|
FT_LOCAL( void )
|
||||||
pfr_slot_done( PFR_Slot slot );
|
pfr_slot_done( FT_GlyphSlot slot ); /* PFR_Slot */
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL( FT_Error )
|
FT_LOCAL( FT_Error )
|
||||||
pfr_slot_load( PFR_Slot slot,
|
pfr_slot_load( FT_GlyphSlot slot, /* PFR_Slot */
|
||||||
PFR_Size size,
|
FT_Size size, /* PFR_Size */
|
||||||
FT_UInt gindex,
|
FT_UInt gindex,
|
||||||
FT_Int32 load_flags );
|
FT_Int32 load_flags );
|
||||||
|
|
||||||
|
|
||||||
FT_END_HEADER
|
FT_END_HEADER
|
||||||
|
|
Loading…
Reference in New Issue