@ -75,36 +75,36 @@ THE SOFTWARE.
FT_CALLBACK_DEF ( FT_Error )
pcf_cmap_init ( FT_CMap pcf cmap, /* PCF_CMap */
pcf_cmap_init ( FT_CMap cmap , /* PCF_CMap */
FT_Pointer init_data )
{
PCF_CMap cmap = ( PCF_CMap ) pcf cmap;
PCF_Face face = ( PCF_Face ) FT_CMAP_FACE ( pcf cmap ) ;
PCF_CMap pcf cmap = ( PCF_CMap ) cmap ;
PCF_Face face = ( PCF_Face ) FT_CMAP_FACE ( cmap ) ;
FT_UNUSED ( init_data ) ;
cmap - > enc = & face - > enc ;
pcf cmap- > enc = & face - > enc ;
return FT_Err_Ok ;
}
FT_CALLBACK_DEF ( void )
pcf_cmap_done ( FT_CMap pcf cmap ) /* PCF_CMap */
pcf_cmap_done ( FT_CMap cmap ) /* PCF_CMap */
{
PCF_CMap cmap = ( PCF_CMap ) pcf cmap;
PCF_CMap pcf cmap = ( PCF_CMap ) cmap ;
cmap - > enc = NULL ;
pcf cmap- > enc = NULL ;
}
FT_CALLBACK_DEF ( FT_UInt )
pcf_cmap_char_index ( FT_CMap pcf cmap, /* PCF_CMap */
pcf_cmap_char_index ( FT_CMap cmap , /* PCF_CMap */
FT_UInt32 charcode )
{
PCF_Enc enc = ( ( PCF_CMap ) pcf cmap ) - > enc ;
PCF_Enc enc = ( ( PCF_CMap ) cmap ) - > enc ;
FT_UInt32 i = ( charcode > > 8 ) - enc - > firstRow ;
FT_UInt32 j = ( charcode & 0xFF ) - enc - > firstCol ;
@ -121,10 +121,10 @@ THE SOFTWARE.
FT_CALLBACK_DEF ( FT_UInt )
pcf_cmap_char_next ( FT_CMap pcf cmap, /* PCF_CMap */
pcf_cmap_char_next ( FT_CMap cmap , /* PCF_CMap */
FT_UInt32 * acharcode )
{
PCF_Enc enc = ( ( PCF_CMap ) pcf cmap ) - > enc ;
PCF_Enc enc = ( ( PCF_CMap ) cmap ) - > enc ;
FT_UInt32 charcode = * acharcode + 1 ;
FT_UInt32 i = ( charcode > > 8 ) - enc - > firstRow ;
@ -170,9 +170,9 @@ THE SOFTWARE.
FT_CALLBACK_DEF ( void )
PCF_Face_Done ( FT_Face pcf face ) /* PCF_Face */
PCF_Face_Done ( FT_Face face ) /* PCF_Face */
{
PCF_Face face = ( PCF_Face ) pcf face;
PCF_Face pcf face = ( PCF_Face ) face ;
FT_Memory memory ;
@ -181,18 +181,18 @@ THE SOFTWARE.
memory = FT_FACE_MEMORY ( face ) ;
FT_FREE ( face - > metrics ) ;
FT_FREE ( face - > enc . offset ) ;
FT_FREE ( pcf face- > metrics ) ;
FT_FREE ( pcf face- > enc . offset ) ;
/* free properties */
if ( face - > properties )
if ( pcf face- > properties )
{
FT_Int i ;
for ( i = 0 ; i < face - > nprops ; i + + )
for ( i = 0 ; i < pcf face- > nprops ; i + + )
{
PCF_Property prop = & face - > properties [ i ] ;
PCF_Property prop = & pcf face- > properties [ i ] ;
if ( prop )
@ -203,33 +203,33 @@ THE SOFTWARE.
}
}
FT_FREE ( face - > properties ) ;
FT_FREE ( pcf face- > properties ) ;
}
FT_FREE ( face - > toc . tables ) ;
FT_FREE ( pcf face- > family_name ) ;
FT_FREE ( pcf face- > style_name ) ;
FT_FREE ( pcf face- > available_sizes ) ;
FT_FREE ( face - > charset_encoding ) ;
FT_FREE ( face - > charset_registry ) ;
FT_FREE ( pcf face- > toc . tables ) ;
FT_FREE ( face - > family_name ) ;
FT_FREE ( face - > style_name ) ;
FT_FREE ( face - > available_sizes ) ;
FT_FREE ( pcf face- > charset_encoding ) ;
FT_FREE ( pcf face- > charset_registry ) ;
/* close compressed stream if any */
if ( pcf face- > stream = = & face - > comp_stream )
if ( face - > stream = = & pcf face- > comp_stream )
{
FT_Stream_Close ( & face - > comp_stream ) ;
pcf face- > stream = face - > comp_source ;
FT_Stream_Close ( & pcf face- > comp_stream ) ;
face - > stream = pcf face- > comp_source ;
}
}
FT_CALLBACK_DEF ( FT_Error )
PCF_Face_Init ( FT_Stream stream ,
FT_Face pcf face, /* PCF_Face */
FT_Face face , /* PCF_Face */
FT_Int face_index ,
FT_Int num_params ,
FT_Parameter * params )
{
PCF_Face face = ( PCF_Face ) pcf face;
PCF_Face pcf face = ( PCF_Face ) face ;
FT_Error error ;
FT_UNUSED ( num_params ) ;
@ -238,10 +238,10 @@ THE SOFTWARE.
FT_TRACE2 ( ( " PCF driver \n " ) ) ;
error = pcf_load_font ( stream , face , face_index ) ;
error = pcf_load_font ( stream , pcf face, face_index ) ;
if ( error )
{
PCF_Face_Done ( pcf face ) ;
PCF_Face_Done ( face ) ;
# if defined( FT_CONFIG_OPTION_USE_ZLIB ) || \
defined ( FT_CONFIG_OPTION_USE_LZW ) | | \
@ -254,7 +254,7 @@ THE SOFTWARE.
/* this didn't work, try gzip support! */
FT_TRACE2 ( ( " ... try gzip stream \n " ) ) ;
error2 = FT_Stream_OpenGzip ( & face - > comp_stream , stream ) ;
error2 = FT_Stream_OpenGzip ( & pcf face- > comp_stream , stream ) ;
if ( FT_ERR_EQ ( error2 , Unimplemented_Feature ) )
goto Fail ;
@ -270,7 +270,7 @@ THE SOFTWARE.
/* this didn't work, try LZW support! */
FT_TRACE2 ( ( " ... try LZW stream \n " ) ) ;
error3 = FT_Stream_OpenLZW ( & face - > comp_stream , stream ) ;
error3 = FT_Stream_OpenLZW ( & pcf face- > comp_stream , stream ) ;
if ( FT_ERR_EQ ( error3 , Unimplemented_Feature ) )
goto Fail ;
@ -286,7 +286,7 @@ THE SOFTWARE.
/* this didn't work, try Bzip2 support! */
FT_TRACE2 ( ( " ... try Bzip2 stream \n " ) ) ;
error4 = FT_Stream_OpenBzip2 ( & face - > comp_stream , stream ) ;
error4 = FT_Stream_OpenBzip2 ( & pcf face- > comp_stream , stream ) ;
if ( FT_ERR_EQ ( error4 , Unimplemented_Feature ) )
goto Fail ;
@ -297,12 +297,12 @@ THE SOFTWARE.
if ( error )
goto Fail ;
face - > comp_source = stream ;
pcf face- > stream = & face - > comp_stream ;
pcf face- > comp_source = stream ;
face - > stream = & pcf face- > comp_stream ;
stream = pcf face- > stream ;
stream = face - > stream ;
error = pcf_load_font ( stream , face , face_index ) ;
error = pcf_load_font ( stream , pcf face, face_index ) ;
if ( error )
goto Fail ;
@ -326,14 +326,14 @@ THE SOFTWARE.
else if ( face_index > 0 & & ( face_index & 0xFFFF ) > 0 )
{
FT_ERROR ( ( " PCF_Face_Init: invalid face index \n " ) ) ;
PCF_Face_Done ( pcf face ) ;
PCF_Face_Done ( face ) ;
return FT_THROW ( Invalid_Argument ) ;
}
/* set up charmap */
{
FT_String * charset_registry = face - > charset_registry ;
FT_String * charset_encoding = face - > charset_encoding ;
FT_String * charset_registry = pcf face- > charset_registry ;
FT_String * charset_encoding = pcf face- > charset_encoding ;
FT_Bool unicode_charmap = 0 ;
@ -349,13 +349,13 @@ THE SOFTWARE.
( s [ 2 ] = = ' o ' | | s [ 2 ] = = ' O ' ) )
{
s + = 3 ;
if ( ! ft_strcmp ( s , " 10646 " ) | |
( ! ft_strcmp ( s , " 8859 " ) & &
! ft_strcmp ( face - > charset_encoding , " 1 " ) ) )
if ( ! ft_strcmp ( s , " 10646 " ) | |
( ! ft_strcmp ( s , " 8859 " ) & &
! ft_strcmp ( pcf face- > charset_encoding , " 1 " ) ) )
unicode_charmap = 1 ;
/* another name for ASCII */
else if ( ! ft_strcmp ( s , " 646.1991 " ) & &
! ft_strcmp ( face - > charset_encoding , " IRV " ) )
else if ( ! ft_strcmp ( s , " 646.1991 " ) & &
! ft_strcmp ( pcf face- > charset_encoding , " IRV " ) )
unicode_charmap = 1 ;
}
}
@ -364,7 +364,7 @@ THE SOFTWARE.
FT_CharMapRec charmap ;
charmap . face = FT_FACE ( face ) ;
charmap . face = face ;
charmap . encoding = FT_ENCODING_NONE ;
/* initial platform/encoding should indicate unset status? */
charmap . platform_id = TT_PLATFORM_APPLE_UNICODE ;
@ -386,7 +386,7 @@ THE SOFTWARE.
Fail :
FT_TRACE2 ( ( " not a PCF file \n " ) ) ;
PCF_Face_Done ( pcf face ) ;
PCF_Face_Done ( face ) ;
error = FT_THROW ( Unknown_File_Format ) ; /* error */
goto Exit ;
}
@ -569,15 +569,16 @@ THE SOFTWARE.
*
*/
static FT_Error
pcf_get_bdf_property ( PC F_Face face ,
FT_CALLBACK_DEF ( FT_Error )
pcf_get_bdf_property ( FT _Face face , /* PCF_Face */
const char * prop_name ,
BDF_PropertyRec * aproperty )
{
PCF_Face pcfface = ( PCF_Face ) face ;
PCF_Property prop ;
prop = pcf_find_property ( face , prop_name ) ;
prop = pcf_find_property ( pcf face, prop_name ) ;
if ( prop )
{
if ( prop - > isString )
@ -611,13 +612,16 @@ THE SOFTWARE.
}
static FT_Error
pcf_get_charset_id ( PC F_Face face ,
FT_CALLBACK_DEF ( FT_Error )
pcf_get_charset_id ( FT _Face face , /* PCF_Face */
const char * * acharset_encoding ,
const char * * acharset_registry )
{
* acharset_encoding = face - > charset_encoding ;
* acharset_registry = face - > charset_registry ;
PCF_Face pcfface = ( PCF_Face ) face ;
* acharset_encoding = pcfface - > charset_encoding ;
* acharset_registry = pcfface - > charset_registry ;
return FT_Err_Ok ;
}
@ -634,7 +638,7 @@ THE SOFTWARE.
* PROPERTY SERVICE
*
*/
static FT_Error
FT_CALLBACK_DEF ( FT_Error )
pcf_property_set ( FT_Module module , /* PCF_Driver */
const char * property_name ,
const void * value ,
@ -695,7 +699,7 @@ THE SOFTWARE.
}
static FT_Error
FT_CALLBACK_DEF ( FT_Error )
pcf_property_get ( FT_Module module , /* PCF_Driver */
const char * property_name ,
const void * value )