~ubuntu-branches/ubuntu/karmic/freetype/karmic

« back to all changes in this revision

Viewing changes to debian/patches/100-freetype-2.1.4-CVS-int-fixed_p-incompatibility.diff

  • Committer: Bazaar Package Importer
  • Author(s): dann frazier
  • Date: 2004-11-08 19:06:57 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041108190657-a3vs3finmdawla3c
Tags: 2.1.7-2.3
* NMU
* debian/patches/090-freetype-2.1.7-normalize-fix.diff: Patch
  by David Mossberger.  Backport from freetype2 CVS that fixes an
  off-by-order-of-magnitude performance issue in the normalization code.
  (Closes: #259875)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: include/freetype/t1tables.h
 
2
===================================================================
 
3
RCS file: /cvs/freetype/freetype2/include/freetype/t1tables.h,v
 
4
retrieving revision 1.23
 
5
retrieving revision 1.24
 
6
diff -u -r1.23 -r1.24
 
7
--- freetype2~/include/freetype/t1tables.h      2002/07/11 11:26:21     1.23
 
8
+++ freetype2/include/freetype/t1tables.h       2003/05/30 09:12:46     1.24
 
9
@@ -5,7 +5,7 @@
 
10
 /*    Basic Type 1/Type 2 tables definitions and interface (specification  */
 
11
 /*    only).                                                               */
 
12
 /*                                                                         */
 
13
-/*  Copyright 1996-2001, 2002 by                                           */
 
14
+/*  Copyright 1996-2001, 2002, 2003 by                                     */
 
15
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 
16
 /*                                                                         */
 
17
 /*  This file is part of the FreeType project, and may only be used,       */
 
18
@@ -67,10 +67,10 @@
 
19
     FT_String*  full_name;
 
20
     FT_String*  family_name;
 
21
     FT_String*  weight;
 
22
-    FT_Long     italic_angle;
 
23
-    FT_Bool     is_fixed_pitch;
 
24
-    FT_Short    underline_position;
 
25
-    FT_UShort   underline_thickness;
 
26
+    FT_Fixed*   italic_angle;
 
27
+    FT_Bool*    is_fixed_pitch;
 
28
+    FT_Fixed*   underline_position;
 
29
+    FT_Fixed*   underline_thickness;
 
30
 
 
31
   } PS_FontInfoRec, *PS_FontInfo;
 
32
 
 
33
Index: include/freetype/internal/cfftypes.h
 
34
===================================================================
 
35
RCS file: /cvs/freetype/freetype2/include/freetype/internal/cfftypes.h,v
 
36
retrieving revision 1.12
 
37
retrieving revision 1.13
 
38
diff -u -r1.12 -r1.13
 
39
--- freetype2~/include/freetype/internal/cfftypes.h     2002/07/10 16:52:06     1.12
 
40
+++ freetype2/include/freetype/internal/cfftypes.h      2003/05/30 09:12:47     1.13
 
41
@@ -5,7 +5,7 @@
 
42
 /*    Basic OpenType/CFF type definitions and interface (specification     */
 
43
 /*    only).                                                               */
 
44
 /*                                                                         */
 
45
-/*  Copyright 1996-2001, 2002 by                                           */
 
46
+/*  Copyright 1996-2001, 2002, 2003 by                                     */
 
47
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 
48
 /*                                                                         */
 
49
 /*  This file is part of the FreeType project, and may only be used,       */
 
50
@@ -96,8 +96,8 @@
 
51
     FT_UInt    weight;
 
52
     FT_Bool    is_fixed_pitch;
 
53
     FT_Fixed   italic_angle;
 
54
-    FT_Pos     underline_position;
 
55
-    FT_Pos     underline_thickness;
 
56
+    FT_Fixed   underline_position;
 
57
+    FT_Fixed   underline_thickness;
 
58
     FT_Int     paint_type;
 
59
     FT_Int     charstring_type;
 
60
     FT_Matrix  font_matrix;
 
61
Index: include/freetype/internal/t1types.h
 
62
===================================================================
 
63
RCS file: /cvs/freetype/freetype2/include/freetype/internal/t1types.h,v
 
64
retrieving revision 1.31
 
65
retrieving revision 1.32
 
66
diff -u -r1.31 -r1.32
 
67
--- freetype2~/include/freetype/internal/t1types.h      2002/05/21 14:13:00     1.31
 
68
+++ freetype2/include/freetype/internal/t1types.h       2003/05/30 09:12:47     1.32
 
69
@@ -5,7 +5,7 @@
 
70
 /*    Basic Type1/Type2 type definitions and interface (specification      */
 
71
 /*    only).                                                               */
 
72
 /*                                                                         */
 
73
-/*  Copyright 1996-2001, 2002 by                                           */
 
74
+/*  Copyright 1996-2001, 2002, 2003 by                                     */
 
75
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 
76
 /*                                                                         */
 
77
 /*  This file is part of the FreeType project, and may only be used,       */
 
78
@@ -108,14 +108,14 @@
 
79
     FT_Byte**        charstrings;       /* array of glyph charstrings */
 
80
     FT_Int*          charstrings_len;
 
