Commit 40bb0964f2885a2cf5dcc4881448c4089761b577

Werner Lemberg 2003-11-01T14:36:20

* src/base/fttype1.c (FT_Get_PS_Font_Info, FT_Has_PS_Glyph_Names): Fix parameter order in calls to FT_FACE_FIND_SERVICE. * include/freetype/internal/ftserv.h (FT_SERVICE_POSTSCRIPT_NAMES_H): Removed. Unused. * src/type42/t42drivr.c (t42_services): Updated.

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
diff --git a/ChangeLog b/ChangeLog
index f142676..5c8f451 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,27 +1,82 @@
+2003-10-31  Detlef Würkner  <TetiSoft@apg.lahn.de>
+
+	* src/base/fttype1.c (FT_Get_PS_Font_Info, FT_Has_PS_Glyph_Names):
+	Fix parameter order in calls to FT_FACE_FIND_SERVICE.
+
+2003-10-31  Werner Lemberg  <wl@gnu.org>
+
+	* include/freetype/internal/ftserv.h
+	(FT_SERVICE_POSTSCRIPT_NAMES_H): Removed.  Unused.
+
+	* src/type42/t42drivr.c (t42_services): Updated.
+
 2003-10-29  David Turner  <david@freetype.org>
 
-        * include/freetype/internal/bdftypes.h: removed obsolete header
+	* include/freetype/internal/bdftypes.h: Removed.  Obsolete.
+	* src/base/ftbdf.c: Updated.
+
+	* include/freetype/internal/cfftypes.h: Moved to...
+	* src/cff/cfftypes.h: This place since no other module needs to
+	know about those types.
+
+	* include/freetype/internal/t42types.h: Moved to...
+	* src/type42/t42types.h: This place since no other module needs to
+	know about those types.
+
+	* include/freetype/internal/services/svbdf.h: Include FT_BDF_H.
+
+	* include/freetype/internal/services/svpsname.h: Renamed to...
+	* include/freetype/internal/services/svpscmap.h: This.
+	Updated `FT_Service_PsNames' -> `FT_Service_PsCMaps' and
+	`POSTSCRIPT_NAMES' -> `POSTSCRIPT_CMAPS' everywhere.
 
-        * include/freetype/internal/cfftypes.h, src/cff/cfftypes.h,
-        src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h,
-        include/freetype/internal/services/svbdf.h: moving "cfftypes.h" from
-        'include/freetype/internal' to 'src/cff' since no other modules needs
-        to known about these types
+	* include/freetype/internal/services/svpsinfo.h: New file, providing
+	PostScript info service.
 
-        * include/freetype/internal/t42types.h,
-        include/freetype/internal/internal.h, src/type42/t42objs.h,
-        src/type42/t42drivr.c, src/type42/t42types.h: moving "t42types.h" from
-        'include/freetype/internal' to 'src/type42' since no other modules needs
-        to known about these types
+	* include/freetype/internal/ftserv.h (FT_SERVICE_POSTSCRIPT_CMAPS_H,
+	FT_SERVICE_POSTSCRIPT_INFO_H): New macros for svpscmap.h and
+	svpsinfo.h.
+	* include/freetype/internal/internal.h (FT_INTERNAL_TYPE42_TYPES_H,
+	FT_INTERNAL_CFF_TYPES_H, FT_INTERNAL_BDF_TYPES_H): Removed.
 
