@ -26,6 +26,7 @@
# include FT_SERVICE_POSTSCRIPT_CMAPS_H
# include FT_INTERNAL_POSTSCRIPT_AUX_H
# include FT_INTERNAL_POSTSCRIPT_HINTS_H
# include FT_TYPE1_DRIVER_H
# include "ciderrs.h"
@ -463,9 +464,38 @@
/* FreeType error code. 0 means success. */
/* */
FT_LOCAL_DEF ( FT_Error )
cid_driver_init ( FT_Module driver )
cid_driver_init ( FT_Module module )
{
FT_UNUSED ( driver ) ;
PS_Driver driver = ( PS_Driver ) module ;
FT_UInt32 seed ;
/* set default property values, cf. `ftcffdrv.h' */
driver - > hinting_engine = FT_T1_HINTING_ADOBE ;
driver - > no_stem_darkening = TRUE ;
driver - > darken_params [ 0 ] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 ;
driver - > darken_params [ 1 ] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 ;
driver - > darken_params [ 2 ] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 ;
driver - > darken_params [ 3 ] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 ;
driver - > darken_params [ 4 ] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 ;
driver - > darken_params [ 5 ] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 ;
driver - > darken_params [ 6 ] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 ;
driver - > darken_params [ 7 ] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 ;
/* compute random seed from some memory addresses */
seed = ( FT_UInt32 ) ( ( FT_Offset ) ( char * ) & seed ^
( FT_Offset ) ( char * ) & module ^
( FT_Offset ) ( char * ) module - > memory ) ;
seed = seed ^ ( seed > > 10 ) ^ ( seed > > 20 ) ;
driver - > random_seed = ( FT_Int32 ) seed ;
if ( driver - > random_seed < 0 )
driver - > random_seed = - driver - > random_seed ;
else if ( driver - > random_seed = = 0 )
driver - > random_seed = 123456789 ;
return FT_Err_Ok ;
}