81
 
 
82
-    FT_Byte          paint_type;
 
83
+    FT_Byte*         paint_type;
 
84
     FT_Byte          font_type;
 
85
     FT_Matrix        font_matrix;
 
86
     FT_Vector        font_offset;
 
87
     FT_BBox          font_bbox;
 
88
     FT_Long          font_id;
 
89
 
 
90
-    FT_Int           stroke_width;
 
91
+    FT_Fixed*        stroke_width;
 
92
 
 
93
   } T1_FontRec, *T1_Font;
 
94
 
 
95
Index: src/cff/cffload.c
 
96
===================================================================
 
97
RCS file: /cvs/freetype/freetype2/src/cff/cffload.c,v
 
98
retrieving revision 1.49
 
99
retrieving revision 1.50
 
100
diff -u -r1.49 -r1.50
 
101
--- freetype2~/src/cff/cffload.c        2003/04/23 06:47:12     1.49
 
102
+++ freetype2/src/cff/cffload.c 2003/05/30 09:12:47     1.50
 
103
@@ -4,7 +4,7 @@
 
104
 /*                                                                         */
 
105
 /*    OpenType and CFF data/program tables loader (body).                  */
 
106
 /*                                                                         */
 
107
-/*  Copyright 1996-2001, 2002 by                                           */
 
108
+/*  Copyright 1996-2001, 2002, 2003 by                                     */
 
109
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 
110
 /*                                                                         */
 
111
 /*  This file is part of the FreeType project, and may only be used,       */
 
112
@@ -1965,8 +1965,8 @@
 
113
     /* set defaults */
 
114
     FT_MEM_ZERO( top, sizeof ( *top ) );
 
115
 
 
116
-    top->underline_position  = -100;
 
117
-    top->underline_thickness = 50;
 
118
+    top->underline_position  = -100L << 16;
 
119
+    top->underline_thickness = 50L << 16;
 
120
     top->charstring_type     = 2;
 
121
     top->font_matrix.xx      = 0x10000L;
 
122
     top->font_matrix.yy      = 0x10000L;
 
123
Index: src/cff/cffobjs.c
 
124
===================================================================
 
125
RCS file: /cvs/freetype/freetype2/src/cff/cffobjs.c,v
 
126
retrieving revision 1.47
 
127
retrieving revision 1.48
 
128
diff -u -r1.47 -r1.48
 
129
--- freetype2~/src/cff/cffobjs.c        2002/09/27 11:09:22     1.47
 
130
+++ freetype2/src/cff/cffobjs.c 2003/05/30 09:12:47     1.48
 
131
@@ -4,7 +4,7 @@
 
132
 /*                                                                         */
 
133
 /*    OpenType objects manager (body).                                     */
 
134
 /*                                                                         */
 
135
-/*  Copyright 1996-2001, 2002 by                                           */
 
136
+/*  Copyright 1996-2001, 2002, 2003 by                                     */
 
137
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 
138
 /*                                                                         */
 
139
 /*  This file is part of the FreeType project, and may only be used,       */
 
140
@@ -293,7 +293,7 @@
 
141
       sfnt_format = 1;
 
142
 
 
143
       /* now, the font can be either an OpenType/CFF font, or an SVG CEF */
 
144
-      /* font in the later case; it doesn't have a `head' table          */
 
145
+      /* font; in the later case it doesn't have a `head' table          */
 
146
       error = face->goto_table( face, TTAG_head, stream, 0 );
 
147
       if ( !error )
 
