* 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242
diff --git a/ChangeLog b/ChangeLog
index 8fad44e..2e6b1db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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,
diff --git a/include/freetype/internal/psaux.h b/include/freetype/internal/psaux.h
index 680b438..77cbab6 100644
--- a/include/freetype/internal/psaux.h
+++ b/include/freetype/internal/psaux.h
@@ -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 )
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index 1882a8a..4fa3d04 100644
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -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 );
diff --git a/src/cff/cffparse.c b/src/cff/cffparse.c
index 3e1f840..a44e43e 100644
--- a/src/cff/cffparse.c
+++ b/src/cff/cffparse.c
@@ -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 )
diff --git a/src/cff/cfftoken.h b/src/cff/cfftoken.h
index 212db74..65a8468 100644
--- a/src/cff/cfftoken.h
+++ b/src/cff/cfftoken.h
@@ -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 */
diff --git a/src/cid/cidload.c b/src/cid/cidload.c
index 866b2f0..7dffd96 100644
--- a/src/cid/cidload.c
+++ b/src/cid/cidload.c
@@ -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;
}
diff --git a/src/cid/cidtoken.h b/src/cid/cidtoken.h
index e228098..6d8d797 100644
--- a/src/cid/cidtoken.h
+++ b/src/cid/cidtoken.h
@@ -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 )
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index 7cf6b88..fa1f74a 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -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;
diff --git a/src/pshinter/pshglob.c b/src/pshinter/pshglob.c
index 61a9b86..7c09ea4 100644
--- a/src/pshinter/pshglob.c
+++ b/src/pshinter/pshglob.c
@@ -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
diff --git a/src/type1/t1tokens.h b/src/type1/t1tokens.h
index 5d445df..411073f 100644
--- a/src/type1/t1tokens.h
+++ b/src/type1/t1tokens.h
@@ -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 )