Commit ab4fc4da58d0ac9ed662a5856034112af9647aaf

David Turner 2002-03-14T08:57:10

* include/freetype/internal/cfftypes.h, src/cff/*.c: updating the type definitions of the CFF font driver (i.e. CFF_Font => CFF_FontRec CFF_Font* => CFF_Font, etc...)

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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
diff --git a/ChangeLog b/ChangeLog
index 209deba..f5a3340 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,11 @@
         (i.e. FT_AutoHinter_Interface  => FT_AutoHinter_ServiceRec, 
               FT_AutoHinter_Interface* => FT_AutoHinter_Service, etc..)
 
+        * include/freetype/internal/cfftypes.h, src/cff/*.c: updating the
+        type definitions of the CFF font driver
+        
+        (i.e. CFF_Font  => CFF_FontRec
+              CFF_Font* => CFF_Font, etc...)
 
 
 2002-03-13  Antoine Leca    <antoine@oriolnet.com>
diff --git a/include/freetype/internal/cfftypes.h b/include/freetype/internal/cfftypes.h
index d2a1af2..f243ac6 100644
--- a/include/freetype/internal/cfftypes.h
+++ b/include/freetype/internal/cfftypes.h
@@ -74,7 +74,7 @@ FT_BEGIN_HEADER
   } CFF_EncodingRec, *CFF_Encoding;
 
 
-  typedef struct  CFF_Charset_
+  typedef struct  CFF_CharsetRec_
   {
 
     FT_UInt     format;
@@ -82,10 +82,10 @@ FT_BEGIN_HEADER
 
     FT_UShort*  sids;
 
-  } CFF_Charset;
+  } CFF_CharsetRec, *CFF_Charset;
 
 
-  typedef struct  CFF_Font_Dict_
+  typedef struct  CFF_FontRecDictRec_
   {
     FT_UInt    version;
     FT_UInt    notice;
@@ -129,7 +129,7 @@ FT_BEGIN_HEADER
     FT_ULong   cid_fd_select_offset;
     FT_UInt    cid_font_name;
 
-  } CFF_Font_Dict;
+  } CFF_FontRecDictRec, *CFF_FontRecDict;
 
 
   typedef struct  CFF_PrivateRec_
@@ -167,7 +167,7 @@ FT_BEGIN_HEADER
   } CFF_PrivateRec, *CFF_Private;
 
 
-  typedef struct  CFF_FD_Select_
+  typedef struct  CFF_FDSelectRec_
   {
     FT_Byte   format;
     FT_UInt   range_count;
@@ -181,67 +181,67 @@ FT_BEGIN_HEADER
     FT_UInt   cache_count;
     FT_Byte   cache_fd;
 
-  } CFF_FD_Select;
+  } CFF_FDSelectRec, *CFF_FDSelect;
 
 
   /* A SubFont packs a font dict and a private dict together. They are */
   /* needed to support CID-keyed CFF fonts.                            */
-  typedef struct  CFF_SubFont_
+  typedef struct  CFF_SubFontRec_
   {
-    CFF_Font_Dict  font_dict;
-    CFF_PrivateRec    private_dict;
+    CFF_FontRecDictRec  font_dict;
+    CFF_PrivateRec   private_dict;
 
-    CFF_IndexRec      local_subrs_index;
-    FT_UInt        num_local_subrs;
-    FT_Byte**      local_subrs;
+    CFF_IndexRec     local_subrs_index;
+    FT_UInt          num_local_subrs;
+    FT_Byte**        local_subrs;
 
-  } CFF_SubFont;
+  } CFF_SubFontRec, *CFF_SubFont;
 
 
   /* maximum number of sub-fonts in a CID-keyed file */
 #define CFF_MAX_CID_FONTS  16
 
 
