Commit a1e45652bec43ea1ebb6c654ee1de404638b75a4

David Turner 2002-06-11T20:35:58

* builds/win32/ftdebug.c: added a missing #endif * src/sfnt/ttload.c, src/bdf/bdflib.c: removing compiler warnings * src/type42/t42objs.c: removed the bug that prevented un-hinted outlines to be loaded

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
diff --git a/ChangeLog b/ChangeLog
index a9015a4..d58bd41 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2002-06-11  David Turner  <david@freetype.org>
+
+        * builds/win32/ftdebug.c: added a missing #endif
+
+        * src/sfnt/ttload.c, src/bdf/bdflib.c: removing compiler warnings
+
+        * src/type42/t42objs.c: removed the bug that prevented un-hinted
+        outlines to be loaded
+
 2002-06-08  Juliusz Chroboczek  <jch@pps.jussieu.fr>
 
 	* include/freetype/internal/ftobjs.h, src/autohint/ahglyph.c,
diff --git a/builds/win32/visualc/freetype.dsp b/builds/win32/visualc/freetype.dsp
index 7ffd164..eeec185 100644
--- a/builds/win32/visualc/freetype.dsp
+++ b/builds/win32/visualc/freetype.dsp
@@ -45,7 +45,7 @@ RSC=rc.exe
 # PROP Intermediate_Dir "..\..\..\objs\release"
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /MD /Za /W4 /Gm- /GX /Zi /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c
+# ADD CPP /MD /Za /W4 /GX /Zi /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c
 # SUBTRACT CPP /nologo /YX
 # ADD BASE RSC /l 0x409 /d "NDEBUG"
 # ADD RSC /l 0x409 /d "NDEBUG"
@@ -54,7 +54,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype206.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype211.lib"
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Debug"
 
@@ -69,7 +69,7 @@ LIB32=link.exe -lib
 # PROP Intermediate_Dir "..\..\..\objs\debug"
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /MDd /Za /W4 /Gm- /GX /Zi /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /FD /GZ /c
+# ADD CPP /MDd /Za /W4 /GX /Zi /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /FD /GZ /c
 # SUBTRACT CPP /nologo /X /YX
 # ADD BASE RSC /l 0x409 /d "_DEBUG"
 # ADD RSC /l 0x409 /d "_DEBUG"
@@ -78,7 +78,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype206_D.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype211_D.lib"
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Debug Multithreaded"
 
@@ -94,7 +94,7 @@ LIB32=link.exe -lib
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /Za /W3 /Gm /GX /ZI /Od /I "..\freetype\include\\" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /GZ /c
 # SUBTRACT BASE CPP /X
-# ADD CPP /MTd /Za /W4 /Gm- /GX /Zi /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /FD /GZ /c
+# ADD CPP /MTd /Za /W4 /GX /Zi /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /FD /GZ /c
 # SUBTRACT CPP /nologo /X /YX
 # ADD BASE RSC /l 0x409 /d "_DEBUG"
 # ADD RSC /l 0x409 /d "_DEBUG"
@@ -103,7 +103,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo /out:"lib\freetype200b8_D.lib"
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype206MT_D.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype211MT_D.lib"
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Release Multithreaded"
 
@@ -118,7 +118,7 @@ LIB32=link.exe -lib
 # PROP Intermediate_Dir "..\..\..\objs\release_mt"
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /Za /W3 /GX /O2 /I "..\freetype\include\\" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /c
-# ADD CPP /MT /Za /W4 /Gm- /GX /Zi /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c
+# ADD CPP /MT /Za /W4 /GX /Zi /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c
 # SUBTRACT CPP /nologo /YX
 # ADD BASE RSC /l 0x409 /d "NDEBUG"
 # ADD RSC /l 0x409 /d "NDEBUG"
@@ -127,7 +127,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo /out:"lib\freetype200b8.lib"
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype206MT.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype211MT.lib"
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Release Singlethreaded"
 
@@ -143,7 +143,7 @@ LIB32=link.exe -lib
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MD /Za /W4 /GX /Zi /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c
 # SUBTRACT BASE CPP /YX
-# ADD CPP /Za /W4 /Gm- /GX /Zi /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c
+# ADD CPP /Za /W4 /GX /Zi /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c
 # SUBTRACT CPP /nologo /YX
 # ADD BASE RSC /l 0x409 /d "NDEBUG"
 # ADD RSC /l 0x409 /d "NDEBUG"
