@@ -121,10 +121,7 @@ BYTE *GetTable(struct TTFONT *font, const char *name)
121
121
{
122
122
BYTE *ptr;
123
123
ULONG x;
124
-
125
- #ifdef DEBUG_TRUETYPE
126
124
debug (" GetTable(file,font,\" %s\" )" ,name);
127
- #endif
128
125
129
126
/* We must search the table directory. */
130
127
ptr = font->offset_table + 12 ;
@@ -142,9 +139,7 @@ BYTE *GetTable(struct TTFONT *font, const char *name)
142
139
143
140
try
144
141
{
145
- #ifdef DEBUG_TRUETYPE
146
142
debug (" Loading table \" %s\" from offset %d, %d bytes" ,name,offset,length);
147
- #endif
148
143
149
144
if ( fseek ( font->file , (long )offset, SEEK_SET ) )
150
145
{
@@ -200,10 +195,7 @@ void Read_name(struct TTFONT *font)
200
195
int platform; /* Current platform id */
201
196
int nameid; /* name id, */
202
197
int offset,length; /* offset and length of string. */
203
-
204
- #ifdef DEBUG_TRUETYPE
205
198
debug (" Read_name()" );
206
- #endif
207
199
208
200
table_ptr = NULL ;
209
201
@@ -235,11 +227,8 @@ void Read_name(struct TTFONT *font)
235
227
nameid = getUSHORT (ptr2+6 );
236
228
length = getUSHORT (ptr2+8 );
237
229
offset = getUSHORT (ptr2+10 );
238
-
239
- #ifdef DEBUG_TRUETYPE
240
230
debug (" platform %d, encoding %d, language 0x%x, name %d, offset %d, length %d" ,
241
231
platform,encoding,language,nameid,offset,length);
242
- #endif
243
232
244
233
/* Copyright notice */
245
234
if ( platform == 1 && nameid == 0 )
@@ -248,10 +237,7 @@ void Read_name(struct TTFONT *font)
248
237
strncpy (font->Copyright ,(const char *)strings+offset,length);
249
238
font->Copyright [length]=' \0 ' ;
250
239
replace_newlines_with_spaces (font->Copyright );
251
-
252
- #ifdef DEBUG_TRUETYPE
253
240
debug (" font->Copyright=\" %s\" " ,font->Copyright );
254
- #endif
255
241
continue ;
256
242
}
257
243
@@ -264,10 +250,7 @@ void Read_name(struct TTFONT *font)
264
250
strncpy (font->FamilyName ,(const char *)strings+offset,length);
265
251
font->FamilyName [length]=' \0 ' ;
266
252
replace_newlines_with_spaces (font->FamilyName );
267
-
268
- #ifdef DEBUG_TRUETYPE
269
253
debug (" font->FamilyName=\" %s\" " ,font->FamilyName );
270
- #endif
271
254
continue ;
272
255
}
273
256
@@ -280,10 +263,7 @@ void Read_name(struct TTFONT *font)
280
263
strncpy (font->Style ,(const char *)strings+offset,length);
281
264
font->Style [length]=' \0 ' ;
282
265
replace_newlines_with_spaces (font->Style );
283
-
284
- #ifdef DEBUG_TRUETYPE
285
266
debug (" font->Style=\" %s\" " ,font->Style );
286
- #endif
287
267
continue ;
288
268
}
289
269
@@ -296,10 +276,7 @@ void Read_name(struct TTFONT *font)
296
276
strncpy (font->FullName ,(const char *)strings+offset,length);
297
277
font->FullName [length]=' \0 ' ;
298
278
replace_newlines_with_spaces (font->FullName );
299
-
300
- #ifdef DEBUG_TRUETYPE
301
279
debug (" font->FullName=\" %s\" " ,font->FullName );
302
- #endif
303
280
continue ;
304
281
}
305
282
@@ -312,10 +289,7 @@ void Read_name(struct TTFONT *font)
312
289
strncpy (font->Version ,(const char *)strings+offset,length);
313
290
font->Version [length]=' \0 ' ;
314
291
replace_newlines_with_spaces (font->Version );
315
-
316
- #ifdef DEBUG_TRUETYPE
317
292
debug (" font->Version=\" %s\" " ,font->Version );
318
- #endif
319
293
continue ;
320
294
}
321
295
@@ -328,10 +302,7 @@ void Read_name(struct TTFONT *font)
328
302
strncpy (font->PostName ,(const char *)strings+offset,length);
329
303
font->PostName [length]=' \0 ' ;
330
304
replace_newlines_with_spaces (font->PostName );
331
-
332
- #ifdef DEBUG_TRUETYPE
333
305
debug (" font->PostName=\" %s\" " ,font->PostName );
334
- #endif
335
306
continue ;
336
307
}
337
308
@@ -343,10 +314,7 @@ void Read_name(struct TTFONT *font)
343
314
utf16be_to_ascii (font->PostName , (char *)strings+offset, length);
344
315
font->PostName [length/2 ]=' \0 ' ;
345
316
replace_newlines_with_spaces (font->PostName );
346
-
347
- #ifdef DEBUG_TRUETYPE
348
317
debug (" font->PostName=\" %s\" " ,font->PostName );
349
- #endif
350
318
continue ;
351
319
}
352
320
@@ -358,10 +326,7 @@ void Read_name(struct TTFONT *font)
358
326
strncpy (font->Trademark ,(const char *)strings+offset,length);
359
327
font->Trademark [length]=' \0 ' ;
360
328
replace_newlines_with_spaces (font->Trademark );
361
-
362
- #ifdef DEBUG_TRUETYPE
363
329
debug (" font->Trademark=\" %s\" " ,font->Trademark );
364
- #endif
365
330
continue ;
366
331
}
367
332
}
@@ -677,10 +642,7 @@ void sfnts_glyf_table(TTStreamWriter& stream, struct TTFONT *font, ULONG oldoffs
677
642
ULONG total=0 ; /* running total of bytes written to table */
678
643
int x;
679
644
bool loca_is_local=false ;
680
-
681
- #ifdef DEBUG_TRUETYPE
682
645
debug (" sfnts_glyf_table(font,%d)" , (int )correct_total_length);
683
- #endif
684
646
685
647
if (font->loca_table == NULL )
686
648
{
@@ -709,10 +671,7 @@ void sfnts_glyf_table(TTStreamWriter& stream, struct TTFONT *font, ULONG oldoffs
709
671
length = getULONG ( font->loca_table + ((x+1 ) * 4 ) );
710
672
length -= off;
711
673
}
712
-
713
- #ifdef DEBUG_TRUETYPE
714
674
debug (" glyph length=%d" ,(int )length);
715
- #endif
716
675
717
676
/* Start new string if necessary. */
718
677
sfnts_new_table ( stream, (int )length );
@@ -847,12 +806,10 @@ void ttfont_sfnts(TTStreamWriter& stream, struct TTFONT *font)
847
806
sfnts_pputUSHORT (stream, 3 ); /* entrySelector */
848
807
sfnts_pputUSHORT (stream, 81 ); /* rangeShift */
849
808
}
850
- #ifdef DEBUG_TRUETYPE
851
809
else
852
810
{
853
811
debug (" only %d tables selected" ,count);
854
812
}
855
- #endif
856
813
857
814
/* Now, emmit the table directory. */
858
815
for (x=0 ; x < 9 ; x++)
@@ -885,10 +842,7 @@ void ttfont_sfnts(TTStreamWriter& stream, struct TTFONT *font)
885
842
{
886
843
continue ;
887
844
}
888
-
889
- #ifdef DEBUG_TRUETYPE
890
845
debug (" emmiting table '%s'" ,table_names[x]);
891
- #endif
892
846
893
847
/* 'glyf' table gets special treatment */
894
848
if ( strcmp (table_names[x]," glyf" )==0 )
@@ -1278,9 +1232,7 @@ void read_font(const char *filename, font_type_enum target_type, std::vector<int
1278
1232
1279
1233
/* Determine how many directory entries there are. */
1280
1234
font.numTables = getUSHORT ( font.offset_table + 4 );
1281
- #ifdef DEBUG_TRUETYPE
1282
1235
debug (" numTables=%d" ,(int )font.numTables );
1283
- #endif
1284
1236
1285
1237
/* Expand the memory block to hold the whole thing. */
1286
1238
font.offset_table = (BYTE*)realloc ( font.offset_table , sizeof (BYTE) * (12 + font.numTables * 16 ) );
@@ -1301,9 +1253,7 @@ void read_font(const char *filename, font_type_enum target_type, std::vector<int
1301
1253
font.MfrRevision = getFixed ( ptr + 4 ); /* font revision number */
1302
1254
font.unitsPerEm = getUSHORT ( ptr + 18 );
1303
1255
font.HUPM = font.unitsPerEm / 2 ;
1304
- #ifdef DEBUG_TRUETYPE
1305
1256
debug (" unitsPerEm=%d" ,(int )font.unitsPerEm );
1306
- #endif
1307
1257
font.llx = topost2 ( getFWord ( ptr + 36 ) ); /* bounding box info */
1308
1258
font.lly = topost2 ( getFWord ( ptr + 38 ) );
1309
1259
font.urx = topost2 ( getFWord ( ptr + 40 ) );
0 commit comments