Commit 5bbb4940087afe9e6cf6fff14133f7f5d6c59b2f

Werner Lemberg 2002-05-30T19:22:14

* src/bdf/descrip.mms, src/type42/descrip.mms: New files. * descrip.mms (all): Updated. * src/bdf/bdflib.c (_bdf_parse_glyphs): Fix typo which prevented compilation. * src/pshglob.c (psh_blues_scale_zones): Fix compiler warning.

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
diff --git a/ChangeLog b/ChangeLog
index 8007bf3..a8d635c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2002-05-29  Werner Lemberg  <wl@gnu.org>
+
+	* src/bdf/descrip.mms, src/type42/descrip.mms: New files.
+	* descrip.mms (all): Updated.
+
+	* src/bdf/bdflib.c (_bdf_parse_glyphs): Fix typo which prevented
+	compilation.
+	* src/pshglob.c (psh_blues_scale_zones): Fix compiler warning.
+
 2002-05-28  Detlef Würkner  <TetiSoft@apg.lahn.de>
 
 	* builds/amiga/makefile, builds/amiga/smakefile,
@@ -8,16 +17,16 @@
 
 2005-05-28  David Turner  <david@freetype.org>
 
-    * docs/CHANGES: updating file for upcoming release (2.1.1)
+	* docs/CHANGES: Updating file for next release (2.1.1).
 
-    * src/bdf/bdflib.c: removing compiler warnings
+	* src/bdf/bdflib.c: Removing compiler warnings.
 
 	* include/freetype/ftxf86.h, src/base/ftxf86.c: New files.
-	They provad a new API (FT_Get_X11_Font_Format) an X11-compatible
-	string describing the font format of a given face.  This was put in
-	a new optional base source file, corresponding to a new public
-	header (named FT_XFREE86_H since this function should only be used
-	within the XFree86 font server IMO).
+	They provide a new API (FT_Get_X11_Font_Format) to retrieve an
+	X11-compatible string describing the font format of a given face. 
+	This was put in a new optional base source file, corresponding to a
+	new public header (named FT_XFREE86_H since this function should
+	only be used within the XFree86 font server IMO).
 
 	* include/freetype/config/ftheader.h (FT_XFREE86_H): New macro (not
 	documented yet).
diff --git a/descrip.mms b/descrip.mms
index fe13890..0692443 100644
--- a/descrip.mms
+++ b/descrip.mms
@@ -36,6 +36,8 @@ all :
         $(MMS)$(MMSQUALIFIERS)
         set default [-.base]
         $(MMS)$(MMSQUALIFIERS)
+        set default [-.bdf]
+        $(MMS)$(MMSQUALIFIERS)
         set default [-.cache]
         $(MMS)$(MMSQUALIFIERS)
         set default [-.cff]
@@ -62,6 +64,8 @@ all :
         $(MMS)$(MMSQUALIFIERS)
         set default [-.type1]
         $(MMS)$(MMSQUALIFIERS)
+        set default [-.type42]
+        $(MMS)$(MMSQUALIFIERS)
         set default [-.winfonts]
         $(MMS)$(MMSQUALIFIERS)
         set default [--]
diff --git a/docs/CHANGES b/docs/CHANGES
index 9da962b..fc2de8c 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -2,52 +2,51 @@ LATEST CHANGES BETWEEN 2.1.1 and 2.1.0
 
   I. IMPORTANT BUG FIXES
 
-    - the 'version_info' returned by "freetype-config" in 2.1.0 returned an
-      invalid value. It now returns 9:1:3 (2.0.9 returned 9:0:3)
+    - The `version_info' returned by `freetype-config' in 2.1.0 returned an
+      invalid value. It now returns 9:1:3 (2.0.9 returned 9:0:3).
 