-        * src/gzip/infblock.c: removing compiler warning
+	* src/base/fttype1.c: Don't include FT_INTERNAL_TYPE1_TYPES_H and
+	FT_INTERNAL_TYPE42_TYPES_H but FT_INTERNAL_SERVICE_H and
+	FT_SERVICE_POSTSCRIPT_INFO_H.
+	(FT_Get_PS_Font_Info, FT_Has_PS_Glyph_Names): Use new
+	POSTSCRIPT_INFO service.
+
+	* src/cff/cffdrivr.c: Include FT_SERVICE_POSTSCRIPT_INFO_H.
+	(cff_ps_has_glyph_names): New function.
+	(cff_service_ps_info): New service.
+	(cff_services): Updated.
+
+	* src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h: Don't
+	include FT_INTERNAL_CFF_TYPES_H but cfftypes.h directly.
+
+	* src/cif/cidriver.c: Include FT_SERVICE_POSTSCRIPT_INFO_H.
+	(cid_ps_get_font_info): New function.
+	(cid_service_ps_info): New service.
+	(cid_services): Updated.
+
+	* src/type1/t1driver.c: Include FT_SERVICE_POSTSCRIPT_INFO_H.
+	(t1_ps_get_font_info, t1_ps_has_glyph_names): New functions.
+	(t1_service_ps_info): New service.
+	(t1_services): Updated.
+
+	* src/type42/t42drivr.c: Include FT_SERVICE_POSTSCRIPT_INFO_H.
+	(t42_ps_get_font_info, t42_ps_has_glyph_names): New functions.
+	(t42_service_ps_info): New service.
+
+	* src/type42/t42objs.h: Don't include FT_INTERNAL_TYPE42_TYPES_H
+	but t42types.h directly.
+
+	* src/psnames/psmodule.c (psnames_interface, psnames_services):
+	Renamed to...
+	(pscmaps_interface, pscmaps_services): This.
+	Updated all users.
 
-        * include/freetype/internal/services/svpsinfo.h,
-        include/freetype/internal/ftserv.h, src/cff/cffdrivr.c,
-        src/cid/ciddrivr.c, src/type1/t1driver.c, src/type42/t42drivr.c,
-        src/base/fttype1.c: migrating to FT_SERVICE_ID_POSTSCRIPT_INFO defined
-        in "svpsinfo.h", removing some sad hacks.
 
+	* src/gzip/infblock.c (inflate_blocks): Remove compiler warning.
 
 2003-10-22  Werner Lemberg  <wl@gnu.org>
 
diff --git a/include/freetype/internal/ftserv.h b/include/freetype/internal/ftserv.h
index e0596ad..d77e1d5 100644
--- a/include/freetype/internal/ftserv.h
+++ b/include/freetype/internal/ftserv.h
@@ -240,7 +240,6 @@ FT_BEGIN_HEADER
 
 #define FT_SERVICE_MULTIPLE_MASTERS_H  <freetype/internal/services/svmm.h>
 #define FT_SERVICE_POSTSCRIPT_NAME_H   <freetype/internal/services/svpostnm.h>
-#define FT_SERVICE_POSTSCRIPT_NAMES_H  <freetype/internal/services/svpsname.h>
 #define FT_SERVICE_POSTSCRIPT_CMAPS_H  <freetype/internal/services/svpscmap.h>
 #define FT_SERVICE_POSTSCRIPT_INFO_H   <freetype/internal/services/svpsinfo.h>
 #define FT_SERVICE_GLYPH_DICT_H        <freetype/internal/services/svgldict.h>
diff --git a/include/freetype/internal/services/svpscmap.h b/include/freetype/internal/services/svpscmap.h
index 374503b..ade96ef 100644
--- a/include/freetype/internal/services/svpscmap.h
+++ b/include/freetype/internal/services/svpscmap.h
@@ -2,7 +2,7 @@
 /*                                                                         */
 /*  svpscmap.h                                                             */
 /*                                                                         */
-/*    The FreeType PostScript charmap service (specification)              */
+/*    The FreeType PostScript charmap service (specification).             */
 /*                                                                         */
 /*  Copyright 2003 by                                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
@@ -33,7 +33,7 @@ FT_BEGIN_HEADER
   (*PS_Unicode_ValueFunc)( const char*  glyph_name );
 
   /*
-   *  Unicode value to Adobe glyph name index. 0xFFFF if not found
+   *  Unicode value to Adobe glyph name index.  0xFFFF if not found.
    */
   typedef FT_UInt
   (*PS_Unicode_Index_Func)( FT_UInt       num_glyphs,
@@ -41,13 +41,13 @@ FT_BEGIN_HEADER
                             FT_ULong      unicode );
 
   /*
-   *  Macintosh name id to glyph name, NULL if invalid index
+   *  Macintosh name id to glyph name.  NULL if invalid index.
    */
   typedef const char*
   (*PS_Macintosh_Name_Func)( FT_UInt  name_index );
 
   /*
-   *  Adobe standard string id to glyph name, NULL if invalid index
+   *  Adobe standard string ID to glyph name.  NULL if invalid index.
    */
   typedef const char*
   (*PS_Adobe_Std_Strings_Func)( FT_UInt  string_index );