@@ -152,7 +152,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype206.lib"
-# ADD LIB32 /out:"..\..\..\objs\freetype206ST.lib"
+# ADD LIB32 /out:"..\..\..\objs\freetype211ST.lib"
 # SUBTRACT LIB32 /nologo
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Debug Singlethreaded"
@@ -169,7 +169,7 @@ LIB32=link.exe -lib
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MDd /Za /W4 /Gm /GX /Zi /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /FD /GZ /c
 # SUBTRACT BASE CPP /X /YX
-# ADD CPP /Za /W4 /Gm- /GX /Zi /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /FD /GZ /c
+# ADD CPP /Za /W4 /GX /Zi /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /FD /GZ /c
 # SUBTRACT CPP /nologo /X /YX
 # ADD BASE RSC /l 0x409 /d "_DEBUG"
 # ADD RSC /l 0x409 /d "_DEBUG"
@@ -178,7 +178,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype206_D.lib"
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype206ST_D.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype211ST_D.lib"
 
 !ENDIF 
 
@@ -196,79 +196,113 @@ LIB32=link.exe -lib
 # Begin Source File
 
 SOURCE=..\..\..\src\autohint\autohint.c
+# SUBTRACT CPP /Fr
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\bdf\bdf.c
+# SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
 SOURCE=..\..\..\src\cff\cff.c
+# SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
 SOURCE=..\..\..\src\base\ftbase.c
+# SUBTRACT CPP /Fr
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\cache\ftcache.c
+# SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
 SOURCE=..\ftdebug.c
 # ADD CPP /Ze
+# SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
 SOURCE=..\..\..\src\base\ftglyph.c
+# SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
 SOURCE=..\..\..\src\base\ftinit.c
+# SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
 SOURCE=..\..\..\src\base\ftmm.c
+# SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
 SOURCE=..\..\..\src\base\ftsystem.c
+# SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
 SOURCE=..\..\..\src\pcf\pcf.c
+# SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
 SOURCE=..\..\..\src\psaux\psaux.c
+# SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
 SOURCE=..\..\..\src\pshinter\pshinter.c
+# SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
 SOURCE=..\..\..\src\psnames\psmodule.c
+# SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
 SOURCE=..\..\..\src\raster\raster.c
+# SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
 SOURCE=..\..\..\src\sfnt\sfnt.c
+# SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
 SOURCE=..\..\..\src\smooth\smooth.c
+# SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
 SOURCE=..\..\..\src\truetype\truetype.c
+# SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
 SOURCE=..\..\..\src\type1\type1.c
+# SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
 SOURCE=..\..\..\src\cid\type1cid.c
+# SUBTRACT CPP /Fr
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\type42\type42.c
+# SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
 SOURCE=..\..\..\src\winfonts\winfnt.c
+# SUBTRACT CPP /Fr
 # End Source File
 # End Group
 # Begin Group "Header Files"
@@ -294,6 +328,10 @@ SOURCE=..\..\..\include\freetype\config\ftmodule.h
 
 SOURCE=..\..\..\include\freetype\config\ftoption.h
 # End Source File
+# Begin Source File
+
+SOURCE=..\..\..\include\freetype\config\ftstdlib.h
+# End Source File
 # End Group
 # End Target
 # End Project
diff --git a/src/bdf/bdflib.c b/src/bdf/bdflib.c
index debfdea..8984040 100644
--- a/src/bdf/bdflib.c
+++ b/src/bdf/bdflib.c
@@ -1772,14 +1772,14 @@
 
       /* Determine the overall font bounding box as the characters are */
       /* loaded so corrections can be done later if indicated.         */
-      p->maxas    = MAX( glyph->bbx.ascent, p->maxas );
-      p->maxds    = MAX( glyph->bbx.descent, p->maxds );
+      p->maxas    = (FT_Short) MAX( glyph->bbx.ascent, p->maxas );
+      p->maxds    = (FT_Short) MAX( glyph->bbx.descent, p->maxds );
 
       p->rbearing = (short)( glyph->bbx.width + glyph->bbx.x_offset );
 
-      p->maxrb    = MAX( p->rbearing, p->maxrb );
-      p->minlb    = MIN( glyph->bbx.x_offset, p->minlb );
-      p->maxlb    = MAX( glyph->bbx.x_offset, p->maxlb );
+      p->maxrb    = (FT_Short) MAX( p->rbearing, p->maxrb );
+      p->minlb    = (FT_Short) MIN( glyph->bbx.x_offset, p->minlb );
+      p->maxlb    = (FT_Short) MAX( glyph->bbx.x_offset, p->maxlb );
 
       if ( !( p->flags & _BDF_DWIDTH ) )
       {
@@ -2165,12 +2165,12 @@
           shift >>= 1;
         }
 