-  typedef struct  CFF_Font_
+  typedef struct  CFF_FontRec_
   {
-    FT_Stream      stream;
-    FT_Memory      memory;
-    FT_UInt        num_faces;
-    FT_UInt        num_glyphs;
+    FT_Stream        stream;
+    FT_Memory        memory;
+    FT_UInt          num_faces;
+    FT_UInt          num_glyphs;
 
-    FT_Byte        version_major;
-    FT_Byte        version_minor;
-    FT_Byte        header_size;
-    FT_Byte        absolute_offsize;
+    FT_Byte          version_major;
+    FT_Byte          version_minor;
+    FT_Byte          header_size;
+    FT_Byte          absolute_offsize;
 
 
-    CFF_IndexRec      name_index;
-    CFF_IndexRec      top_dict_index;
-    CFF_IndexRec      string_index;
-    CFF_IndexRec      global_subrs_index;
+    CFF_IndexRec     name_index;
+    CFF_IndexRec     top_dict_index;
+    CFF_IndexRec     string_index;
+    CFF_IndexRec     global_subrs_index;
 
-    CFF_EncodingRec   encoding;
-    CFF_Charset    charset;
+    CFF_EncodingRec  encoding;
+    CFF_CharsetRec   charset;
 
-    CFF_IndexRec      charstrings_index;
-    CFF_IndexRec      font_dict_index;
-    CFF_IndexRec      private_index;
-    CFF_IndexRec      local_subrs_index;
+    CFF_IndexRec     charstrings_index;
+    CFF_IndexRec     font_dict_index;
+    CFF_IndexRec     private_index;
+    CFF_IndexRec     local_subrs_index;
 
-    FT_String*     font_name;
-    FT_UInt        num_global_subrs;
-    FT_Byte**      global_subrs;
+    FT_String*       font_name;
+    FT_UInt          num_global_subrs;
+    FT_Byte**        global_subrs;
 
-    CFF_SubFont    top_font;
-    FT_UInt        num_subfonts;
-    CFF_SubFont*   subfonts[CFF_MAX_CID_FONTS];
+    CFF_SubFontRec   top_font;
+    FT_UInt          num_subfonts;
+    CFF_SubFont      subfonts[CFF_MAX_CID_FONTS];
 
-    CFF_FD_Select  fd_select;
+    CFF_FDSelectRec  fd_select;
 
     /* interface to PostScript hinter */
-    void*          pshinter;
+    void*            pshinter;
 
-  } CFF_Font;
+  } CFF_FontRec, *CFF_Font;
 
 
 FT_END_HEADER
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index 9420bc1..04d2057 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -228,7 +228,7 @@
                       FT_Pointer  buffer,
                       FT_UInt     buffer_max )
   {
-    CFF_Font*           font   = (CFF_Font*)face->extra.data;
+    CFF_Font           font   = (CFF_Font)face->extra.data;
     FT_Memory           memory = FT_FACE_MEMORY( face );
     FT_String*          gname;
     FT_UShort           sid;
@@ -383,8 +383,8 @@
   cff_get_name_index( CFF_Face    face,
                       FT_String*  glyph_name )
   {
-    CFF_Font*        cff;
-    CFF_Charset*     charset;
+    CFF_Font        cff;
+    CFF_Charset     charset;
     PSNames_Service  psnames;
     FT_Memory        memory = FT_FACE_MEMORY( face );
     FT_String*       name;
@@ -393,7 +393,7 @@
     FT_Int           result;
 
 
-    cff     = (CFF_Font *)face->extra.data;
+    cff     = (CFF_FontRec *)face->extra.data;
     charset = &cff->charset;
 
     psnames = (PSNames_Service)FT_Get_Module_Interface(
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 7781e4f..a7cc386 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -352,7 +352,7 @@
                     CFF_GlyphSlot  slot,
                     FT_Bool        hinting )
   {
-    CFF_Font*  cff = (CFF_Font*)face->extra.data;
+    CFF_Font  cff = (CFF_Font)face->extra.data;
 
 
     /* clear everything */
@@ -373,8 +373,8 @@
   CFF_Prepare_Decoder( CFF_Decoder*  decoder,
                        FT_UInt       glyph_index )
   {
-    CFF_Font*     cff = (CFF_Font*)decoder->builder.face->extra.data;
-    CFF_SubFont*  sub = &cff->top_font;
+    CFF_Font     cff = (CFF_Font)decoder->builder.face->extra.data;
+    CFF_SubFont  sub = &cff->top_font;
 
 
     /* manage CID fonts */
@@ -532,7 +532,7 @@
 
 
   static FT_Int
-  cff_lookup_glyph_by_stdcharcode( CFF_Font*  cff,
+  cff_lookup_glyph_by_stdcharcode( CFF_Font  cff,
                                    FT_Int     charcode )
   {
     FT_UInt    n;
@@ -567,7 +567,7 @@
     FT_Int       bchar_index, achar_index, n_base_points;
     FT_Outline*  base = decoder->builder.base;
     TT_Face      face = decoder->builder.face;
-    CFF_Font*    cff  = (CFF_Font*)(face->extra.data);
+    CFF_Font    cff  = (CFF_Font)(face->extra.data);
     FT_Vector    left_bearing, advance;
     FT_Byte*     charstring;
     FT_ULong     charstring_len;
@@ -2115,7 +2115,7 @@
     FT_Error     error = 0;
     CFF_Decoder  decoder;
     FT_Int       glyph_index;
-    CFF_Font*    cff = (CFF_Font*)face->other;
+    CFF_Font    cff = (CFF_Font)face->other;
 
 
     *max_advance = 0;
@@ -2185,7 +2185,7 @@
     CFF_Decoder  decoder;
     TT_Face      face = (TT_Face)glyph->root.face;
     FT_Bool      hinting;
-    CFF_Font*    cff = (CFF_Font*)face->extra.data;
+    CFF_Font    cff = (CFF_Font)face->extra.data;
 
     FT_Matrix    font_matrix;
     FT_Vector    font_offset;
diff --git a/src/cff/cffgload.h b/src/cff/cffgload.h
index 7bf7dc8..7b22330 100644
--- a/src/cff/cffgload.h
+++ b/src/cff/cffgload.h
@@ -132,7 +132,7 @@ FT_BEGIN_HEADER
   typedef struct  CFF_Decoder_
   {
     CFF_Builder        builder;
-    CFF_Font*          cff;
+    CFF_Font          cff;
 
     FT_Fixed           stack[CFF_MAX_OPERANDS + 1];
     FT_Fixed*          top;
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index 006bb3d..c270ac0 100644
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -1357,7 +1357,7 @@
 
 
   static void
-  CFF_Done_FD_Select( CFF_FD_Select*  select,
+  CFF_Done_FD_Select( CFF_FDSelect  select,
                       FT_Stream       stream )
   {
     if ( select->data )
@@ -1370,7 +1370,7 @@
 
 
   static FT_Error
-  CFF_Load_FD_Select( CFF_FD_Select*  select,
+  CFF_Load_FD_Select( CFF_FDSelect  select,
                       FT_UInt         num_glyphs,
                       FT_Stream       stream,
                       FT_ULong        offset )
@@ -1414,7 +1414,7 @@
 
 
   FT_LOCAL_DEF( FT_Byte )
-  CFF_Get_FD( CFF_FD_Select*  select,
+  CFF_Get_FD( CFF_FDSelect  select,
               FT_UInt         glyph_index )
   {
     FT_Byte  fd = 0;
@@ -1500,7 +1500,7 @@
 
 
   static void
-  CFF_Done_Charset( CFF_Charset*  charset,
+  CFF_Done_Charset( CFF_Charset  charset,
                     FT_Stream     stream )
   {
     FT_Memory  memory = stream->memory;
@@ -1514,7 +1514,7 @@
 
 
   static FT_Error
-  CFF_Load_Charset( CFF_Charset*  charset,
+  CFF_Load_Charset( CFF_Charset  charset,
                     FT_UInt       num_glyphs,
                     FT_Stream     stream,
                     FT_ULong      base_offset,
@@ -1694,7 +1694,7 @@
 
   static FT_Error
   CFF_Load_Encoding( CFF_Encoding  encoding,
-                     CFF_Charset*   charset,
+                     CFF_Charset   charset,
                      FT_UInt        num_glyphs,
                      FT_Stream      stream,
                      FT_ULong       base_offset,
@@ -1957,7 +1957,7 @@
 
 
   static FT_Error
-  CFF_Load_SubFont( CFF_SubFont*  font,
+  CFF_Load_SubFont( CFF_SubFont  font,
                     CFF_Index     idx,
                     FT_UInt       font_index,
                     FT_Stream     stream,
@@ -1967,7 +1967,7 @@
     CFF_Parser      parser;
     FT_Byte*        dict;
     FT_ULong        dict_len;
-    CFF_Font_Dict*  top  = &font->font_dict;
+    CFF_FontRecDict  top  = &font->font_dict;
     CFF_Private    priv = &font->private_dict;
 
 
@@ -2046,7 +2046,7 @@
 
   static void
   CFF_Done_SubFont( FT_Memory     memory,
-                    CFF_SubFont*  subfont )
+                    CFF_SubFont  subfont )
   {
     if ( subfont )
     {
@@ -2059,12 +2059,12 @@
   FT_LOCAL_DEF( FT_Error )
   CFF_Load_Font( FT_Stream  stream,
                  FT_Int     face_index,
-                 CFF_Font*  font )
+                 CFF_Font  font )
   {
     static const FT_Frame_Field  cff_header_fields[] =
     {
 #undef  FT_STRUCTURE
-#define FT_STRUCTURE  CFF_Font
+#define FT_STRUCTURE  CFF_FontRec
 
       FT_FRAME_START( 4 ),
         FT_FRAME_BYTE( version_major ),
@@ -2077,7 +2077,7 @@
     FT_Error        error;
     FT_Memory       memory = stream->memory;
     FT_ULong        base_offset;
-    CFF_Font_Dict*  dict;
+    CFF_FontRecDict  dict;
 
 
     MEM_Set( font, 0, sizeof ( *font ) );
@@ -2138,7 +2138,7 @@
     if ( dict->cid_registry )
     {
       CFF_IndexRec  fd_index;
-      CFF_SubFont*  sub;
+      CFF_SubFont  sub;
       FT_UInt       idx;
 
 
@@ -2159,7 +2159,7 @@
 
       /* allocate & read each font dict independently */
       font->num_subfonts = fd_index.count;
-      if ( ALLOC_ARRAY( sub, fd_index.count, CFF_SubFont ) )
+      if ( ALLOC_ARRAY( sub, fd_index.count, CFF_SubFontRec ) )
         goto Fail_CID;
 
       /* setup pointer table */
@@ -2240,7 +2240,7 @@
 
 
   FT_LOCAL_DEF( void )
-  CFF_Done_Font( CFF_Font*  font )
+  CFF_Done_Font( CFF_Font  font )
   {
     FT_Memory  memory = font->memory;
     FT_UInt    idx;
diff --git a/src/cff/cffload.h b/src/cff/cffload.h
index 0522855..1a37c16 100644
--- a/src/cff/cffload.h
+++ b/src/cff/cffload.h
@@ -55,14 +55,14 @@ FT_BEGIN_HEADER
   FT_LOCAL( FT_Error )
   CFF_Load_Font( FT_Stream  stream,
                  FT_Int     face_index,
-                 CFF_Font*  font );
+                 CFF_Font  font );
 
   FT_LOCAL( void )
-  CFF_Done_Font( CFF_Font*  font );
+  CFF_Done_Font( CFF_Font  font );
 
 
   FT_LOCAL( FT_Byte )
-  CFF_Get_FD( CFF_FD_Select*  select,
+  CFF_Get_FD( CFF_FDSelect  select,
               FT_UInt         glyph_index );
 
 
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 258e339..5061396 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -60,7 +60,7 @@
   CFF_Size_Get_Globals_Funcs( CFF_Size  size )
   {
     CFF_Face          face     = (CFF_Face)size->face;
-    CFF_Font*         font     = (CFF_Font *)face->extra.data;
+    CFF_Font         font     = (CFF_FontRec *)face->extra.data;
     PSHinter_Service  pshinter = (PSHinter_Service)font->pshinter;
     FT_Module         module;
 
@@ -101,8 +101,8 @@
     {
       PSH_Globals    globals;
       CFF_Face       face    = (CFF_Face)size->face;
-      CFF_Font*      font    = (CFF_Font *)face->extra.data;
-      CFF_SubFont*   subfont = &font->top_font;
+      CFF_Font      font    = (CFF_FontRec *)face->extra.data;
+      CFF_SubFont   subfont = &font->top_font;
 
       CFF_Private   cpriv   = &subfont->private_dict;
       PS_PrivateRec  priv;
@@ -196,7 +196,7 @@
   CFF_GlyphSlot_Init( CFF_GlyphSlot  slot )
   {
     CFF_Face          face     = (CFF_Face)slot->root.face;
-    CFF_Font*         font     = (CFF_Font *)face->extra.data;
+    CFF_Font         font     = (CFF_FontRec *)face->extra.data;
     PSHinter_Service  pshinter = (PSHinter_Service)font->pshinter;
 
 
@@ -257,12 +257,12 @@
                              FT_ULong            base_offset,
                              PSNames_Service  psnames )
   {
-    CFF_Font*       font = (CFF_Font*)face->extra.data;
+    CFF_Font       font = (CFF_Font)face->extra.data;
     FT_Memory       memory = FT_FACE_MEMORY(face);
     FT_UInt         n, num_glyphs = face->root.num_glyphs;
     const char**    glyph_names;
     FT_Error        error;
-    CFF_Font_Dict*  dict = &font->top_font.font_dict;
+    CFF_FontRecDict  dict = &font->top_font.font_dict;
     FT_ULong        charset_offset;
     FT_Byte         format;
     FT_Stream       stream = face->root.stream;
@@ -527,7 +527,7 @@
 
     /* now load and parse the CFF table in the file */
     {
-      CFF_Font*  cff;
+      CFF_Font  cff;
       FT_Memory  memory = face->root.memory;
       FT_Face    root;
       FT_UInt    flags;
@@ -551,7 +551,7 @@
 
       if ( pure_cff )
       {
-        CFF_Font_Dict*  dict = &cff->top_font.font_dict;
+        CFF_FontRecDict  dict = &cff->top_font.font_dict;
 
 
         /* we need the `PSNames' module for pure-CFF and CEF formats */
@@ -716,7 +716,7 @@
       sfnt->done_face( face );
 
     {
-      CFF_Font*  cff = (CFF_Font*)face->extra.data;
+      CFF_Font  cff = (CFF_Font)face->extra.data;
 
 
       if ( cff )
diff --git a/src/cff/cffparse.c b/src/cff/cffparse.c
index 43742fe..515c396 100644
--- a/src/cff/cffparse.c
+++ b/src/cff/cffparse.c
@@ -313,7 +313,7 @@
   static FT_Error
   cff_parse_font_matrix( CFF_Parser*  parser )
   {
-    CFF_Font_Dict*  dict   = (CFF_Font_Dict*)parser->object;
+    CFF_FontRecDict  dict   = (CFF_FontRecDict)parser->object;
     FT_Matrix*      matrix = &dict->font_matrix;
     FT_Vector*      offset = &dict->font_offset;
     FT_UShort*      upm    = &dict->units_per_em;
@@ -361,7 +361,7 @@
   static FT_Error
   cff_parse_font_bbox( CFF_Parser*  parser )
   {
-    CFF_Font_Dict*  dict = (CFF_Font_Dict*)parser->object;
+    CFF_FontRecDict  dict = (CFF_FontRecDict)parser->object;
     FT_BBox*        bbox = &dict->font_bbox;
     FT_Byte**       data = parser->stack;
     FT_Error        error;
@@ -385,7 +385,7 @@
   static FT_Error
   cff_parse_private_dict( CFF_Parser*  parser )
   {
-    CFF_Font_Dict*  dict = (CFF_Font_Dict*)parser->object;
+    CFF_FontRecDict  dict = (CFF_FontRecDict)parser->object;
     FT_Byte**       data = parser->stack;
     FT_Error        error;
 
@@ -406,7 +406,7 @@
   static FT_Error
   cff_parse_cid_ros( CFF_Parser*  parser )
   {
-    CFF_Font_Dict*  dict = (CFF_Font_Dict*)parser->object;
+    CFF_FontRecDict  dict = (CFF_FontRecDict)parser->object;
     FT_Byte**       data = parser->stack;
     FT_Error        error;
 
diff --git a/src/cff/cfftoken.h b/src/cff/cfftoken.h
index bfb2370..431ae12 100644
--- a/src/cff/cfftoken.h
+++ b/src/cff/cfftoken.h
@@ -17,7 +17,7 @@
 
 
 #undef  FT_STRUCTURE
-#define FT_STRUCTURE  CFF_Font_Dict
+#define FT_STRUCTURE  CFF_FontRecDictRec
 
 #undef  CFFCODE
 #define CFFCODE        CFFCODE_TOPDICT