@@ -101,10 +101,13 @@ FT_BEGIN_HEADER
     const unsigned short*      adobe_expert_encoding;
   };
 
- /* */
+  /* */
 
 
 FT_END_HEADER
 
 
-#endif /* __SVPSNAME_H__ */
+#endif /* __SVPSCMAP_H__ */
+
+
+/* END */
diff --git a/include/freetype/internal/services/svpsinfo.h b/include/freetype/internal/services/svpsinfo.h
index 5bf7c49..73c02cd 100644
--- a/include/freetype/internal/services/svpsinfo.h
+++ b/include/freetype/internal/services/svpsinfo.h
@@ -1,30 +1,55 @@
-#ifndef __SVPSINFO_H__
-#define __SVPSINFO_H__
-
-#include FT_INTERNAL_SERVICE_H
-#include FT_INTERNAL_TYPE1_TYPES_H
-
-FT_BEGIN_HEADER
-
-
-#define FT_SERVICE_ID_POSTSCRIPT_INFO  "postscript-info"
-
-  typedef FT_Error  (*PS_GetFontInfoFunc)( FT_Face          face,
-                                           PS_FontInfoRec*  afont_info );
-
-  typedef FT_Int    (*PS_HasGlyphNamesFunc)( FT_Face   face );
-
-  FT_DEFINE_SERVICE( PsInfo )
-  {
-    PS_GetFontInfoFunc    ps_get_font_info;
-    PS_HasGlyphNamesFunc  ps_has_glyph_names;
-  };
-
-  /* */
-
-
-FT_END_HEADER
-
-
-
-#endif /* __SVPSINFO_H__ */
+/***************************************************************************/
+/*                                                                         */
+/*  svpsinfo.h                                                             */
+/*                                                                         */
+/*    The FreeType PostScript info service (specification).                */
+/*                                                                         */
+/*  Copyright 2003 by                                                      */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __SVPSINFO_H__
+#define __SVPSINFO_H__
+
+#include FT_INTERNAL_SERVICE_H
+#include FT_INTERNAL_TYPE1_TYPES_H
+
+
+FT_BEGIN_HEADER
+
+
+#define FT_SERVICE_ID_POSTSCRIPT_INFO  "postscript-info"
+
+
+  typedef FT_Error
+  (*PS_GetFontInfoFunc)( FT_Face          face,
+                         PS_FontInfoRec*  afont_info );
+
+  typedef FT_Int
+  (*PS_HasGlyphNamesFunc)( FT_Face   face );
+
+
+  FT_DEFINE_SERVICE( PsInfo )
+  {
+    PS_GetFontInfoFunc    ps_get_font_info;
+    PS_HasGlyphNamesFunc  ps_has_glyph_names;
+  };
+
+  /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __SVPSINFO_H__ */
+
+
+/* END */
diff --git a/include/freetype/internal/services/svsfnt.h b/include/freetype/internal/services/svsfnt.h
index 2bfd14c..e24de78 100644
--- a/include/freetype/internal/services/svsfnt.h
+++ b/include/freetype/internal/services/svsfnt.h
@@ -53,8 +53,8 @@ FT_BEGIN_HEADER
  
   FT_DEFINE_SERVICE( SFNT_Table )
   {
-    FT_SFNT_TableLoadFunc    load_table;
-    FT_SFNT_TableGetFunc     get_table;
+    FT_SFNT_TableLoadFunc  load_table;
+    FT_SFNT_TableGetFunc   get_table;
   };
 
   /* */
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 0e12c9b..67e491b 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -2480,8 +2480,8 @@
   FT_Get_Sfnt_Table( FT_Face      face,
                      FT_Sfnt_Tag  tag )
   {
-    void*                   table = 0;
-    FT_Service_SFNT_Table   service;
+    void*                  table = 0;
+    FT_Service_SFNT_Table  service;
 
 
     if ( face && FT_IS_SFNT( face ) )
diff --git a/src/base/fttype1.c b/src/base/fttype1.c
index 7b45139..313f627 100644
--- a/src/base/fttype1.c
+++ b/src/base/fttype1.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType utility file for PS names support (body).                   */
 /*                                                                         */
-/*  Copyright 2002 by                                                      */
+/*  Copyright 2002, 2003 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -30,15 +30,18 @@
   {
     FT_Error  error = FT_Err_Invalid_Argument;
 
+
     if ( face )
     {
-      FT_Service_PsInfo   service = NULL;
+      FT_Service_PsInfo  service = NULL;
+
 
-      FT_FACE_FIND_SERVICE( service, face, POSTSCRIPT_INFO );
+      FT_FACE_FIND_SERVICE( face, face, POSTSCRIPT_INFO );
 
       if ( service && service->ps_get_font_info )
         error = service->ps_get_font_info( face, afont_info );
     }
+
     return error;
   }
 
@@ -51,13 +54,15 @@
     FT_Int             result  = 0;
     FT_Service_PsInfo  service = NULL;
 
+
     if ( face )
     {
-      FT_FACE_FIND_SERVICE( service, face, POSTSCRIPT_INFO );
+      FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );
 
       if ( service && service->ps_has_glyph_names )
         result = service->ps_has_glyph_names( face );
     }
+
     return result;
   }
 
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index 6099fdf..9916485 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -315,6 +315,7 @@
     (FT_GlyphDict_NameIndexFunc)cff_get_name_index,
   };
 
+
  /*
   *  POSTSCRIPT INFO SERVICE
   *
@@ -327,14 +328,14 @@
     return 1;
   }
 
+
   static const FT_Service_PsInfoRec  cff_service_ps_info =
   {
-    (PS_GetFontInfoFunc)    NULL,  /* unsupported with CFF fonts */
-    (PS_HasGlyphNamesFunc)  cff_ps_has_glyph_names
+    (PS_GetFontInfoFunc)  NULL,         /* unsupported with CFF fonts */
+    (PS_HasGlyphNamesFunc)cff_ps_has_glyph_names
   };
 
 