-    - 2.1.0 couldn't be linked against applications on Win32 and Amiga
-      systems, due to a new debug function that wasn't properly propagated
-      to the system-specific directory in 'builds'.
+    - Version 2.1.0 couldn't be linked against applications on Win32 and
+      Amiga systems due to a new debug function that wasn't properly
+      propagated to the system-specific directory in `builds'.
 
-    - various MacOS and Mac OS X specific fixes
+    - Various MacOS and Mac OS X specific fixes.
 
-    - fixed a bug in the TrueType charmap validation routines that made
-      2.1.0 over-restrictive over the fonts it could accept.
+    - Fixed a bug in the TrueType charmap validation routines that made
+      version 2.1.0 too restrictive -- many popular fonts have been
+      rejected.
 
-    - surprisingly, there was still a very small difference between the
-      monochrome glyph bitmaps produced by FT 1.x and FT 2.x with the
-      bytecode interpreter enabled. This was caused by an invalid flag
-      setting in the TrueType glyph loader that caused the rasterizer to
-      change its drop-out control mode. This is now fixed, and results
-      should _really_ be 100% identical
+    - There was still a very small difference between the monochrome glyph
+      bitmaps produced by FreeType 1.x and FreeType 2.x with the bytecode
+      interpreter enabled.  This was caused by an invalid flag setting in
+      the TrueType glyph loader, making the rasterizer change its drop-out
+      control mode.  Now theresults should _really_ be completely identical.
 
-    - the TrueType name table loader has been improved to support many
-      popular though buggy Asian fonts. It now ignores empty name entries,
-      invalid pointer offsets and a few other sad things. Moreover, name
-      strings are now loaded on demand, which reduces the memory load of
-      many faces (e.g. the ARIAL.TTF font file contains a 10Kb name table
-      containing 70 names)
+    - The TrueType name table loader has been improved to support many
+      popular though buggy Asian fonts.  It now ignores empty name entries,
+      invalid pointer offsets and a few other incorrect subtleties. 
+      Moreover, name strings are now loaded on demand, which reduces the
+      memory load of many faces (e.g. the ARIAL.TTF font file contains a
+      10kByte name table with 70 names).
 
-    - fixed a bug in the Postscript hinter that prevented family blues
+    - Fixed a bug in the Postscript hinter that prevented family blues
       substitution to happen correctly.
 
 
   II. NEW FEATURES
 
-    - Three new font drivers in this release !!
+    - Three new font drivers in this release:
 
-        * a BDF font driver, contributed by Franco Narda Zapelli, and
-          heavily modified by Werner Lemberg, it also supports anti-aliased
-          bitmaps
+      * A BDF font driver, contributed by Franco Narda Zapelli, heavily
+        modified by Werner Lemberg.  It also supports anti-aliased bitmaps
+        (using a slightly extended BDF format).
 
-        * a Type42 font driver, contributed by ..... This one is still
-          experimental but seems to work relatively well but lacks some
-          charmap support for now
-
-        * a PFR font driver, contributed by David Turner himself. It doesn't
-          support PFR hinting Beware that BitStream has at least two patents
-          on this format !!
+      * A Type42 font driver, contributed by Roberto Alameda.  It is
+        still experimental but seems to work relatively well.  Currently,
+        charmap support is not fully implemented.
 
+      * A PFR font driver, contributed by David Turner himself.  It doesn't
+        support PFR hinting -- note that BitStream has at least two patents
+        on this format!
 
 
 ========================================================================
diff --git a/include/freetype/ftxf86.h b/include/freetype/ftxf86.h
index 2f2f342..5a7582f 100644
--- a/include/freetype/ftxf86.h
+++ b/include/freetype/ftxf86.h
@@ -1,5 +1,23 @@
-#ifndef __FT_XFREE86_H__
-#define __FT_XFREE86_H__
+/***************************************************************************/
+/*                                                                         */
+/*  ftxf86.h                                                               */
+/*                                                                         */
+/*    Support functions for X11.                                           */
+/*                                                                         */
+/*  Copyright 2002 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 __FTXF86_H__
+#define __FTXF86_H__
 
 #include <ft2build.h>
 #include FT_FREETYPE_H
@@ -15,21 +33,21 @@ FT_BEGIN_HEADER
   /*    FT_Get_X11_Font_Format                                             */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Returns a string describing the format of a given face as a X11    */
-  /*    FONT_PROPERTY. It should only be used by FreeType 2 font backend   */
-  /*    of the XFree86 font server.                                        */
+  /*    Return a string describing the format of a given face as an X11    */
+  /*    FONT_PROPERTY.  It should only be used by the FreeType 2 font      */
+  /*    backend of the XFree86 font server.                                */
   /*                                                                       */
   /* <Input>                                                               */
-  /*    face :: input face handle.                                         */
+  /*    face :: Input face handle.                                         */
   /*                                                                       */
   /* <Return>                                                              */
-  /*    font format string. NULL in case of error.                         */
+  /*    Font format string.  NULL in case of error.                        */
   /*                                                                       */
   FT_EXPORT_DEF( const char* )
-  FT_Get_X11_Font_Format( FT_Face    face );
+  FT_Get_X11_Font_Format( FT_Face  face );
 
  /* */
 
 FT_END_HEADER
 
-#endif /* __FT_XFREE86_H__ */
+#endif /* __FTXF86_H__ */
diff --git a/src/base/fttype1.c b/src/base/fttype1.c
index 7445238..14176a8 100644
--- a/src/base/fttype1.c
+++ b/src/base/fttype1.c
@@ -1,34 +1,53 @@
+/***************************************************************************/
+/*                                                                         */
+/*  fttype1.c                                                              */
+/*                                                                         */
+/*    FreeType utility file for PS names support (body).                   */
+/*                                                                         */
+/*  Copyright 2002 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.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #include <ft2build.h>
 #include FT_INTERNAL_TYPE1_TYPES_H
 #include FT_INTERNAL_OBJECTS_H
 
- /* case a FT_Face to a T1_Face when relevant                           */
- /* this implementation sucks, but a lot of things should change in the */
- /* future anyway..                                                     */
- /*                                                                     */
+
+  /* Cast a FT_Face to a T1_Face if necessary.                           */
+  /* This implementation sucks, but a lot of things should change in the */
+  /* future anyway...                                                    */
+  /*                                                                     */
   static T1_Face
-  t1_face_check_cast( FT_Face   face )
+  t1_face_check_cast( FT_Face  face )
   {
     FT_Module  driver;
     T1_Face    result = NULL;
 
+
     if ( face && face->driver != NULL )
     {
-      driver = (FT_Module) face->driver;
+      driver = (FT_Module)face->driver;
 
       if ( driver->clazz && driver->clazz->module_name &&
            ft_strcmp( driver->clazz->module_name, "type1" ) == 0 )
       {
-        /* correct typecast ! */
-        result = (T1_Face) face;
+        /* correct typecast! */
+        result = (T1_Face)face;
       }
     }
     return result;
   }
 
 
-
- /* documentation is in t1tables.h */
+  /* documentation is in t1tables.h */
 
   FT_EXPORT_DEF( FT_Error )
   FT_Get_PS_Font_Info( FT_Face          face,
@@ -37,38 +56,45 @@
     FT_Error  error   = FT_Err_Invalid_Argument;
     T1_Face   t1_face = t1_face_check_cast( face );
 
+
     if ( t1_face != NULL )
     {
       *afont_info = t1_face->type1.font_info;
-      error = FT_Err_Ok;
+      error       = FT_Err_Ok;
     }
+
     return error;
   }
 
 
- /* XXX: bad hack, but I didn't want to change several drivers here */
+  /* XXX: Bad hack, but I didn't want to change several drivers here. */
 
- /* documentation is in t1tables.h */
+  /* documentation is in t1tables.h */
 
   FT_EXPORT_DEF( FT_Int )
-  FT_Has_PS_Glyph_Names( FT_Face   face )
+  FT_Has_PS_Glyph_Names( FT_Face  face )
   {
     FT_Int       result = 0;
     const char*  driver_name;
 
+
     if ( face && face->driver && face->driver->root.clazz )
     {
-      /* for now, only the type1 and cff drivers provide reliable */
-      /* glyph names...                                           */
+      /* Currently, only the type1 and cff drivers provide reliable */
+      /* glyph names...                                             */
 
-      /* we could probably hack the TrueType driver to recognize  */
-      /* certain cases where the glyph names  are most certainly  */
-      /* correct (e.g. using a 20 or 22 format 'post' table), but */
-      /* this will probably happen later... :-)                   */
+      /* We could probably hack the TrueType driver to recognize    */
+      /* certain cases where the glyph names are most certainly     */
+      /* correct (e.g. using a 20 or 22 format `post' table), but   */
+      /* this will probably happen later...                         */
 
       driver_name = face->driver->root.clazz->module_name;
       result      = ( ft_strcmp( driver_name, "type1" ) ||
                       ft_strcmp( driver_name, "cff"   ) );
     }