148
       {
 
149
@@ -395,6 +395,9 @@
 
150
           root->units_per_EM = dict->units_per_em;
 
151
         else
 
152
           root->units_per_EM = 1000;
 
153
+
 
154
+        root->underline_position  = dict->underline_position >> 16;
 
155
+        root->underline_thickness = dict->underline_thickness >> 16;
 
156
 
 
157
         /* retrieve font family & style name */
 
158
         root->family_name  = cff_index_get_name( &cff->name_index, face_index );
 
159
Index: src/cff/cfftoken.h
 
160
===================================================================
 
161
RCS file: /cvs/freetype/freetype2/src/cff/cfftoken.h,v
 
162
retrieving revision 1.6
 
163
retrieving revision 1.7
 
164
diff -u -r1.6 -r1.7
 
165
--- freetype2~/src/cff/cfftoken.h       2002/03/30 16:41:09     1.6
 
166
+++ freetype2/src/cff/cfftoken.h        2003/05/30 09:12:47     1.7
 
167
@@ -4,7 +4,7 @@
 
168
 /*                                                                         */
 
169
 /*    CFF token definitions (specification only).                          */
 
170
 /*                                                                         */
 
171
-/*  Copyright 1996-2001, 2002 by                                           */
 
172
+/*  Copyright 1996-2001, 2002, 2003 by                                     */
 
173
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 
174
 /*                                                                         */
 
175
 /*  This file is part of the FreeType project, and may only be used,       */
 
176
@@ -30,8 +30,8 @@
 
177
   CFF_FIELD_STRING  ( 4,     weight )
 
178
   CFF_FIELD_BOOL    ( 0x101, is_fixed_pitch )
 
179
   CFF_FIELD_FIXED   ( 0x102, italic_angle )
 
180
-  CFF_FIELD_NUM     ( 0x103, underline_position )
 
181
-  CFF_FIELD_NUM     ( 0x104, underline_thickness )
 
182
+  CFF_FIELD_FIXED   ( 0x103, underline_position )
 
183
+  CFF_FIELD_FIXED   ( 0x104, underline_thickness )
 
184
   CFF_FIELD_NUM     ( 0x105, paint_type )
 
185
   CFF_FIELD_NUM     ( 0x106, charstring_type )
 
186
   CFF_FIELD_CALLBACK( 0x107, font_matrix )
 
187
Index: src/cid/cidobjs.c
 
188
===================================================================
 
189
RCS file: /cvs/freetype/freetype2/src/cff/cidobjs.c,v
 
190
retrieving revision 1.55
 
191
retrieving revision 1.56
 
192
diff -u -r1.55 -r1.56
 
193
--- freetype2/src/cid/cidobjs.c 2003/04/25 05:35:04     1.55
 
194
+++ freetype2/src/cid/cidobjs.c 2003/05/30 09:12:48     1.56
 
195
@@ -221,6 +221,11 @@
 
196
       FT_FREE( info->family_name );
 
197
       FT_FREE( info->weight );
 
198
 
 
199
+      FT_FREE( info->italic_angle );
 
200
+      FT_FREE( info->underline_position );
 
201
+      FT_FREE( info->underline_thickness );
 
202
+      FT_FREE( info->is_fixed_pitch );
 
203
+
 
204
       /* release font dictionaries */
 
205
       FT_FREE( cid->font_dicts );
 
206
       cid->num_dicts = 0;
 
207
@@ -331,10 +336,12 @@
 
208
       /* Init the face object fields */
 
209
       /* Now set up root face fields */
 
210
       {
 
211
-        FT_Face  root = (FT_Face)&face->root;
 
212
+        FT_Face       root = (FT_Face)&face->root;
 
213
+        CID_FaceInfo  cid  = &face->cid;
 
214
+        PS_FontInfo   info = &cid->font_info;
 
215
 
 
216
 
 
217
-        root->num_glyphs   = face->cid.cid_count;
 
218
+        root->num_glyphs   = cid->cid_count;
 
219
         root->num_charmaps = 0;
 
220
 
 
221
         root->face_index = face_index;
 
222
@@ -342,17 +349,17 @@
 
223
 
 
224
         root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
 
225
 
 
226
-        if ( face->cid.font_info.is_fixed_pitch )
 
227
+        if ( info->is_fixed_pitch && *info->is_fixed_pitch )
 
228
           root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
 
229
 
 
230
         /* XXX: TODO: add kerning with .afm support */
 
231
 
 
232
         /* get style name -- be careful, some broken fonts only */
 
233
         /* have a /FontName dictionary entry!                   */
 
234
-        root->family_name = face->cid.font_info.family_name;
 
235
+        root->family_name = info->family_name;
 
236
         if ( root->family_name )
 
237
         {
 
238
-          char*  full   = face->cid.font_info.full_name;
 
239
+          char*  full   = info->full_name;
 
240
           char*  family = root->family_name;
 
241
 
 
242
           while ( *family && *full == *family )
 
243
@@ -369,9 +376,9 @@
 
244
         else
 
245
         {
 
246
           /* do we have a `/FontName'? */
 
247
-          if ( face->cid.cid_font_name )
 
248
+          if ( cid->cid_font_name )
 
249
           {
 
250
-            root->family_name = face->cid.cid_font_name;
 
251
+            root->family_name = cid->cid_font_name;
 
252
             root->style_name  = (char *)"Regular";
 
253
           }
 
254
         }
 
255
@@ -380,10 +387,10 @@
 
256
         root->num_fixed_sizes = 0;
 
257
         root->available_sizes = 0;
 
258
 
 
259
-        root->bbox.xMin =   face->cid.font_bbox.xMin             >> 16;
 
260
-        root->bbox.yMin =   face->cid.font_bbox.yMin             >> 16;
 
261
-        root->bbox.xMax = ( face->cid.font_bbox.xMax + 0xFFFFU ) >> 16;
 
262
-        root->bbox.yMax = ( face->cid.font_bbox.yMax + 0xFFFFU ) >> 16;
 
263
+        root->bbox.xMin =   cid->font_bbox.xMin             >> 16;
 
264
+        root->bbox.yMin =   cid->font_bbox.yMin             >> 16;
 
265
+        root->bbox.xMax = ( cid->font_bbox.xMax + 0xFFFFU ) >> 16;
 
266
+        root->bbox.yMax = ( cid->font_bbox.yMax + 0xFFFFU ) >> 16;
 
267
 
 
268
         if ( !root->units_per_EM )
 
269
           root->units_per_EM  = 1000;
 
270
@@ -393,8 +400,10 @@
 
271
         root->height    = (FT_Short)(
 
272
           ( ( root->ascender + root->descender ) * 12 ) / 10 );
 
273
 
 
274
-        root->underline_position  = face->cid.font_info.underline_position;
 
275
-        root->underline_thickness = face->cid.font_info.underline_thickness;
 
276
+        if ( info->underline_position )
 
277
+          root->underline_position = *info->underline_position >> 16;
 
278
+        if ( info->underline_thickness )
 
279
+          root->underline_thickness = *info->underline_thickness >> 16;
 
280
 
 
281
         root->internal->max_points   = 0;
 
282
         root->internal->max_contours = 0;
 
283
Index: src/cid/cidtoken.h
 
284
===================================================================
 
285
RCS file: /cvs/freetype/freetype2/src/cid/cidtoken.h,v
 
286
retrieving revision 1.6
 
287
retrieving revision 1.7
 
288
diff -u -r1.6 -r1.7
 
289
--- freetype2~/src/cid/cidtoken.h       2002/03/30 17:08:04     1.6
 
290
+++ freetype2/src/cid/cidtoken.h        2003/05/30 09:12:48     1.7
 
291
@@ -4,7 +4,7 @@
 
292
 /*                                                                         */
 
293
 /*    CID token definitions (specification only).                          */
 
294
 /*                                                                         */
 
295
-/*  Copyright 1996-2001, 2002 by                                           */
 
296
+/*  Copyright 1996-2001, 2002, 2003 by                                     */
 
297
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 
298
 /*                                                                         */
 
299
 /*  This file is part of the FreeType project, and may only be used,       */
 
300
@@ -39,15 +39,15 @@
 
301
 #undef  T1CODE
 
302
 #define T1CODE        T1_FIELD_LOCATION_FONT_INFO
 
303
 
 
304
-  T1_FIELD_STRING   ( "version", version )
 
305
-  T1_FIELD_STRING   ( "Notice", notice )
 
306
-  T1_FIELD_STRING   ( "FullName", full_name )
 
307
-  T1_FIELD_STRING   ( "FamilyName", family_name )
 
308
-  T1_FIELD_STRING   ( "Weight", weight )
 
309
-  T1_FIELD_FIXED    ( "ItalicAngle", italic_angle )
 
310
-  T1_FIELD_TYPE_BOOL( "isFixedPitch", is_fixed_pitch )
 
311
-  T1_FIELD_NUM      ( "UnderlinePosition", underline_position )
 
312
-  T1_FIELD_NUM      ( "UnderlineThickness", underline_thickness )
 
313
+  T1_FIELD_STRING     ( "version", version )
 
314
+  T1_FIELD_STRING     ( "Notice", notice )
 
315
+  T1_FIELD_STRING     ( "FullName", full_name )
 
316
+  T1_FIELD_STRING     ( "FamilyName", family_name )
 
317
+  T1_FIELD_STRING     ( "Weight", weight )
 
318
+  T1_FIELD_FIXED_P    ( "ItalicAngle", italic_angle )
 
319
+  T1_FIELD_TYPE_BOOL_P( "isFixedPitch", is_fixed_pitch )
 
320
+  T1_FIELD_FIXED_P    ( "UnderlinePosition", underline_position )
 
321
+  T1_FIELD_FIXED_P    ( "UnderlineThickness", underline_thickness )
 
322
 
 
323
 
 
324
 #undef  FT_STRUCTURE
 
325
@@ -63,7 +63,7 @@
 
326
   T1_FIELD_NUM  ( "lenBuildCharArray", len_buildchar )
 
327
   T1_FIELD_FIXED( "ForceBoldThreshold", forcebold_threshold )
 
328
   T1_FIELD_FIXED( "ExpansionFactor", expansion_factor )
 
329
-  T1_FIELD_NUM  ( "StrokeWidth", stroke_width )
 
330
+  T1_FIELD_FIXED( "StrokeWidth", stroke_width )
 
331
 
 
332
 
 
333
 #undef  FT_STRUCTURE
 
334
Index: src/pshinter/pshglob.c
 
335
===================================================================
 
336
RCS file: /cvs/freetype/freetype2/src/pshinter/pshglob.c,v
 
337
retrieving revision 1.22
 
338
retrieving revision 1.23
 
339
diff -u -r1.22 -r1.23
 
340
--- freetype2~/src/pshinter/pshglob.c   2003/05/28 22:42:41     1.22
 
341
+++ freetype2/src/pshinter/pshglob.c    2003/05/30 09:12:49     1.23
 
342
@@ -700,7 +700,7 @@
 
343
   }
 
344
 
 
345
 
 
346
-  static FT_Error
 
347
+  FT_LOCAL_DEF( FT_Error )
 
348
   psh_globals_set_scale( PSH_Globals  globals,
 
349
                          FT_Fixed     x_scale,
 
350
                          FT_Fixed     y_scale,
 
351
Index: src/pshinter/pshglob.h
 
352
===================================================================
 
353
RCS file: /cvs/freetype/freetype2/src/pshinter/pshglob.h,v
 
354
retrieving revision 1.14
 
355
retrieving revision 1.15
 
356
diff -u -r1.14 -r1.15
 
357
--- freetype2~/src/pshinter/pshglob.h   2003/05/28 22:42:41     1.14
 
358
+++ freetype2/src/pshinter/pshglob.h    2003/05/30 09:12:49     1.15
 
359
@@ -167,6 +167,13 @@
 
360
                             FT_Int         org_width );
 
361
 #endif
 
362
 
 
363
+  FT_LOCAL( FT_Error )
 
364
+  psh_globals_set_scale( PSH_Globals  globals,
 
365
+                         FT_Fixed     x_scale,
 
366
+                         FT_Fixed     y_scale,
 
367
+                         FT_Fixed     x_delta,
 
368
+                         FT_Fixed     y_delta );
 
369
+
 
370
   /* snap a stem to one or two blue zones */
 
371
   FT_LOCAL( void )
 
372
   psh_blues_snap_stem( PSH_Blues      blues,
 
373
Index: src/type1/t1objs.c
 
374
===================================================================
 
375
RCS file: /cvs/freetype/freetype2/src/type1/t1objs.c,v
 
376
retrieving revision 1.77
 
377
retrieving revision 1.78
 
378
diff -u -r1.77 -r1.78
 
379
--- freetype2~/src/type1/t1objs.c       2003/04/25 05:35:04     1.77
 
380
+++ freetype2/src/type1/t1objs.c        2003/05/30 09:12:49     1.78
 
381
@@ -211,6 +211,11 @@
 
382
         FT_FREE( info->full_name );
 
383
         FT_FREE( info->family_name );
 
384
         FT_FREE( info->weight );
 
385
+
 
386
+        FT_FREE( info->italic_angle );
 
387
+        FT_FREE( info->underline_position );
 
388
+        FT_FREE( info->underline_thickness );
 
389
+        FT_FREE( info->is_fixed_pitch );
 
390
       }
 
391
 
 
392
       /* release top dictionary */
 
393
@@ -229,6 +234,9 @@
 
394
       FT_FREE( type1->encoding.char_name );
 
395
       FT_FREE( type1->font_name );
 
396
 
 
397
+      FT_FREE( type1->paint_type );
 
398
+      FT_FREE( type1->stroke_width );
 
399
+
 
400
 #ifndef T1_CONFIG_OPTION_NO_AFM
 
401
       /* release afm data if present */
 
402
       if ( face->afm_data )
 
403
@@ -275,9 +283,11 @@
 
404
                 FT_Int         num_params,
 
405
                 FT_Parameter*  params )
 
406
   {
 
407
-    FT_Error          error;
 
408
-    PSNames_Service   psnames;
 
409
-    PSAux_Service     psaux;
 
410
+    FT_Error         error;
 
411
+    PSNames_Service  psnames;
 
412
+    PSAux_Service    psaux;
 
413
+    T1_Font          type1 = &face->type1;
 
414
+    PS_FontInfo      info = &type1->font_info;
 
415
 
 
416
     FT_UNUSED( num_params );
 
417
     FT_UNUSED( params );
 
418
@@ -323,14 +333,14 @@
 
419
       FT_Face  root = (FT_Face)&face->root;
 
420
 
 
421
 
 
422
-      root->num_glyphs = face->type1.num_glyphs;
 
423
+      root->num_glyphs = type1->num_glyphs;
 
424
       root->face_index = face_index;
 
425
 
 
426
       root->face_flags = FT_FACE_FLAG_SCALABLE;
 
427
       root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
 
428
       root->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
 
429
 
 
430
-      if ( face->type1.font_info.is_fixed_pitch )
 
431
+      if ( info->is_fixed_pitch && *info->is_fixed_pitch )
 
432
         root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
 
433
 
 
434
       if ( face->blend )
 
435
@@ -340,12 +350,12 @@
 
436
 
 
437
       /* get style name -- be careful, some broken fonts only */
 
438
       /* have a `/FontName' dictionary entry!                 */
 
439
-      root->family_name = face->type1.font_info.family_name;
 
440
+      root->family_name = info->family_name;
 
441
       /* assume "Regular" style if we don't know better */
 
442
       root->style_name = (char *)"Regular";
 
443
       if ( root->family_name )
 
444
       {
 
445
-        char*  full   = face->type1.font_info.full_name;
 
446
+        char*  full   = info->full_name;
 
447
         char*  family = root->family_name;
 
448
 
 
449
 
 
450
@@ -366,18 +376,18 @@
 
451
       else
 
452
       {
 
453
         /* do we have a `/FontName'? */
 
454
-        if ( face->type1.font_name )
 
455
+        if ( type1->font_name )
 
456
-          root->family_name = face->type1.font_name;
 
457
+          root->family_name = type1->font_name;
 
458
       }
 
459
 
 
460
       /* compute style flags */
 
461
       root->style_flags = 0;
 
462
-      if ( face->type1.font_info.italic_angle )
 
463
+      if ( info->italic_angle && *info->italic_angle )
 
464
         root->style_flags |= FT_STYLE_FLAG_ITALIC;
 
465
-      if ( face->type1.font_info.weight )
 
466
+      if ( info->weight )
 
467
       {
 
468
-        if ( !ft_strcmp( face->type1.font_info.weight, "Bold"  ) ||
 
469
-             !ft_strcmp( face->type1.font_info.weight, "Black" ) )
 
470
+        if ( !ft_strcmp( info->weight, "Bold"  ) ||
 
471
+             !ft_strcmp( info->weight, "Black" ) )
 
472
           root->style_flags |= FT_STYLE_FLAG_BOLD;
 
473
       }
 
474
 
 
475
@@ -388,10 +398,10 @@
 
476
       root->num_fixed_sizes = 0;
 
477
       root->available_sizes = 0;
 
478
 
 
479
-      root->bbox.xMin =   face->type1.font_bbox.xMin             >> 16;
 
480
-      root->bbox.yMin =   face->type1.font_bbox.yMin             >> 16;
 
481
-      root->bbox.xMax = ( face->type1.font_bbox.xMax + 0xFFFFU ) >> 16;
 
482
-      root->bbox.yMax = ( face->type1.font_bbox.yMax + 0xFFFFU ) >> 16;
 
483
+      root->bbox.xMin =   type1->font_bbox.xMin             >> 16;
 
484
+      root->bbox.yMin =   type1->font_bbox.yMin             >> 16;
 
485
+      root->bbox.xMax = ( type1->font_bbox.xMax + 0xFFFFU ) >> 16;
 
486
+      root->bbox.yMax = ( type1->font_bbox.yMax + 0xFFFFU ) >> 16;
 
487
 
 
488
       /* Set units_per_EM if we didn't set it in parse_font_matrix. */
 
489
       if ( !root->units_per_EM )
 
490
@@ -420,8 +430,10 @@
 
491
 
 
492
       root->max_advance_height = root->height;
 
493
 
 
494
-      root->underline_position  = face->type1.font_info.underline_position;
 
495
-      root->underline_thickness = face->type1.font_info.underline_thickness;
 
496
+      if ( info->underline_position )
 
497
+        root->underline_position  = *info->underline_position >> 16;
 
498
+      if ( info->underline_thickness )
 
499
+        root->underline_thickness = *info->underline_thickness >> 16;
 
500
 
 
501
       root->internal->max_points   = 0;
 
502
       root->internal->max_contours = 0;
 
503
@@ -451,7 +463,7 @@
 
504
         charmap.platform_id = 7;
 
505
         clazz               = NULL;
 
506
 
 
507
-        switch ( face->type1.encoding_type )
 
508
+        switch ( type1->encoding_type )
 
509
         {
 
510
         case T1_ENCODING_TYPE_STANDARD:
 
511
           charmap.encoding    = FT_ENCODING_ADOBE_STANDARD;
 
512
Index: src/type1/t1tokens.h
 
513
===================================================================
 
514
RCS file: /cvs/freetype/freetype2/src/type1/t1tokens.h,v
 
515
retrieving revision 1.16
 
516
retrieving revision 1.17
 
517
diff -u -r1.16 -r1.17
 
518
--- freetype2~/src/type1/t1tokens.h     2002/07/11 11:26:21     1.16
 
519
+++ freetype2/src/type1/t1tokens.h      2003/05/30 09:12:49     1.17
 
520
@@ -4,7 +4,7 @@
 
521
 /*                                                                         */
 
522
 /*    Type 1 tokenizer (specification).                                    */
 
523
 /*                                                                         */
 
524
-/*  Copyright 1996-2001, 2002 by                                           */
 
525
+/*  Copyright 1996-2001, 2002, 2003 by                                     */
 
526
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 
527
 /*                                                                         */
 
528
 /*  This file is part of the FreeType project, and may only be used,       */
 
529
@@ -21,16 +21,17 @@
 
530
 #undef  T1CODE
 
531
 #define T1CODE        T1_FIELD_LOCATION_FONT_INFO
 
532
 
 
533
-  T1_FIELD_STRING   ( "version", version )
 
534
-  T1_FIELD_STRING   ( "Notice", notice )
 
535
-  T1_FIELD_STRING   ( "FullName", full_name )
 
536
-  T1_FIELD_STRING   ( "FamilyName", family_name )
 
537
-  T1_FIELD_STRING   ( "Weight", weight )
 
538
-
 
539
-  T1_FIELD_NUM      ( "ItalicAngle", italic_angle )
 
540
-  T1_FIELD_TYPE_BOOL( "isFixedPitch", is_fixed_pitch )
 
541
-  T1_FIELD_NUM      ( "UnderlinePosition", underline_position )
 
542
-  T1_FIELD_NUM      ( "UnderlineThickness", underline_thickness )
 
543
+  T1_FIELD_STRING     ( "version", version )
 
544
+  T1_FIELD_STRING     ( "Notice", notice )
 
545
+  T1_FIELD_STRING     ( "FullName", full_name )
 
546
+  T1_FIELD_STRING     ( "FamilyName", family_name )
 
547
+  T1_FIELD_STRING     ( "Weight", weight )
 
548
+
 
549
+  /* we use pointers to detect modifications made by synthetic fonts */
 
550
+  T1_FIELD_FIXED_P    ( "ItalicAngle", italic_angle )
 
551
+  T1_FIELD_TYPE_BOOL_P( "isFixedPitch", is_fixed_pitch )
 
552
+  T1_FIELD_FIXED_P    ( "UnderlinePosition", underline_position )
 
553
+  T1_FIELD_FIXED_P    ( "UnderlineThickness", underline_thickness )
 
554
 
 
555
 
 
556
 #undef  FT_STRUCTURE
 
557
@@ -65,9 +66,9 @@
 
558
 #undef  T1CODE
 
559
 #define T1CODE        T1_FIELD_LOCATION_FONT_DICT
 
560
 
 
561
-  T1_FIELD_NUM( "PaintType", paint_type )
 
562
-  T1_FIELD_NUM( "FontType", font_type )
 
563
-  T1_FIELD_NUM( "StrokeWidth", stroke_width )
 
564
+  T1_FIELD_NUM_P  ( "PaintType", paint_type )
 
565
+  T1_FIELD_NUM    ( "FontType", font_type )
 
566
+  T1_FIELD_FIXED_P( "StrokeWidth", stroke_width )
 
567
 
 
568
 #undef  FT_STRUCTURE
 
569
 #define FT_STRUCTURE  FT_BBox
 
570
Index: src/type42/t42objs.c
 
571
===================================================================
 
572
RCS file: /cvs/freetype/freetype2/src/type42/t42objs.c,v
 
573
retrieving revision 1.13
 
574
retrieving revision 1.14
 
575
diff -u -r1.13 -r1.14
 
576
--- freetype2~/src/type42/t42objs.c     2003/04/25 05:35:04     1.13
 
577
+++ freetype2/src/type42/t42objs.c      2003/05/30 09:12:50     1.14
 
578
@@ -149,10 +149,12 @@
 
579
                  FT_Int         num_params,
 
580
                  FT_Parameter*  params )
 
581
   {
 
582
-    FT_Error          error;
 
583
-    PSNames_Service   psnames;
 
584
-    PSAux_Service     psaux;
 
585
-    FT_Face           root    = (FT_Face)&face->root;
 
586
+    FT_Error         error;
 
587
+    PSNames_Service  psnames;
 
588
+    PSAux_Service    psaux;
 
589
+    FT_Face          root  = (FT_Face)&face->root;
 
590
+    T1_Font          type1 = &face->type1;
 
591
+    PS_FontInfo      info  = &type1->font_info;
 
592
 
 
593
     FT_UNUSED( num_params );
 
594
     FT_UNUSED( params );
 
595
@@ -193,7 +195,7 @@
 
596
     /* Init the face object fields */
 
597
     /* Now set up root face fields */
 
598
 
 
599
-    root->num_glyphs   = face->type1.num_glyphs;
 
600
+    root->num_glyphs   = type1->num_glyphs;
 
601
     root->num_charmaps = 0;
 
602
     root->face_index   = face_index;
 
603
 
 
604
@@ -201,17 +203,17 @@
 
605
     root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
 
606
     root->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
 
607
 
 
608
-    if ( face->type1.font_info.is_fixed_pitch )
 
609
+    if ( info->is_fixed_pitch && *info->is_fixed_pitch )
 
610
       root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
 
611
 
 
612
     /* XXX: TODO -- add kerning with .afm support */
 
613
 
 
614
     /* get style name -- be careful, some broken fonts only */
 
615
     /* have a `/FontName' dictionary entry!                 */
 
616
-    root->family_name = face->type1.font_info.family_name;
 
617
+    root->family_name = info->family_name;
 
618
     if ( root->family_name )
 
619
     {
 
620
-      char*  full   = face->type1.font_info.full_name;
 
621
+      char*  full   = info->full_name;
 
622
       char*  family = root->family_name;
 
623
 
 
624
 
 
625
@@ -234,9 +236,9 @@
 
626
     else
 
627
     {
 
628
       /* do we have a `/FontName'? */
 
629
-      if ( face->type1.font_name )
 
630
+      if ( type1->font_name )
 
631
       {
 
632
-        root->family_name = face->type1.font_name;
 
633
+        root->family_name = type1->font_name;
 
634
         root->style_name  = (char *)"Regular";
 
635
       }
 
636
     }
 
637
@@ -268,15 +270,17 @@
 
638
     root->max_advance_width  = face->ttf_face->max_advance_width;
 
639
     root->max_advance_height = face->ttf_face->max_advance_height;
 
640
 
 
641
-    root->underline_position  = face->type1.font_info.underline_position;
 
642
-    root->underline_thickness = face->type1.font_info.underline_thickness;
 
643
+    if ( info->underline_position )
 
644
+      root->underline_position  = *info->underline_position >> 16;
 
645
+    if ( info->underline_thickness )
 
646
+      root->underline_thickness = *info->underline_thickness >> 16;
 
647
 
 
648
     root->internal->max_points   = 0;
 
649
     root->internal->max_contours = 0;
 
650
 
 
651
     /* compute style flags */
 
652
     root->style_flags = 0;
 
653
-    if ( face->type1.font_info.italic_angle )
 
654
+    if ( info->italic_angle && *info->italic_angle )
 
655
       root->style_flags |= FT_STYLE_FLAG_ITALIC;
 
656
 
 
657
     if ( face->ttf_face->style_flags & FT_STYLE_FLAG_BOLD )
 
658
@@ -306,7 +310,7 @@
 
659
         charmap.platform_id = 7;
 
660
         clazz               = NULL;
 
661
 
 
662
-        switch ( face->type1.encoding_type )
 
663
+        switch ( type1->encoding_type )
 
664
         {
 
665
         case T1_ENCODING_TYPE_STANDARD:
 
666
           charmap.encoding    = FT_ENCODING_ADOBE_STANDARD;
 
667
@@ -376,6 +380,11 @@
 
668
       FT_FREE( info->family_name );
 
669
       FT_FREE( info->weight );
 
670
 
 
671
+      FT_FREE( info->italic_angle );
 
672
+      FT_FREE( info->underline_position );
 
673
+      FT_FREE( info->underline_thickness );
 
674
+      FT_FREE( info->is_fixed_pitch );
 
675
+
 
676
       /* release top dictionary */
 
677
       FT_FREE( type1->charstrings_len );
 
678
       FT_FREE( type1->charstrings );
 
679
@@ -387,6 +396,9 @@
 
680
       FT_FREE( type1->encoding.char_index );
 
681
       FT_FREE( type1->encoding.char_name );
 
682
       FT_FREE( type1->font_name );
 
683
+
 
684
+      FT_FREE( type1->paint_type );
 
685
+      FT_FREE( type1->stroke_width );
 
686
 
 
687
       FT_FREE( face->ttf_data );
 
688
 
 
689
Index: src/type42/t42parse.c
 
690
===================================================================
 
691
RCS file: /cvs/freetype/freetype2/src/type42/t42parse.c,v
 
692
retrieving revision 1.6
 
693
retrieving revision 1.7
 
694
diff -u -r1.6 -r1.7
 
695
--- freetype2~/src/type42/t42parse.c    2002/07/28 05:05:24     1.6
 
696
+++ freetype2/src/type42/t42parse.c     2003/05/30 09:12:50     1.7
 
697
@@ -4,7 +4,7 @@
 
698
 /*                                                                         */
 
699
 /*    Type 42 font parser (body).                                          */
 
700
 /*                                                                         */
 
701
-/*  Copyright 2002 by Roberto Alameda.                                     */
 
702
+/*  Copyright 2002, 2003 by Roberto Alameda.                               */
 
703
 /*                                                                         */
 
704
 /*  This file is part of the FreeType project, and may only be used,       */
 
705
 /*  modified, and distributed under the terms of the FreeType project      */
 
706
@@ -65,24 +65,24 @@
 
707
 #undef  T1CODE
 
708
 #define T1CODE        T1_FIELD_LOCATION_FONT_INFO
 
709
 
 
710
-    T1_FIELD_STRING   ( "version",            version )
 
711
-    T1_FIELD_STRING   ( "Notice",             notice )
 
712
-    T1_FIELD_STRING   ( "FullName",           full_name )
 
713
-    T1_FIELD_STRING   ( "FamilyName",         family_name )
 
714
-    T1_FIELD_STRING   ( "Weight",             weight )
 
715
-    T1_FIELD_NUM      ( "ItalicAngle",        italic_angle )
 
716
-    T1_FIELD_TYPE_BOOL( "isFixedPitch",       is_fixed_pitch )
 
717
-    T1_FIELD_NUM      ( "UnderlinePosition",  underline_position )
 
718
-    T1_FIELD_NUM      ( "UnderlineThickness", underline_thickness )
 
719
+    T1_FIELD_STRING     ( "version",            version )
 
720
+    T1_FIELD_STRING     ( "Notice",             notice )
 
721
+    T1_FIELD_STRING     ( "FullName",           full_name )
 
722
+    T1_FIELD_STRING     ( "FamilyName",         family_name )
 
723
+    T1_FIELD_STRING     ( "Weight",             weight )
 
724
+    T1_FIELD_FIXED_P    ( "ItalicAngle",        italic_angle )
 
725
+    T1_FIELD_TYPE_BOOL_P( "isFixedPitch",       is_fixed_pitch )
 
726
+    T1_FIELD_FIXED_P    ( "UnderlinePosition",  underline_position )
 
727
+    T1_FIELD_FIXED_P    ( "UnderlineThickness", underline_thickness )
 
728
 
 
729
 #undef  FT_STRUCTURE
 
730
 #define FT_STRUCTURE  T1_FontRec
 
731
 #undef  T1CODE
 
732
 #define T1CODE        T1_FIELD_LOCATION_FONT_DICT
 
733
 
 
734
-    T1_FIELD_NUM( "PaintType",   paint_type )
 
735
-    T1_FIELD_NUM( "FontType",    font_type )
 
736
-    T1_FIELD_NUM( "StrokeWidth", stroke_width )
 
737
+    T1_FIELD_NUM_P  ( "PaintType",   paint_type )
 
738
+    T1_FIELD_NUM    ( "FontType",    font_type )
 
739
+    T1_FIELD_FIXED_P( "StrokeWidth", stroke_width )
 
740
 
 
741
     T1_FIELD_CALLBACK( "FontName",    t42_parse_font_name )
 
742
     T1_FIELD_CALLBACK( "FontBBox",    t42_parse_font_bbox )