* include/freetype/internal/psaux.h (T1_FieldType): Add

T1_FIELD_TYPE_FIXED_1000 and T1_FIELD_TYPE_FIXED_1000_P.
(T1_FIELD_FIXED_1000, T1_FIELD_FIXED_1000_P): New macros.
* src/psaux/psobjs.c (ps_parser_load_field): Handle
T1_FIELD_TYPE_FIXED_1000 and T1_FIELD_TYPE_FIXED_1000_P.

* src/cff/cffparse.c (cff_kind_fixed_thousand): New enumeration.
(CFF_FIELD_FIXED_1000): New macro.
(cff_parser_run): Handle cff_kind_fixed_thousand.
* src/cff/cfftoken.h: Use CFF_FIELD_FIXED_1000 for blue_scale.
* src/cff/cffload (cff_subfont_load): Fix default values of
expansion_factor and blue_scale.

* src/cif/cidtoken.h, src/type1/t1tokens.h: Use T1_FIELD_FIXED_1000
for blue_scale.

* src/pshinter/pshglob.c (psh_globals_new): Fix default value of
blue_scale.
This commit is contained in:
Werner Lemberg 2003-06-06 05:07:53 +00:00
parent 7386197677
commit bf7c8321f2
10 changed files with 74 additions and 29 deletions

View File

@ -1,3 +1,24 @@
2003-06-05 Werner Lemberg <wl@gnu.org>
* include/freetype/internal/psaux.h (T1_FieldType): Add
T1_FIELD_TYPE_FIXED_1000 and T1_FIELD_TYPE_FIXED_1000_P.
(T1_FIELD_FIXED_1000, T1_FIELD_FIXED_1000_P): New macros.
* src/psaux/psobjs.c (ps_parser_load_field): Handle
T1_FIELD_TYPE_FIXED_1000 and T1_FIELD_TYPE_FIXED_1000_P.
* src/cff/cffparse.c (cff_kind_fixed_thousand): New enumeration.
(CFF_FIELD_FIXED_1000): New macro.
(cff_parser_run): Handle cff_kind_fixed_thousand.
* src/cff/cfftoken.h: Use CFF_FIELD_FIXED_1000 for blue_scale.
* src/cff/cffload (cff_subfont_load): Fix default values of
expansion_factor and blue_scale.
* src/cif/cidtoken.h, src/type1/t1tokens.h: Use T1_FIELD_FIXED_1000
for blue_scale.
* src/pshinter/pshglob.c (psh_globals_new): Fix default value of
blue_scale.
2003-06-04 Wolfgang Domröse <porthos.domroese@harz.de>
* include/freetype/internal/ftdriver.h,

View File

@ -180,6 +180,8 @@ FT_BEGIN_HEADER
T1_FIELD_TYPE_INTEGER_P,
T1_FIELD_TYPE_FIXED,
T1_FIELD_TYPE_FIXED_P,
T1_FIELD_TYPE_FIXED_1000,
T1_FIELD_TYPE_FIXED_1000_P,
T1_FIELD_TYPE_STRING,
T1_FIELD_TYPE_BBOX,
T1_FIELD_TYPE_INTEGER_ARRAY,
@ -282,6 +284,12 @@ FT_BEGIN_HEADER
#define T1_FIELD_FIXED_P( _ident, _fname ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_P, _fname )
#define T1_FIELD_FIXED_1000( _ident, _fname ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_1000, _fname )
#define T1_FIELD_FIXED_1000_P( _ident, _fname ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_1000_P, _fname )
#define T1_FIELD_STRING( _ident, _fname ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_STRING, _fname )

View File

@ -1990,8 +1990,8 @@
priv->blue_shift = 7;
priv->blue_fuzz = 1;
priv->lenIV = -1;
priv->expansion_factor = (FT_Fixed)0.06 * 0x10000L;
priv->blue_scale = (FT_Fixed)0.039625 * 0x10000L;
priv->expansion_factor = (FT_Fixed)( 0.06 * 0x10000L );
priv->blue_scale = (FT_Fixed)( 0.039625 * 0x10000L * 1000 );
cff_parser_init( &parser, CFF_CODE_PRIVATE, priv );

View File

@ -4,7 +4,7 @@
/* */
/* CFF token stream parser (body) */
/* */
/* Copyright 1996-2001, 2002 by */
/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -38,6 +38,7 @@
cff_kind_none = 0,
cff_kind_num,
cff_kind_fixed,
cff_kind_fixed_thousand,
cff_kind_string,
cff_kind_bool,
cff_kind_delta,
@ -429,6 +430,8 @@
CFF_FIELD( code, name, cff_kind_num )
#define CFF_FIELD_FIXED( code, name ) \
CFF_FIELD( code, name, cff_kind_fixed )
#define CFF_FIELD_FIXED_1000( code, name ) \
CFF_FIELD( code, name, cff_kind_fixed_thousand )
#define CFF_FIELD_STRING( code, name ) \
CFF_FIELD( code, name, cff_kind_string )
#define CFF_FIELD_BOOL( code, name ) \
@ -579,6 +582,10 @@
case cff_kind_fixed:
val = cff_parse_fixed( parser->stack );
goto Store_Number;
case cff_kind_fixed_thousand:
val = cff_parse_fixed_thousand( parser->stack );
Store_Number:
switch ( field->size )