-        shift = ( bitcount > 3 ) ? 8 : ( 1 << bitcount );
+        shift = (FT_UShort)(( bitcount > 3 ) ? 8 : ( 1 << bitcount ));
 
         if ( p->font->bpp > shift || p->font->bpp != shift )
         {
           /* select next higher value */
-          p->font->bpp = shift << 1;
+          p->font->bpp = (FT_UShort)(shift << 1);
           FT_TRACE2(( "_bdf_parse_start: " ACMSG11, p->font->bpp ));
         }
       }
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index dbd9461..e3dada2 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -1049,7 +1049,7 @@
     FT_TRACE2(( "loaded\n" ));
 
     /* everything went well, update face->num_names */
-    face->num_names = table->numNameRecords;
+    face->num_names = (FT_UShort) table->numNameRecords;
 
   Exit:
     return error;
diff --git a/src/type42/t42objs.c b/src/type42/t42objs.c
index e22d833..452550b 100644
--- a/src/type42/t42objs.c
+++ b/src/type42/t42objs.c
@@ -252,6 +252,8 @@
     if ( error )
       goto Exit;
 
+    FT_Done_Size( face->ttf_face->size );
+
     /* Ignore info in FontInfo dictionary and use the info from the  */
     /* loaded TTF font.  The PostScript interpreter also ignores it. */
     root->bbox         = face->ttf_face->bbox;
@@ -635,6 +637,8 @@
     error = FT_New_Size( t42face->ttf_face, &ttsize );
     size->ttsize = ttsize;
 
+    FT_Activate_Size( ttsize );
+
     return error;
   }
 
@@ -701,6 +705,17 @@
   }
 
 
+  static void
+  t42_check_size_change( FT_Face  face )
+  {
+    FT_Face  tt_face = ((T42_Face)face)->ttf_face;
+    FT_Size  tt_size = ((T42_Size)face->size)->ttsize;
+    
+    if ( tt_face->size != tt_size )
+      FT_Activate_Size( tt_size );
+  }
+
+
   FT_LOCAL_DEF( FT_Error )
   T42_Size_SetChars( T42_Size    size,
                      FT_F26Dot6  char_width,
@@ -712,6 +727,8 @@
     T42_Face  t42face = (T42_Face)face;
 
 
+    t42_check_size_change( t42face->ttf_face );
+    
     return FT_Set_Char_Size( t42face->ttf_face,
                              char_width,
                              char_height,
@@ -729,6 +746,9 @@
     T42_Face  t42face = (T42_Face)face;
 
 
+
+    t42_check_size_change( t42face->ttf_face );
+    
     return FT_Set_Pixel_Sizes( t42face->ttf_face,
                                pixel_width,
                                pixel_height );
@@ -749,9 +769,9 @@
     }
 
     /* clear all public fields in the glyph slot */
-    FT_MEM_SET( &slot->metrics, 0, sizeof ( slot->metrics ) );
-    FT_MEM_SET( &slot->outline, 0, sizeof ( slot->outline ) );
-    FT_MEM_SET( &slot->bitmap,  0, sizeof ( slot->bitmap )  );
+    FT_ZERO( &slot->metrics );
+    FT_ZERO( &slot->outline );
+    FT_ZERO( &slot->bitmap );
 
     slot->bitmap_left   = 0;
     slot->bitmap_top    = 0;
@@ -776,8 +796,10 @@
     FT_Error         error;
     T42_GlyphSlot    t42slot = (T42_GlyphSlot)glyph;
     T42_Size         t42size = (T42_Size)size;
+    FT_Face          tt_face = ((T42_Face) glyph->face)->ttf_face;
     FT_Driver_Class  ttclazz = ((T42_Driver)glyph->face->driver)->ttclazz;
 
+    t42_check_size_change( tt_face );
 
     ft_glyphslot_clear( t42slot->ttslot );
     error = ttclazz->load_glyph( t42slot->ttslot,
@@ -798,6 +820,12 @@
       glyph->bitmap      = t42slot->ttslot->bitmap;
       glyph->bitmap_left = t42slot->ttslot->bitmap_left;
       glyph->bitmap_top  = t42slot->ttslot->bitmap_top;
+      
+      glyph->num_subglyphs = t42slot->ttslot->num_subglyphs;
+      glyph->subglyphs     = t42slot->ttslot->subglyphs;
+      
+      glyph->control_data  = t42slot->ttslot->control_data;
+      glyph->control_len   = t42slot->ttslot->control_len;
     }
 
     return error;