+
     return result;
   }
+
+
+/* END */
diff --git a/src/base/ftxf86.c b/src/base/ftxf86.c
index dd27c9a..6fd7722 100644
--- a/src/base/ftxf86.c
+++ b/src/base/ftxf86.c
@@ -1,12 +1,30 @@
+/***************************************************************************/
+/*                                                                         */
+/*  ftxf86.c                                                               */
+/*                                                                         */
+/*    FreeType utility file for X11 support (body).                        */
+/*                                                                         */
+/*  Copyright 2002 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.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #include <ft2build.h>
 #include FT_XFREE86_H
 #include FT_INTERNAL_OBJECTS_H
 
- /* XXX: this really is a sad hack, but I didn't want to change every     */
- /*      driver just to support this at the moment, since other important */
- /*      changes are coming anyway !!                                     */
+  /* XXX: This really is a sad hack, but I didn't want to change every     */
+  /*      driver just to support this at the moment, since other important */
+  /*      changes are coming anyway.                                       */
 
-  typedef struct
+  typedef struct  FT_FontFormatRec_
   {
     const char*  driver_name;
     const char*  format_name;
@@ -15,7 +33,7 @@
 
 
   FT_EXPORT_DEF( const char* )
-  FT_Get_X11_Font_Format( FT_Face    face )
+  FT_Get_X11_Font_Format( FT_Face  face )
   {
     static const FT_FontFormatRec  font_formats[] =
     {
@@ -35,11 +53,14 @@
 
     if ( face && face->driver )
     {
-      FT_Module  driver = (FT_Module) face->driver;
+      FT_Module  driver = (FT_Module)face->driver;
+
 
       if ( driver->clazz && driver->clazz->module_name )
       {
-        FT_Int  n, count = sizeof(font_formats)/sizeof(font_formats[0]);
+        FT_Int  n;
+        FT_Int  count = sizeof( font_formats ) / sizeof ( font_formats[0] );
+
 
         result = driver->clazz->module_name;
 
@@ -54,3 +75,6 @@
 
     return result;
   }
+
+
+/* END */
diff --git a/src/bdf/bdflib.c b/src/bdf/bdflib.c
index a9ee1db..b3c503f 100644
--- a/src/bdf/bdflib.c
+++ b/src/bdf/bdflib.c
@@ -1740,10 +1740,6 @@
         /* the scalable width from the device width.                      */
         FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG9, lineno ));
 
-        ps = (double)font->point_size;
-        rx = (double)font->resolution_x;
-        dw = (double)glyph->dwidth;
-
         glyph->swidth = (unsigned short)FT_MulDiv(
                           glyph->dwidth, 72000L,
                           (FT_Long)( font->point_size *
diff --git a/src/bdf/descrip.mms b/src/bdf/descrip.mms
new file mode 100644
index 0000000..4c32dc4
--- /dev/null
+++ b/src/bdf/descrip.mms
@@ -0,0 +1,23 @@
+#
+# FreeType 2 BDF driver compilation rules for VMS
+#
+
+
+# Copyright 2002 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.
+
+
+CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.include],[--.src.bdf])
+
+OBJS=bdf.obj
+
+all : $(OBJS)
+        library [--.lib]freetype.olb $(OBJS)
+
+# EOF
diff --git a/src/pshinter/pshglob.c b/src/pshinter/pshglob.c
index a8904ac..58c77b5 100644
--- a/src/pshinter/pshglob.c
+++ b/src/pshinter/pshglob.c
@@ -488,14 +488,14 @@
 
         for ( ; count2 > 0; count2--, zone2++ )
         {
-          FT_Pos   delta;
+          FT_Pos  Delta;
 
 
-          delta = zone1->org_ref - zone2->org_ref;
-          if ( delta < 0 )
-            delta = -delta;
+          Delta = zone1->org_ref - zone2->org_ref;
+          if ( Delta < 0 )
+            Delta = -Delta;
 
-          if ( FT_MulFix( delta, scale ) < 64 )
+          if ( FT_MulFix( Delta, scale ) < 64 )
           {
             zone1->cur_top    = zone2->cur_top;
             zone1->cur_bottom = zone2->cur_bottom;
diff --git a/src/type42/descrip.mms b/src/type42/descrip.mms
new file mode 100644
index 0000000..ec75d3b
--- /dev/null
+++ b/src/type42/descrip.mms
@@ -0,0 +1,23 @@
+#
+# FreeType 2 Type 42 driver compilation rules for VMS
+#
+
+
+# Copyright 2002 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.
+
+
+CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.include],[--.src.type42])
+
+OBJS=t42drivr.obj
+
+all : $(OBJS)
+        library [--.lib]freetype.olb $(OBJS)
+
+# EOF