View File

@ -72,26 +72,26 @@
#undef CFFCODE
#define CFFCODE CFFCODE_PRIVATE
CFF_FIELD_DELTA( 6, blue_values, 14 )
CFF_FIELD_DELTA( 7, other_blues, 10 )
CFF_FIELD_DELTA( 8, family_blues, 14 )
CFF_FIELD_DELTA( 9, family_other_blues, 10 )
CFF_FIELD_FIXED( 0x109, blue_scale )
CFF_FIELD_NUM ( 0x10A, blue_shift )
CFF_FIELD_NUM ( 0x10B, blue_fuzz )
CFF_FIELD_NUM ( 10, standard_width )
CFF_FIELD_NUM ( 11, standard_height )
CFF_FIELD_DELTA( 0x10C, snap_widths, 13 )
CFF_FIELD_DELTA( 0x10D, snap_heights, 13 )
CFF_FIELD_BOOL ( 0x10E, force_bold )
CFF_FIELD_FIXED( 0x10F, force_bold_threshold )
CFF_FIELD_NUM ( 0x110, lenIV )
CFF_FIELD_NUM ( 0x111, language_group )
CFF_FIELD_FIXED( 0x112, expansion_factor )
CFF_FIELD_NUM ( 0x113, initial_random_seed )
CFF_FIELD_NUM ( 19, local_subrs_offset )
CFF_FIELD_NUM ( 20, default_width )
CFF_FIELD_NUM ( 21, nominal_width )
CFF_FIELD_DELTA ( 6, blue_values, 14 )
CFF_FIELD_DELTA ( 7, other_blues, 10 )
CFF_FIELD_DELTA ( 8, family_blues, 14 )
CFF_FIELD_DELTA ( 9, family_other_blues, 10 )
CFF_FIELD_FIXED_1000( 0x109, blue_scale )
CFF_FIELD_NUM ( 0x10A, blue_shift )
CFF_FIELD_NUM ( 0x10B, blue_fuzz )
CFF_FIELD_NUM ( 10, standard_width )
CFF_FIELD_NUM ( 11, standard_height )
CFF_FIELD_DELTA ( 0x10C, snap_widths, 13 )
CFF_FIELD_DELTA ( 0x10D, snap_heights, 13 )
CFF_FIELD_BOOL ( 0x10E, force_bold )
CFF_FIELD_FIXED ( 0x10F, force_bold_threshold )
CFF_FIELD_NUM ( 0x110, lenIV )
CFF_FIELD_NUM ( 0x111, language_group )
CFF_FIELD_FIXED ( 0x112, expansion_factor )
CFF_FIELD_NUM ( 0x113, initial_random_seed )
CFF_FIELD_NUM ( 19, local_subrs_offset )
CFF_FIELD_NUM ( 20, default_width )
CFF_FIELD_NUM ( 21, nominal_width )
/* END */

View File

@ -147,9 +147,10 @@
if ( keyword->type == T1_FIELD_TYPE_INTEGER_ARRAY ||
keyword->type == T1_FIELD_TYPE_FIXED_ARRAY )
error = cid_parser_load_field_table( &loader->parser, keyword,
&dummy_object );
&dummy_object );
else
error = cid_parser_load_field( &loader->parser, keyword, &dummy_object );
error = cid_parser_load_field( &loader->parser,
keyword, &dummy_object );
Exit:
return error;
}

View File

@ -76,7 +76,7 @@
T1_FIELD_NUM ( "LanguageGroup", language_group )
T1_FIELD_NUM ( "password", password )
T1_FIELD_FIXED ( "BlueScale", blue_scale )
T1_FIELD_FIXED_1000( "BlueScale", blue_scale )
T1_FIELD_NUM ( "BlueShift", blue_shift )
T1_FIELD_NUM ( "BlueFuzz", blue_fuzz )

View File

@ -907,10 +907,18 @@
goto Store_Integer_P;
case T1_FIELD_TYPE_FIXED:
val = t1_tofixed( &cur, limit, 3 );
val = t1_tofixed( &cur, limit, 0 );
goto Store_Integer;
case T1_FIELD_TYPE_FIXED_P:
val = t1_tofixed( &cur, limit, 0 );
goto Store_Integer_P;
case T1_FIELD_TYPE_FIXED_1000:
val = t1_tofixed( &cur, limit, 3 );
goto Store_Integer;
case T1_FIELD_TYPE_FIXED_1000_P:
val = t1_tofixed( &cur, limit, 3 );
goto Store_Integer_P;

View File

@ -677,7 +677,7 @@
globals->blues.blue_scale = priv->blue_scale
? priv->blue_scale
: 0x28937L; /* 0.039625 * 0x400000L */
: 0x27A000L; /* 0.039625 * 0x10000 * 1000 */
globals->blues.blue_shift = priv->blue_shift
? priv->blue_shift

View File

@ -44,7 +44,7 @@
T1_FIELD_NUM ( "LanguageGroup", language_group )
T1_FIELD_NUM ( "password", password )
T1_FIELD_FIXED ( "BlueScale", blue_scale )
T1_FIELD_FIXED_1000( "BlueScale", blue_scale )
T1_FIELD_NUM ( "BlueShift", blue_shift )
T1_FIELD_NUM ( "BlueFuzz", blue_fuzz )