-
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
@@ -362,14 +363,15 @@
   cff_get_interface( CFF_Driver   driver,
                      const char*  module_interface )
   {
-    FT_Module  sfnt;
+    FT_Module            sfnt;
     FT_Module_Interface  result;
 
+
     result = ft_service_list_lookup( cff_services, module_interface );
     if ( result != NULL )
       return  result;
 
-    /* we simply pass our request to the `sfnt' module */
+    /* we pass our request to the `sfnt' module */
     sfnt = FT_Get_Module( driver->root.root.library, "sfnt" );
 
     return sfnt ? sfnt->clazz->get_interface( sfnt, module_interface ) : 0;
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 7da9582..90c34db 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -324,7 +324,7 @@
         /* FreeType 2                                                */
       }
 
-     /* now, load the CFF part of the file */
+      /* now, load the CFF part of the file */
       error = face->goto_table( face, TTAG_CFF, stream, 0 );
       if ( error )
         goto Exit;
diff --git a/src/cid/cidriver.c b/src/cid/cidriver.c
index 2f3908a..f5639b9 100644
--- a/src/cid/cidriver.c
+++ b/src/cid/cidriver.c
@@ -75,10 +75,11 @@
     return 0;
   }
 
+
   static const FT_Service_PsInfoRec  cid_service_ps_info =
   {
-    (PS_GetFontInfoFunc)    cid_ps_get_font_info,
-    (PS_HasGlyphNamesFunc)  NULL  /* unsupported with CID fonts */
+    (PS_GetFontInfoFunc)  cid_ps_get_font_info,
+    (PS_HasGlyphNamesFunc)NULL          /* unsupported with CID fonts */
   };
 
 
diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c
index df092a3..784da99 100644
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -241,7 +241,7 @@
     return result;
   }
 
-  static const FT_Service_PsFontNameRec   sfnt_service_ps_name =
+  static const FT_Service_PsFontNameRec  sfnt_service_ps_name =
   {
     (FT_PsName_GetFunc)sfnt_get_ps_name
   };
@@ -255,9 +255,9 @@
 
   static const FT_ServiceDescRec  sfnt_services[] =
   {
-    { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, & sfnt_service_ps_name },
+    { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name },
 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
-    { FT_SERVICE_ID_GLYPH_DICT,           & sfnt_service_glyph_dict },
+    { FT_SERVICE_ID_GLYPH_DICT,           &sfnt_service_glyph_dict },
 #endif
 
     { NULL, NULL }
diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c
index 5aafca3..49b5d98 100644
--- a/src/type1/t1driver.c
+++ b/src/type1/t1driver.c
@@ -149,6 +149,7 @@
     return 0;
   }
 
+
   static FT_Int
   t1_ps_has_glyph_names( FT_Face  face )
   {
@@ -156,12 +157,14 @@
     return 1;
   }
 
+
   static const FT_Service_PsInfoRec  t1_service_ps_info =
   {
-    (PS_GetFontInfoFunc)    t1_ps_get_font_info,
-    (PS_HasGlyphNamesFunc)  t1_ps_has_glyph_names
+    (PS_GetFontInfoFunc)  t1_ps_get_font_info,
+    (PS_HasGlyphNamesFunc)t1_ps_has_glyph_names
   };
 
+
  /*
   *  SERVICE LIST
   *
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index 6a4f988..d7942e2 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -275,11 +275,11 @@
                 FT_Int         num_params,
                 FT_Parameter*  params )
   {
-    FT_Error         error;
+    FT_Error            error;
     FT_Service_PsCMaps  psnames;
-    PSAux_Service    psaux;
-    T1_Font          type1 = &face->type1;
-    PS_FontInfo      info = &type1->font_info;
+    PSAux_Service       psaux;
+    T1_Font             type1 = &face->type1;
+    PS_FontInfo         info = &type1->font_info;
 
     FT_UNUSED( num_params );
     FT_UNUSED( params );
diff --git a/src/type42/t42drivr.c b/src/type42/t42drivr.c
index deb7f28..8af1621 100644
--- a/src/type42/t42drivr.c
+++ b/src/type42/t42drivr.c
@@ -129,6 +129,7 @@
 
 
  /*
+  *
   *  POSTSCRIPT INFO SERVICE
   *
   */
@@ -141,6 +142,7 @@
     return 0;
   }
 
+
   static FT_Int
   t42_ps_has_glyph_names( FT_Face  face )
   {
@@ -148,10 +150,11 @@
     return 1;
   }
 
+
   static const FT_Service_PsInfoRec  t42_service_ps_info =
   {
-    (PS_GetFontInfoFunc)    t42_ps_get_font_info,
-    (PS_HasGlyphNamesFunc)  t42_ps_has_glyph_names
+    (PS_GetFontInfoFunc)  t42_ps_get_font_info,
+    (PS_HasGlyphNamesFunc)t42_ps_has_glyph_names
   };
 
 
@@ -165,6 +168,7 @@
   {
     { FT_SERVICE_ID_GLYPH_DICT,           &t42_service_glyph_dict },
     { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &t42_service_ps_font_name },
+    { FT_SERVICE_ID_POSTSCRIPT_INFO,      &t42_service_ps_info },
     { FT_SERVICE_ID_XF86_NAME,            FT_XF86_FORMAT_TYPE_42 },
     { NULL, NULL }
   };