zenilib: zenilib/jni/external/freetype2/src/sfnt/ttload.c Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ttload.c
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* ttload.c */
4 /* */
5 /* Load the basic TrueType tables, i.e., tables that can be either in */
6 /* TTF or OTF fonts (body). */
7 /* */
8 /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
9 /* 2010 by */
10 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
11 /* */
12 /* This file is part of the FreeType project, and may only be used, */
13 /* modified, and distributed under the terms of the FreeType project */
14 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
15 /* this file you indicate that you have read the license and */
16 /* understand and accept it fully. */
17 /* */
18 /***************************************************************************/
19
20
21 #include <ft2build.h>
22 #include FT_INTERNAL_DEBUG_H
23 #include FT_INTERNAL_STREAM_H
24 #include FT_TRUETYPE_TAGS_H
25 #include "ttload.h"
26
27 #include "sferrors.h"
28
29
30 /*************************************************************************/
31 /* */
32 /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
33 /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
34 /* messages during execution. */
35 /* */
36 #undef FT_COMPONENT
37 #define FT_COMPONENT trace_ttload
38
39
40 /*************************************************************************/
41 /* */
42 /* <Function> */
43 /* tt_face_lookup_table */
44 /* */
45 /* <Description> */
46 /* Looks for a TrueType table by name. */
47 /* */
48 /* <Input> */
49 /* face :: A face object handle. */
50 /* */
51 /* tag :: The searched tag. */
52 /* */
53 /* <Return> */
54 /* A pointer to the table directory entry. 0 if not found. */
55 /* */
56 FT_LOCAL_DEF( TT_Table )
57 tt_face_lookup_table( TT_Face face,
58 FT_ULong tag )
59 {
60 TT_Table entry;
61 TT_Table limit;
62 #ifdef FT_DEBUG_LEVEL_TRACE
63 FT_Bool zero_length = FALSE;
64 #endif
65
66
67 FT_TRACE4(( "tt_face_lookup_table: %08p, `%c%c%c%c' -- ",
68 face,
69 (FT_Char)( tag >> 24 ),
70 (FT_Char)( tag >> 16 ),
71 (FT_Char)( tag >> 8 ),
72 (FT_Char)( tag ) ));
73
74 entry = face->dir_tables;
75 limit = entry + face->num_tables;
76
77 for ( ; entry < limit; entry++ )
78 {
79 /* For compatibility with Windows, we consider */
80 /* zero-length tables the same as missing tables. */
81 if ( entry->Tag == tag )
82 {
83 if ( entry->Length != 0 )
84 {
85 FT_TRACE4(( "found table.\n" ));
86 return entry;
87 }
88 #ifdef FT_DEBUG_LEVEL_TRACE
89 zero_length = TRUE;
90 #endif
91 }
92 }
93
94 #ifdef FT_DEBUG_LEVEL_TRACE
95 if ( zero_length )
96 FT_TRACE4(( "ignoring empty table\n" ));
97 else
98 FT_TRACE4(( "could not find table\n" ));
99 #endif
100
101 return NULL;
102 }
103
104
105 /*************************************************************************/
106 /* */
107 /* <Function> */
108 /* tt_face_goto_table */
109 /* */
110 /* <Description> */
111 /* Looks for a TrueType table by name, then seek a stream to it. */
112 /* */
113 /* <Input> */
114 /* face :: A face object handle. */
115 /* */
116 /* tag :: The searched tag. */
117 /* */
118 /* stream :: The stream to seek when the table is found. */
119 /* */
120 /* <Output> */
121 /* length :: The length of the table if found, undefined otherwise. */
122 /* */
123 /* <Return> */
124 /* FreeType error code. 0 means success. */
125 /* */
126 FT_LOCAL_DEF( FT_Error )
127 tt_face_goto_table( TT_Face face,
128 FT_ULong tag,
129 FT_Stream stream,
130 FT_ULong* length )
131 {
132 TT_Table table;
133 FT_Error error;
134
135
136 table = tt_face_lookup_table( face, tag );
137 if ( table )
138 {
139 if ( length )
140 *length = table->Length;
141
142 if ( FT_STREAM_SEEK( table->Offset ) )
143 goto Exit;
144 }
145 else
146 error = SFNT_Err_Table_Missing;
147
148 Exit:
149 return error;
150 }
151
152
153 /* Here, we */
154 /* */
155 /* - check that `num_tables' is valid (and adjust it if necessary) */
156 /* */
157 /* - look for a `head' table, check its size, and parse it to check */
158 /* whether its `magic' field is correctly set */
159 /* */
160 /* - errors (except errors returned by stream handling) */
161 /* */
162 /* SFNT_Err_Unknown_File_Format: */
163 /* no table is defined in directory, it is not sfnt-wrapped */
164 /* data */
165 /* SFNT_Err_Table_Missing: */
166 /* table directory is valid, but essential tables */
167 /* (head/bhed/SING) are missing */
168 /* */
169 static FT_Error
170 check_table_dir( SFNT_Header sfnt,
171 FT_Stream stream )
172 {
173 FT_Error error;
174 FT_UShort nn, valid_entries = 0;
175 FT_UInt has_head = 0, has_sing = 0, has_meta = 0;
176 FT_ULong offset = sfnt->offset + 12;
177
178 static const FT_Frame_Field table_dir_entry_fields[] =
179 {
180 #undef FT_STRUCTURE
181 #define FT_STRUCTURE TT_TableRec
182
183 FT_FRAME_START( 16 ),
184 FT_FRAME_ULONG( Tag ),
185 FT_FRAME_ULONG( CheckSum ),
186 FT_FRAME_ULONG( Offset ),
187 FT_FRAME_ULONG( Length ),
188 FT_FRAME_END
189 };
190
191
192 if ( FT_STREAM_SEEK( offset ) )
193 goto Exit;
194
195 for ( nn = 0; nn < sfnt->num_tables; nn++ )
196 {
197 TT_TableRec table;
198
199
200 if ( FT_STREAM_READ_FIELDS( table_dir_entry_fields, &table ) )
201 {
202 nn--;
203 FT_TRACE2(( "check_table_dir:"
204 " can read only %d table%s in font (instead of %d)\n",
205 nn, nn == 1 ? "" : "s", sfnt->num_tables ));
206 sfnt->num_tables = nn;
207 break;
208 }
209
210 /* we ignore invalid tables */
211 if ( table.Offset + table.Length > stream->size )
212 {
213 FT_TRACE2(( "check_table_dir: table entry %d invalid\n", nn ));
214 continue;
215 }
216 else
217 valid_entries++;
218
219 if ( table.Tag == TTAG_head || table.Tag == TTAG_bhed )
220 {
221 FT_UInt32 magic;
222
223
224 #ifndef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
225 if ( table.Tag == TTAG_head )
226 #endif
227 has_head = 1;
228
229 /*
230 * The table length should be 0x36, but certain font tools make it
231 * 0x38, so we will just check that it is greater.
232 *
233 * Note that according to the specification, the table must be
234 * padded to 32-bit lengths, but this doesn't apply to the value of
235 * its `Length' field!
236 *
237 */
238 if ( table.Length < 0x36 )
239 {
240 FT_TRACE2(( "check_table_dir: `head' table too small\n" ));
241 error = SFNT_Err_Table_Missing;
242 goto Exit;
243 }
244
245 if ( FT_STREAM_SEEK( table.Offset + 12 ) ||
246 FT_READ_ULONG( magic ) )
247 goto Exit;
248
249 if ( magic != 0x5F0F3CF5UL )
250 {
251 FT_TRACE2(( "check_table_dir:"
252 " no magic number found in `head' table\n"));
253 error = SFNT_Err_Table_Missing;
254 goto Exit;
255 }
256
257 if ( FT_STREAM_SEEK( offset + ( nn + 1 ) * 16 ) )
258 goto Exit;
259 }
260 else if ( table.Tag == TTAG_SING )
261 has_sing = 1;
262 else if ( table.Tag == TTAG_META )
263 has_meta = 1;
264 }
265
266 sfnt->num_tables = valid_entries;
267
268 if ( sfnt->num_tables == 0 )
269 {
270 FT_TRACE2(( "check_table_dir: no tables found\n" ));
271 error = SFNT_Err_Unknown_File_Format;
272 goto Exit;
273 }
274
275 /* if `sing' and `meta' tables are present, there is no `head' table */
276 if ( has_head || ( has_sing && has_meta ) )
277 {
278 error = SFNT_Err_Ok;
279 goto Exit;
280 }
281 else
282 {
283 FT_TRACE2(( "check_table_dir:" ));
284 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
285 FT_TRACE2(( " neither `head', `bhed', nor `sing' table found\n" ));
286 #else
287 FT_TRACE2(( " neither `head' nor `sing' table found\n" ));
288 #endif
289 error = SFNT_Err_Table_Missing;
290 }
291
292 Exit:
293 return error;
294 }
295
296
297 /*************************************************************************/
298 /* */
299 /* <Function> */
300 /* tt_face_load_font_dir */
301 /* */
302 /* <Description> */
303 /* Loads the header of a SFNT font file. */
304 /* */
305 /* <Input> */
306 /* face :: A handle to the target face object. */
307 /* */
308 /* stream :: The input stream. */
309 /* */
310 /* <Output> */
311 /* sfnt :: The SFNT header. */
312 /* */
313 /* <Return> */
314 /* FreeType error code. 0 means success. */
315 /* */
316 /* <Note> */
317 /* The stream cursor must be at the beginning of the font directory. */
318 /* */
319 FT_LOCAL_DEF( FT_Error )
320 tt_face_load_font_dir( TT_Face face,
321 FT_Stream stream )
322 {
323 SFNT_HeaderRec sfnt;
324 FT_Error error;
325 FT_Memory memory = stream->memory;
326 TT_TableRec* entry;
327 FT_Int nn;
328
329 static const FT_Frame_Field offset_table_fields[] =
330 {
331 #undef FT_STRUCTURE
332 #define FT_STRUCTURE SFNT_HeaderRec
333
334 FT_FRAME_START( 8 ),
335 FT_FRAME_USHORT( num_tables ),
336 FT_FRAME_USHORT( search_range ),
337 FT_FRAME_USHORT( entry_selector ),
338 FT_FRAME_USHORT( range_shift ),
339 FT_FRAME_END
340 };
341
342
343 FT_TRACE2(( "tt_face_load_font_dir: %08p\n", face ));
344
345 /* read the offset table */
346
347 sfnt.offset = FT_STREAM_POS();
348
349 if ( FT_READ_ULONG( sfnt.format_tag ) ||
350 FT_STREAM_READ_FIELDS( offset_table_fields, &sfnt ) )
351 goto Exit;
352
353 /* many fonts don't have these fields set correctly */
354 #if 0
355 if ( sfnt.search_range != 1 << ( sfnt.entry_selector + 4 ) ||
356 sfnt.search_range + sfnt.range_shift != sfnt.num_tables << 4 )
357 return SFNT_Err_Unknown_File_Format;
358 #endif
359
360 /* load the table directory */
361
362 FT_TRACE2(( "-- Number of tables: %10u\n", sfnt.num_tables ));
363 FT_TRACE2(( "-- Format version: 0x%08lx\n", sfnt.format_tag ));
364
365 /* check first */
366 error = check_table_dir( &sfnt, stream );
367 if ( error )
368 {
369 FT_TRACE2(( "tt_face_load_font_dir:"
370 " invalid table directory for TrueType\n" ));
371
372 goto Exit;
373 }
374
375 face->num_tables = sfnt.num_tables;
376 face->format_tag = sfnt.format_tag;
377
378 if ( FT_QNEW_ARRAY( face->dir_tables, face->num_tables ) )
379 goto Exit;
380
381 if ( FT_STREAM_SEEK( sfnt.offset + 12 ) ||
382 FT_FRAME_ENTER( face->num_tables * 16L ) )
383 goto Exit;
384
385 entry = face->dir_tables;
386
387 FT_TRACE2(( "\n"
388 " tag offset length checksum\n"
389 " ----------------------------------\n" ));
390
391 for ( nn = 0; nn < sfnt.num_tables; nn++ )
392 {
393 entry->Tag = FT_GET_TAG4();
394 entry->CheckSum = FT_GET_ULONG();
395 entry->Offset = FT_GET_LONG();
396 entry->Length = FT_GET_LONG();
397
398 /* ignore invalid tables */
399 if ( entry->Offset + entry->Length > stream->size )
400 continue;
401 else
402 {
403 FT_TRACE2(( " %c%c%c%c %08lx %08lx %08lx\n",
404 (FT_Char)( entry->Tag >> 24 ),
405 (FT_Char)( entry->Tag >> 16 ),
406 (FT_Char)( entry->Tag >> 8 ),
407 (FT_Char)( entry->Tag ),
408 entry->Offset,
409 entry->Length,
410 entry->CheckSum ));
411 entry++;
412 }
413 }
414
415 FT_FRAME_EXIT();
416
417 FT_TRACE2(( "table directory loaded\n\n" ));
418
419 Exit:
420 return error;
421 }
422
423
424 /*************************************************************************/
425 /* */
426 /* <Function> */
427 /* tt_face_load_any */
428 /* */
429 /* <Description> */
430 /* Loads any font table into client memory. */
431 /* */
432 /* <Input> */
433 /* face :: The face object to look for. */
434 /* */
435 /* tag :: The tag of table to load. Use the value 0 if you want */
436 /* to access the whole font file, else set this parameter */
437 /* to a valid TrueType table tag that you can forge with */
438 /* the MAKE_TT_TAG macro. */
439 /* */
440 /* offset :: The starting offset in the table (or the file if */
441 /* tag == 0). */
442 /* */
443 /* length :: The address of the decision variable: */
444 /* */
445 /* If length == NULL: */
446 /* Loads the whole table. Returns an error if */
447 /* `offset' == 0! */
448 /* */
449 /* If *length == 0: */
450 /* Exits immediately; returning the length of the given */
451 /* table or of the font file, depending on the value of */
452 /* `tag'. */
453 /* */
454 /* If *length != 0: */
455 /* Loads the next `length' bytes of table or font, */
456 /* starting at offset `offset' (in table or font too). */
457 /* */
458 /* <Output> */
459 /* buffer :: The address of target buffer. */
460 /* */
461 /* <Return> */
462 /* FreeType error code. 0 means success. */
463 /* */
464 FT_LOCAL_DEF( FT_Error )
465 tt_face_load_any( TT_Face face,
466 FT_ULong tag,
467 FT_Long offset,
468 FT_Byte* buffer,
469 FT_ULong* length )
470 {
471 FT_Error error;
472 FT_Stream stream;
473 TT_Table table;
474 FT_ULong size;
475
476
477 if ( tag != 0 )
478 {
479 /* look for tag in font directory */
480 table = tt_face_lookup_table( face, tag );
481 if ( !table )
482 {
483 error = SFNT_Err_Table_Missing;
484 goto Exit;
485 }
486
487 offset += table->Offset;
488 size = table->Length;
489 }
490 else
491 /* tag == 0 -- the user wants to access the font file directly */
492 size = face->root.stream->size;
493
494 if ( length && *length == 0 )
495 {
496 *length = size;
497
498 return SFNT_Err_Ok;
499 }
500
501 if ( length )
502 size = *length;
503
504 stream = face->root.stream;
505 /* the `if' is syntactic sugar for picky compilers */
506 if ( FT_STREAM_READ_AT( offset, buffer, size ) )
507 goto Exit;
508
509 Exit:
510 return error;
511 }
512
513
514 /*************************************************************************/
515 /* */
516 /* <Function> */
517 /* tt_face_load_generic_header */
518 /* */
519 /* <Description> */
520 /* Loads the TrueType table `head' or `bhed'. */
521 /* */
522 /* <Input> */
523 /* face :: A handle to the target face object. */
524 /* */
525 /* stream :: The input stream. */
526 /* */
527 /* <Return> */
528 /* FreeType error code. 0 means success. */
529 /* */
530 static FT_Error
531 tt_face_load_generic_header( TT_Face face,
532 FT_Stream stream,
533 FT_ULong tag )
534 {
535 FT_Error error;
536 TT_Header* header;
537
538 static const FT_Frame_Field header_fields[] =
539 {
540 #undef FT_STRUCTURE
541 #define FT_STRUCTURE TT_Header
542
543 FT_FRAME_START( 54 ),
544 FT_FRAME_ULONG ( Table_Version ),
545 FT_FRAME_ULONG ( Font_Revision ),
546 FT_FRAME_LONG ( CheckSum_Adjust ),
547 FT_FRAME_LONG ( Magic_Number ),
548 FT_FRAME_USHORT( Flags ),
549 FT_FRAME_USHORT( Units_Per_EM ),
550 FT_FRAME_LONG ( Created[0] ),
551 FT_FRAME_LONG ( Created[1] ),
552 FT_FRAME_LONG ( Modified[0] ),
553 FT_FRAME_LONG ( Modified[1] ),
554 FT_FRAME_SHORT ( xMin ),
555 FT_FRAME_SHORT ( yMin ),
556 FT_FRAME_SHORT ( xMax ),
557 FT_FRAME_SHORT ( yMax ),
558 FT_FRAME_USHORT( Mac_Style ),
559 FT_FRAME_USHORT( Lowest_Rec_PPEM ),
560 FT_FRAME_SHORT ( Font_Direction ),
561 FT_FRAME_SHORT ( Index_To_Loc_Format ),
562 FT_FRAME_SHORT ( Glyph_Data_Format ),
563 FT_FRAME_END
564 };
565
566
567 error = face->goto_table( face, tag, stream, 0 );
568 if ( error )
569 goto Exit;
570
571 header = &face->header;
572
573 if ( FT_STREAM_READ_FIELDS( header_fields, header ) )
574 goto Exit;
575
576 FT_TRACE3(( "Units per EM: %4u\n", header->Units_Per_EM ));
577 FT_TRACE3(( "IndexToLoc: %4d\n", header->Index_To_Loc_Format ));
578
579 Exit:
580 return error;
581 }
582
583
584 FT_LOCAL_DEF( FT_Error )
585 tt_face_load_head( TT_Face face,
586 FT_Stream stream )
587 {
588 return tt_face_load_generic_header( face, stream, TTAG_head );
589 }
590
591
592 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
593
594 FT_LOCAL_DEF( FT_Error )
595 tt_face_load_bhed( TT_Face face,
596 FT_Stream stream )
597 {
598 return tt_face_load_generic_header( face, stream, TTAG_bhed );
599 }
600
601 #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
602
603
604 /*************************************************************************/
605 /* */
606 /* <Function> */
607 /* tt_face_load_max_profile */
608 /* */
609 /* <Description> */
610 /* Loads the maximum profile into a face object. */
611 /* */
612 /* <Input> */
613 /* face :: A handle to the target face object. */
614 /* */
615 /* stream :: The input stream. */
616 /* */
617 /* <Return> */
618 /* FreeType error code. 0 means success. */
619 /* */
620 FT_LOCAL_DEF( FT_Error )
621 tt_face_load_maxp( TT_Face face,
622 FT_Stream stream )
623 {
624 FT_Error error;
625 TT_MaxProfile* maxProfile = &face->max_profile;
626
627 const FT_Frame_Field maxp_fields[] =
628 {
629 #undef FT_STRUCTURE
630 #define FT_STRUCTURE TT_MaxProfile
631
632 FT_FRAME_START( 6 ),
633 FT_FRAME_LONG ( version ),
634 FT_FRAME_USHORT( numGlyphs ),
635 FT_FRAME_END
636 };
637
638 const FT_Frame_Field maxp_fields_extra[] =
639 {
640 FT_FRAME_START( 26 ),
641 FT_FRAME_USHORT( maxPoints ),
642 FT_FRAME_USHORT( maxContours ),
643 FT_FRAME_USHORT( maxCompositePoints ),
644 FT_FRAME_USHORT( maxCompositeContours ),
645 FT_FRAME_USHORT( maxZones ),
646 FT_FRAME_USHORT( maxTwilightPoints ),
647 FT_FRAME_USHORT( maxStorage ),
648 FT_FRAME_USHORT( maxFunctionDefs ),
649 FT_FRAME_USHORT( maxInstructionDefs ),
650 FT_FRAME_USHORT( maxStackElements ),
651 FT_FRAME_USHORT( maxSizeOfInstructions ),
652 FT_FRAME_USHORT( maxComponentElements ),
653 FT_FRAME_USHORT( maxComponentDepth ),
654 FT_FRAME_END
655 };
656
657
658 error = face->goto_table( face, TTAG_maxp, stream, 0 );
659 if ( error )
660 goto Exit;
661
662 if ( FT_STREAM_READ_FIELDS( maxp_fields, maxProfile ) )
663 goto Exit;
664
665 maxProfile->maxPoints = 0;
666 maxProfile->maxContours = 0;
667 maxProfile->maxCompositePoints = 0;
668 maxProfile->maxCompositeContours = 0;
669 maxProfile->maxZones = 0;
670 maxProfile->maxTwilightPoints = 0;
671 maxProfile->maxStorage = 0;
672 maxProfile->maxFunctionDefs = 0;
673 maxProfile->maxInstructionDefs = 0;
674 maxProfile->maxStackElements = 0;
675 maxProfile->maxSizeOfInstructions = 0;
676 maxProfile->maxComponentElements = 0;
677 maxProfile->maxComponentDepth = 0;
678
679 if ( maxProfile->version >= 0x10000L )
680 {
681 if ( FT_STREAM_READ_FIELDS( maxp_fields_extra, maxProfile ) )
682 goto Exit;
683
684 /* XXX: an adjustment that is necessary to load certain */
685 /* broken fonts like `Keystrokes MT' :-( */
686 /* */
687 /* We allocate 64 function entries by default when */
688 /* the maxFunctionDefs value is smaller. */
689
690 if ( maxProfile->maxFunctionDefs < 64 )
691 maxProfile->maxFunctionDefs = 64;
692
693 /* we add 4 phantom points later */
694 if ( maxProfile->maxTwilightPoints > ( 0xFFFFU - 4 ) )
695 {
696 FT_TRACE0(( "tt_face_load_maxp:"
697 " too much twilight points in `maxp' table;\n"
698 " "
699 " some glyphs might be rendered incorrectly\n" ));
700
701 maxProfile->maxTwilightPoints = 0xFFFFU - 4;
702 }
703
704 /* we arbitrarily limit recursion to avoid stack exhaustion */
705 if ( maxProfile->maxComponentDepth > 100 )
706 {
707 FT_TRACE0(( "tt_face_load_maxp:"
708 " abnormally large component depth (%d) set to 100\n",
709 maxProfile->maxComponentDepth ));
710 maxProfile->maxComponentDepth = 100;
711 }
712 }
713
714 FT_TRACE3(( "numGlyphs: %u\n", maxProfile->numGlyphs ));
715
716 Exit:
717 return error;
718 }
719
720
721 /*************************************************************************/
722 /* */
723 /* <Function> */
724 /* tt_face_load_names */
725 /* */
726 /* <Description> */
727 /* Loads the name records. */
728 /* */
729 /* <Input> */
730 /* face :: A handle to the target face object. */
731 /* */
732 /* stream :: The input stream. */
733 /* */
734 /* <Return> */
735 /* FreeType error code. 0 means success. */
736 /* */
737 FT_LOCAL_DEF( FT_Error )
738 tt_face_load_name( TT_Face face,
739 FT_Stream stream )
740 {
741 FT_Error error;
742 FT_Memory memory = stream->memory;
743 FT_ULong table_pos, table_len;
744 FT_ULong storage_start, storage_limit;
745 FT_UInt count;
746 TT_NameTable table;
747
748 static const FT_Frame_Field name_table_fields[] =
749 {
750 #undef FT_STRUCTURE
751 #define FT_STRUCTURE TT_NameTableRec
752
753 FT_FRAME_START( 6 ),
754 FT_FRAME_USHORT( format ),
755 FT_FRAME_USHORT( numNameRecords ),
756 FT_FRAME_USHORT( storageOffset ),
757 FT_FRAME_END
758 };
759
760 static const FT_Frame_Field name_record_fields[] =
761 {
762 #undef FT_STRUCTURE
763 #define FT_STRUCTURE TT_NameEntryRec
764
765 /* no FT_FRAME_START */
766 FT_FRAME_USHORT( platformID ),
767 FT_FRAME_USHORT( encodingID ),
768 FT_FRAME_USHORT( languageID ),
769 FT_FRAME_USHORT( nameID ),
770 FT_FRAME_USHORT( stringLength ),
771 FT_FRAME_USHORT( stringOffset ),
772 FT_FRAME_END
773 };
774
775
776 table = &face->name_table;
777 table->stream = stream;
778
779 error = face->goto_table( face, TTAG_name, stream, &table_len );
780 if ( error )
781 goto Exit;
782
783 table_pos = FT_STREAM_POS();
784
785
786 if ( FT_STREAM_READ_FIELDS( name_table_fields, table ) )
787 goto Exit;
788
789 /* Some popular Asian fonts have an invalid `storageOffset' value */
790 /* (it should be at least "6 + 12*num_names"). However, the string */
791 /* offsets, computed as "storageOffset + entry->stringOffset", are */
792 /* valid pointers within the name table... */
793 /* */
794 /* We thus can't check `storageOffset' right now. */
795 /* */
796 storage_start = table_pos + 6 + 12*table->numNameRecords;
797 storage_limit = table_pos + table_len;
798
799 if ( storage_start > storage_limit )
800 {
801 FT_ERROR(( "tt_face_load_name: invalid `name' table\n" ));
802 error = SFNT_Err_Name_Table_Missing;
803 goto Exit;
804 }
805
806 /* Allocate the array of name records. */
807 count = table->numNameRecords;
808 table->numNameRecords = 0;
809
810 if ( FT_NEW_ARRAY( table->names, count ) ||
811 FT_FRAME_ENTER( count * 12 ) )
812 goto Exit;
813
814 /* Load the name records and determine how much storage is needed */
815 /* to hold the strings themselves. */
816 {
817 TT_NameEntryRec* entry = table->names;
818
819
820 for ( ; count > 0; count-- )
821 {
822 if ( FT_STREAM_READ_FIELDS( name_record_fields, entry ) )
823 continue;
824
825 /* check that the name is not empty */
826 if ( entry->stringLength == 0 )
827 continue;
828
829 /* check that the name string is within the table */
830 entry->stringOffset += table_pos + table->storageOffset;
831 if ( entry->stringOffset < storage_start ||
832 entry->stringOffset + entry->stringLength > storage_limit )
833 {
834 /* invalid entry - ignore it */
835 entry->stringOffset = 0;
836 entry->stringLength = 0;
837 continue;
838 }
839
840 entry++;
841 }
842
843 table->numNameRecords = (FT_UInt)( entry - table->names );
844 }
845
846 FT_FRAME_EXIT();
847
848 /* everything went well, update face->num_names */
849 face->num_names = (FT_UShort) table->numNameRecords;
850
851 Exit:
852 return error;
853 }
854
855
856 /*************************************************************************/
857 /* */
858 /* <Function> */
859 /* tt_face_free_names */
860 /* */
861 /* <Description> */
862 /* Frees the name records. */
863 /* */
864 /* <Input> */
865 /* face :: A handle to the target face object. */
866 /* */
867 FT_LOCAL_DEF( void )
868 tt_face_free_name( TT_Face face )
869 {
870 FT_Memory memory = face->root.driver->root.memory;
871 TT_NameTable table = &face->name_table;
872 TT_NameEntry entry = table->names;
873 FT_UInt count = table->numNameRecords;
874
875
876 if ( table->names )
877 {
878 for ( ; count > 0; count--, entry++ )
879 {
880 FT_FREE( entry->string );
881 entry->stringLength = 0;
882 }
883
884 /* free strings table */
885 FT_FREE( table->names );
886 }
887
888 table->numNameRecords = 0;
889 table->format = 0;
890 table->storageOffset = 0;
891 }
892
893
894 /*************************************************************************/
895 /* */
896 /* <Function> */
897 /* tt_face_load_cmap */
898 /* */
899 /* <Description> */
900 /* Loads the cmap directory in a face object. The cmaps themselves */
901 /* are loaded on demand in the `ttcmap.c' module. */
902 /* */
903 /* <Input> */
904 /* face :: A handle to the target face object. */
905 /* */
906 /* stream :: A handle to the input stream. */
907 /* */
908 /* <Return> */
909 /* FreeType error code. 0 means success. */
910 /* */
911
912 FT_LOCAL_DEF( FT_Error )
913 tt_face_load_cmap( TT_Face face,
914 FT_Stream stream )
915 {
916 FT_Error error;
917
918
919 error = face->goto_table( face, TTAG_cmap, stream, &face->cmap_size );
920 if ( error )
921 goto Exit;
922
923 if ( FT_FRAME_EXTRACT( face->cmap_size, face->cmap_table ) )
924 face->cmap_size = 0;
925
926 Exit:
927 return error;
928 }
929
930
931
932 /*************************************************************************/
933 /* */
934 /* <Function> */
935 /* tt_face_load_os2 */
936 /* */
937 /* <Description> */
938 /* Loads the OS2 table. */
939 /* */
940 /* <Input> */
941 /* face :: A handle to the target face object. */
942 /* */
943 /* stream :: A handle to the input stream. */
944 /* */
945 /* <Return> */
946 /* FreeType error code. 0 means success. */
947 /* */
948 FT_LOCAL_DEF( FT_Error )
949 tt_face_load_os2( TT_Face face,
950 FT_Stream stream )
951 {
952 FT_Error error;
953 TT_OS2* os2;
954
955 const FT_Frame_Field os2_fields[] =
956 {
957 #undef FT_STRUCTURE
958 #define FT_STRUCTURE TT_OS2
959
960 FT_FRAME_START( 78 ),
961 FT_FRAME_USHORT( version ),
962 FT_FRAME_SHORT ( xAvgCharWidth ),
963 FT_FRAME_USHORT( usWeightClass ),
964 FT_FRAME_USHORT( usWidthClass ),
965 FT_FRAME_SHORT ( fsType ),
966 FT_FRAME_SHORT ( ySubscriptXSize ),
967 FT_FRAME_SHORT ( ySubscriptYSize ),
968 FT_FRAME_SHORT ( ySubscriptXOffset ),
969 FT_FRAME_SHORT ( ySubscriptYOffset ),
970 FT_FRAME_SHORT ( ySuperscriptXSize ),
971 FT_FRAME_SHORT ( ySuperscriptYSize ),
972 FT_FRAME_SHORT ( ySuperscriptXOffset ),
973 FT_FRAME_SHORT ( ySuperscriptYOffset ),
974 FT_FRAME_SHORT ( yStrikeoutSize ),
975 FT_FRAME_SHORT ( yStrikeoutPosition ),
976 FT_FRAME_SHORT ( sFamilyClass ),
977 FT_FRAME_BYTE ( panose[0] ),
978 FT_FRAME_BYTE ( panose[1] ),
979 FT_FRAME_BYTE ( panose[2] ),
980 FT_FRAME_BYTE ( panose[3] ),
981 FT_FRAME_BYTE ( panose[4] ),
982 FT_FRAME_BYTE ( panose[5] ),
983 FT_FRAME_BYTE ( panose[6] ),
984 FT_FRAME_BYTE ( panose[7] ),
985 FT_FRAME_BYTE ( panose[8] ),
986 FT_FRAME_BYTE ( panose[9] ),
987 FT_FRAME_ULONG ( ulUnicodeRange1 ),
988 FT_FRAME_ULONG ( ulUnicodeRange2 ),
989 FT_FRAME_ULONG ( ulUnicodeRange3 ),
990 FT_FRAME_ULONG ( ulUnicodeRange4 ),
991 FT_FRAME_BYTE ( achVendID[0] ),
992 FT_FRAME_BYTE ( achVendID[1] ),
993 FT_FRAME_BYTE ( achVendID[2] ),
994 FT_FRAME_BYTE ( achVendID[3] ),
995
996 FT_FRAME_USHORT( fsSelection ),
997 FT_FRAME_USHORT( usFirstCharIndex ),
998 FT_FRAME_USHORT( usLastCharIndex ),
999 FT_FRAME_SHORT ( sTypoAscender ),
1000 FT_FRAME_SHORT ( sTypoDescender ),
1001 FT_FRAME_SHORT ( sTypoLineGap ),
1002 FT_FRAME_USHORT( usWinAscent ),
1003 FT_FRAME_USHORT( usWinDescent ),
1004 FT_FRAME_END
1005 };
1006
1007 const FT_Frame_Field os2_fields_extra[] =
1008 {
1009 FT_FRAME_START( 8 ),
1010 FT_FRAME_ULONG( ulCodePageRange1 ),
1011 FT_FRAME_ULONG( ulCodePageRange2 ),
1012 FT_FRAME_END
1013 };
1014
1015 const FT_Frame_Field os2_fields_extra2[] =
1016 {
1017 FT_FRAME_START( 10 ),
1018 FT_FRAME_SHORT ( sxHeight ),
1019 FT_FRAME_SHORT ( sCapHeight ),
1020 FT_FRAME_USHORT( usDefaultChar ),
1021 FT_FRAME_USHORT( usBreakChar ),
1022 FT_FRAME_USHORT( usMaxContext ),
1023 FT_FRAME_END
1024 };
1025
1026
1027 /* We now support old Mac fonts where the OS/2 table doesn't */
1028 /* exist. Simply put, we set the `version' field to 0xFFFF */
1029 /* and test this value each time we need to access the table. */
1030 error = face->goto_table( face, TTAG_OS2, stream, 0 );
1031 if ( error )
1032 goto Exit;
1033
1034 os2 = &face->os2;
1035
1036 if ( FT_STREAM_READ_FIELDS( os2_fields, os2 ) )
1037 goto Exit;
1038
1039 os2->ulCodePageRange1 = 0;
1040 os2->ulCodePageRange2 = 0;
1041 os2->sxHeight = 0;
1042 os2->sCapHeight = 0;
1043 os2->usDefaultChar = 0;
1044 os2->usBreakChar = 0;
1045 os2->usMaxContext = 0;
1046
1047 if ( os2->version >= 0x0001 )
1048 {
1049 /* only version 1 tables */
1050 if ( FT_STREAM_READ_FIELDS( os2_fields_extra, os2 ) )
1051 goto Exit;
1052
1053 if ( os2->version >= 0x0002 )
1054 {
1055 /* only version 2 tables */
1056 if ( FT_STREAM_READ_FIELDS( os2_fields_extra2, os2 ) )
1057 goto Exit;
1058 }
1059 }
1060
1061 FT_TRACE3(( "sTypoAscender: %4d\n", os2->sTypoAscender ));
1062 FT_TRACE3(( "sTypoDescender: %4d\n", os2->sTypoDescender ));
1063 FT_TRACE3(( "usWinAscent: %4u\n", os2->usWinAscent ));
1064 FT_TRACE3(( "usWinDescent: %4u\n", os2->usWinDescent ));
1065 FT_TRACE3(( "fsSelection: 0x%2x\n", os2->fsSelection ));
1066
1067 Exit:
1068 return error;
1069 }
1070
1071
1072 /*************************************************************************/
1073 /* */
1074 /* <Function> */
1075 /* tt_face_load_postscript */
1076 /* */
1077 /* <Description> */
1078 /* Loads the Postscript table. */
1079 /* */
1080 /* <Input> */
1081 /* face :: A handle to the target face object. */
1082 /* */
1083 /* stream :: A handle to the input stream. */
1084 /* */
1085 /* <Return> */
1086 /* FreeType error code. 0 means success. */
1087 /* */
1088 FT_LOCAL_DEF( FT_Error )
1089 tt_face_load_post( TT_Face face,
1090 FT_Stream stream )
1091 {
1092 FT_Error error;
1093 TT_Postscript* post = &face->postscript;
1094
1095 static const FT_Frame_Field post_fields[] =
1096 {
1097 #undef FT_STRUCTURE
1098 #define FT_STRUCTURE TT_Postscript
1099
1100 FT_FRAME_START( 32 ),
1101 FT_FRAME_ULONG( FormatType ),
1102 FT_FRAME_ULONG( italicAngle ),
1103 FT_FRAME_SHORT( underlinePosition ),
1104 FT_FRAME_SHORT( underlineThickness ),
1105 FT_FRAME_ULONG( isFixedPitch ),
1106 FT_FRAME_ULONG( minMemType42 ),
1107 FT_FRAME_ULONG( maxMemType42 ),
1108 FT_FRAME_ULONG( minMemType1 ),
1109 FT_FRAME_ULONG( maxMemType1 ),
1110 FT_FRAME_END
1111 };
1112
1113
1114 error = face->goto_table( face, TTAG_post, stream, 0 );
1115 if ( error )
1116 return error;
1117
1118 if ( FT_STREAM_READ_FIELDS( post_fields, post ) )
1119 return error;
1120
1121 /* we don't load the glyph names, we do that in another */
1122 /* module (ttpost). */
1123
1124 FT_TRACE3(( "FormatType: 0x%x\n", post->FormatType ));
1125 FT_TRACE3(( "isFixedPitch: %s\n", post->isFixedPitch
1126 ? " yes" : " no" ));
1127
1128 return SFNT_Err_Ok;
1129 }
1130
1131
1132 /*************************************************************************/
1133 /* */
1134 /* <Function> */
1135 /* tt_face_load_pclt */
1136 /* */
1137 /* <Description> */
1138 /* Loads the PCL 5 Table. */
1139 /* */
1140 /* <Input> */
1141 /* face :: A handle to the target face object. */
1142 /* */
1143 /* stream :: A handle to the input stream. */
1144 /* */
1145 /* <Return> */
1146 /* FreeType error code. 0 means success. */
1147 /* */
1148 FT_LOCAL_DEF( FT_Error )
1149 tt_face_load_pclt( TT_Face face,
1150 FT_Stream stream )
1151 {
1152 static const FT_Frame_Field pclt_fields[] =
1153 {
1154 #undef FT_STRUCTURE
1155 #define FT_STRUCTURE TT_PCLT
1156
1157 FT_FRAME_START( 54 ),
1158 FT_FRAME_ULONG ( Version ),
1159 FT_FRAME_ULONG ( FontNumber ),
1160 FT_FRAME_USHORT( Pitch ),
1161 FT_FRAME_USHORT( xHeight ),
1162 FT_FRAME_USHORT( Style ),
1163 FT_FRAME_USHORT( TypeFamily ),
1164 FT_FRAME_USHORT( CapHeight ),
1165 FT_FRAME_BYTES ( TypeFace, 16 ),
1166 FT_FRAME_BYTES ( CharacterComplement, 8 ),
1167 FT_FRAME_BYTES ( FileName, 6 ),
1168 FT_FRAME_CHAR ( StrokeWeight ),
1169 FT_FRAME_CHAR ( WidthType ),
1170 FT_FRAME_BYTE ( SerifStyle ),
1171 FT_FRAME_BYTE ( Reserved ),
1172 FT_FRAME_END
1173 };
1174
1175 FT_Error error;
1176 TT_PCLT* pclt = &face->pclt;
1177
1178
1179 /* optional table */
1180 error = face->goto_table( face, TTAG_PCLT, stream, 0 );
1181 if ( error )
1182 goto Exit;
1183
1184 if ( FT_STREAM_READ_FIELDS( pclt_fields, pclt ) )
1185 goto Exit;
1186
1187 Exit:
1188 return error;
1189 }
1190
1191
1192 /*************************************************************************/
1193 /* */
1194 /* <Function> */
1195 /* tt_face_load_gasp */
1196 /* */
1197 /* <Description> */
1198 /* Loads the `gasp' table into a face object. */
1199 /* */
1200 /* <Input> */
1201 /* face :: A handle to the target face object. */
1202 /* */
1203 /* stream :: The input stream. */
1204 /* */
1205 /* <Return> */
1206 /* FreeType error code. 0 means success. */
1207 /* */
1208 FT_LOCAL_DEF( FT_Error )
1209 tt_face_load_gasp( TT_Face face,
1210 FT_Stream stream )
1211 {
1212 FT_Error error;
1213 FT_Memory memory = stream->memory;
1214
1215 FT_UInt j,num_ranges;
1216 TT_GaspRange gaspranges = NULL;
1217
1218
1219 /* the gasp table is optional */
1220 error = face->goto_table( face, TTAG_gasp, stream, 0 );
1221 if ( error )
1222 goto Exit;
1223
1224 if ( FT_FRAME_ENTER( 4L ) )
1225 goto Exit;
1226
1227 face->gasp.version = FT_GET_USHORT();
1228 face->gasp.numRanges = FT_GET_USHORT();
1229
1230 FT_FRAME_EXIT();
1231
1232 /* only support versions 0 and 1 of the table */
1233 if ( face->gasp.version >= 2 )
1234 {
1235 face->gasp.numRanges = 0;
1236 error = SFNT_Err_Invalid_Table;
1237 goto Exit;
1238 }
1239
1240 num_ranges = face->gasp.numRanges;
1241 FT_TRACE3(( "numRanges: %u\n", num_ranges ));
1242
1243 if ( FT_QNEW_ARRAY( gaspranges, num_ranges ) ||
1244 FT_FRAME_ENTER( num_ranges * 4L ) )
1245 goto Exit;
1246
1247 face->gasp.gaspRanges = gaspranges;
1248
1249 for ( j = 0; j < num_ranges; j++ )
1250 {
1251 gaspranges[j].maxPPEM = FT_GET_USHORT();
1252 gaspranges[j].gaspFlag = FT_GET_USHORT();
1253
1254 FT_TRACE3(( "gaspRange %d: rangeMaxPPEM %5d, rangeGaspBehavior 0x%x\n",
1255 j,
1256 gaspranges[j].maxPPEM,
1257 gaspranges[j].gaspFlag ));
1258 }
1259
1260 FT_FRAME_EXIT();
1261
1262 Exit:
1263 return error;
1264 }
1265
1266
1267 /* END */
table
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glew.h:4422
FT_Error
int FT_Error
Definition: fttypes.h:296
tt_face_load_head
tt_face_load_head(TT_Face face, FT_Stream stream)
Definition: ttload.c:585
FT_FRAME_LONG
#define FT_FRAME_LONG(f)
Definition: ftstream.h:120
TT_Header
FT_BEGIN_HEADER struct TT_Header_ TT_Header
FT_Long
signed long FT_Long
Definition: fttypes.h:238
header
cannot open resource broken file module version is too low unimplemented feature broken offset within table missing module invalid character code cannot render this glyph format invalid composite glyph invalid pixel size invalid library handle invalid face handle invalid glyph slot handle invalid cache manager handle too many modules out of memory cannot open stream invalid stream skip invalid stream operation nested frame access raster uninitialized raster overflow too many registered caches too few arguments code overflow division by zero found debug opcode nested DEFS execution context too long too many instruction definitions horizontal header(hhea) table missing" ) FT_ERRORDEF_( Locations_Missing
FT_ULong
unsigned long FT_ULong
Definition: fttypes.h:249
FT_StreamRec_::size
unsigned long size
Definition: ftsystem.h:324
TT_Postscript_::isFixedPitch
FT_ULong isFixedPitch
Definition: tttables.h:420
TT_MaxProfile_::maxPoints
FT_UShort maxPoints
Definition: tttables.h:532
TT_OS2_::version
FT_UShort version
Definition: tttables.h:352
TT_Postscript_
Definition: tttables.h:414
NULL
#define NULL
Definition: ftobjs.h:61
TT_OS2_::usMaxContext
FT_UShort usMaxContext
Definition: tttables.h:398
TT_OS2_::sTypoDescender
FT_Short sTypoDescender
Definition: tttables.h:382
FT_Int
signed int FT_Int
Definition: fttypes.h:216
TT_NameTableRec_::storageOffset
FT_UInt storageOffset
Definition: tttypes.h:242
FT_Frame_Field_
Definition: ftstream.h:86
TT_MaxProfile_::maxComponentDepth
FT_UShort maxComponentDepth
Definition: tttables.h:544
SFNT_HeaderRec_::search_range
FT_UShort search_range
Definition: tttypes.h:103
stream
GLuint GLuint stream
Definition: glew.h:6573
TT_TableRec_::Offset
FT_ULong Offset
Definition: tttypes.h:134
TT_MaxProfile_::maxContours
FT_UShort maxContours
Definition: tttables.h:533
FT_Char
signed char FT_Char
Definition: fttypes.h:139
tt_face_load_font_dir
tt_face_load_font_dir(TT_Face face, FT_Stream stream)
Definition: ttload.c:320
tt_face_load_pclt
tt_face_load_pclt(TT_Face face, FT_Stream stream)
Definition: ttload.c:1149
TT_NameEntryRec_::stringLength
FT_UShort stringLength
Definition: tttypes.h:207
TTAG_maxp
#define TTAG_maxp
Definition: tttags.h:74
j
int32_t j
Definition: e_log.c:102
FT_QNEW_ARRAY
#define FT_QNEW_ARRAY(ptr, count)
Definition: ftmemory.h:299
version
int const char * version
Definition: zlib.h:813
tt_face_load_gasp
tt_face_load_gasp(TT_Face face, FT_Stream stream)
Definition: ttload.c:1209
TT_NameTableRec_::stream
FT_Stream stream
Definition: tttypes.h:244
SFNT_HeaderRec_::range_shift
FT_UShort range_shift
Definition: tttypes.h:105
tt_face_free_name
tt_face_free_name(TT_Face face)
Definition: ttload.c:868
FT_FRAME_BYTES
#define FT_FRAME_BYTES(field, count)
Definition: ftstream.h:140
TT_NameTableRec_::numNameRecords
FT_UInt numNameRecords
Definition: tttypes.h:241
TT_MaxProfile_::maxInstructionDefs
FT_UShort maxInstructionDefs
Definition: tttables.h:540
TT_OS2_::ulCodePageRange1
FT_ULong ulCodePageRange1
Definition: tttables.h:389
TTAG_SING
#define TTAG_SING
Definition: tttags.h:90
TT_MaxProfile_::numGlyphs
FT_UShort numGlyphs
Definition: tttables.h:531
TT_NameEntryRec_::stringOffset
FT_ULong stringOffset
Definition: tttypes.h:208
TT_FaceRec_::goto_table
TT_Loader_GotoTableFunc goto_table
Definition: tttypes.h:1288
TT_OS2_::fsSelection
FT_UShort fsSelection
Definition: tttables.h:378
TT_NameEntryRec_
Definition: tttypes.h:201
yMin
bbox yMin
Definition: ftbbox.c:603
TT_OS2_::usBreakChar
FT_UShort usBreakChar
Definition: tttables.h:397
FT_Bool
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:104
tt_face_load_any
tt_face_load_any(TT_Face face, FT_ULong tag, FT_Long offset, FT_Byte *buffer, FT_ULong *length)
Definition: ttload.c:465
FT_ERROR
#define FT_ERROR(varformat)
Definition: ftdebug.h:181
FT_GET_TAG4
#define FT_GET_TAG4()
Definition: ftstream.h:301
TT_MaxProfile_::version
FT_Fixed version
Definition: tttables.h:530
FT_Byte
unsigned char FT_Byte
Definition: fttypes.h:150
TT_MaxProfile_::maxComponentElements
FT_UShort maxComponentElements
Definition: tttables.h:543
TT_MaxProfile_::maxFunctionDefs
FT_UShort maxFunctionDefs
Definition: tttables.h:539
FT_TRACE4
#define FT_TRACE4(varformat)
Definition: ftdebug.h:161
SFNT_HeaderRec_::num_tables
FT_UShort num_tables
Definition: tttypes.h:102
tt_face_load_cmap
tt_face_load_cmap(TT_Face face, FT_Stream stream)
Definition: ttload.c:913
buffer
EGLContext EGLenum EGLClientBuffer buffer
Definition: eglext.h:87
FT_STREAM_READ_FIELDS
#define FT_STREAM_READ_FIELDS(fields, object)
Definition: ftstream.h:513
check_table_dir
static FT_Error check_table_dir(SFNT_Header sfnt, FT_Stream stream)
Definition: ttload.c:170
tt_face_load_maxp
tt_face_load_maxp(TT_Face face, FT_Stream stream)
Definition: ttload.c:621
TT_MaxProfile_
Definition: tttables.h:528
FT_GET_USHORT
#define FT_GET_USHORT()
Definition: ftstream.h:296
FT_FREE
#define FT_FREE(ptr)
Definition: ftmemory.h:286
tt_face_load_generic_header
static FT_Error tt_face_load_generic_header(TT_Face face, FT_Stream stream, FT_ULong tag)
Definition: ttload.c:531
FT_FRAME_END
#define FT_FRAME_END
Definition: ftstream.h:118
TT_OS2_::usWinAscent
FT_UShort usWinAscent
Definition: tttables.h:384
TT_MaxProfile_::maxZones
FT_UShort maxZones
Definition: tttables.h:536
FT_FRAME_USHORT
#define FT_FRAME_USHORT(f)
Definition: ftstream.h:123
FT_LOCAL_DEF
#define FT_LOCAL_DEF(x)
Definition: ftconfig.h:467
length
GLsizei GLsizei * length
Definition: gl2ext.h:792
TT_NameTableRec_::format
FT_UShort format
Definition: tttypes.h:240
error
FT_Error error
Definition: cffdrivr.c:407
FT_STREAM_READ_AT
#define FT_STREAM_READ_AT(position, buffer, count)
Definition: ftstream.h:507
TTAG_PCLT
#define TTAG_PCLT
Definition: tttags.h:84
FT_READ_ULONG
#define FT_READ_ULONG(var)
Definition: ftstream.h:320
FT_TRACE0
#define FT_TRACE0(varformat)
Definition: ftdebug.h:157
TT_TableRec_::Tag
FT_ULong Tag
Definition: tttypes.h:132
count
GLint GLsizei count
Definition: gl2ext.h:1011
face
GLenum face
Definition: gl2ext.h:1490
sferrors.h
TT_MaxProfile_::maxStackElements
FT_UShort maxStackElements
Definition: tttables.h:541
TT_TableRec_::CheckSum
FT_ULong CheckSum
Definition: tttypes.h:133
FT_TRACE2
#define FT_TRACE2(varformat)
Definition: ftdebug.h:159
TT_NameTableRec_
Definition: tttypes.h:238
TT_TableRec_
Definition: tttypes.h:130
TT_MaxProfile_::maxSizeOfInstructions
FT_UShort maxSizeOfInstructions
Definition: tttables.h:542
TT_MaxProfile_::maxCompositePoints
FT_UShort maxCompositePoints
Definition: tttables.h:534
TT_OS2_::ulCodePageRange2
FT_ULong ulCodePageRange2
Definition: tttables.h:390
TT_TableRec_::Length
FT_ULong Length
Definition: tttypes.h:135
format
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl2ext.h:845
TT_PCLT_
Definition: tttables.h:441
limit
GLint limit
Definition: glew.h:11829
TT_OS2_::usWinDescent
FT_UShort usWinDescent
Definition: tttables.h:385
TTAG_cmap
#define TTAG_cmap
Definition: tttags.h:45
numGlyphs
GLenum const void GLbitfield GLuint GLsizei numGlyphs
Definition: glew.h:12411
TTAG_bhed
#define TTAG_bhed
Definition: tttags.h:40
TTAG_gasp
#define TTAG_gasp
Definition: tttags.h:56
TT_NameTableRec_::names
TT_NameEntryRec * names
Definition: tttypes.h:243
FALSE
#define FALSE
Definition: ftobjs.h:57
TT_OS2_::sCapHeight
FT_Short sCapHeight
Definition: tttables.h:395
SFNT_HeaderRec_::format_tag
FT_ULong format_tag
Definition: tttypes.h:101
FT_Memory
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
TT_MaxProfile_::maxStorage
FT_UShort maxStorage
Definition: tttables.h:538
TT_FaceRec_::header
TT_Header header
Definition: tttypes.h:1268
FT_FRAME_EXIT
#define FT_FRAME_EXIT()
Definition: ftstream.h:521
FT_NEW_ARRAY
#define FT_NEW_ARRAY(ptr, count)
Definition: ftmemory.h:290
FT_STREAM_SEEK
#define FT_STREAM_SEEK(position)
Definition: ftstream.h:496
SFNT_HeaderRec_::entry_selector
FT_UShort entry_selector
Definition: tttypes.h:104
FT_TRACE3
#define FT_TRACE3(varformat)
Definition: ftdebug.h:160
TT_OS2_
Definition: tttables.h:350
FT_STREAM_POS
#define FT_STREAM_POS()
Definition: ftstream.h:493
TTAG_name
#define TTAG_name
Definition: tttags.h:80
ft2build.h
offset
GLintptr offset
Definition: glew.h:1668
FT_FRAME_ULONG
#define FT_FRAME_ULONG(f)
Definition: ftstream.h:121
TT_OS2_::sTypoAscender
FT_Short sTypoAscender
Definition: tttables.h:381
FT_UInt
unsigned int FT_UInt
Definition: fttypes.h:227
TT_GaspRangeRec_
Definition: tttypes.h:277
FT_FRAME_BYTE
#define FT_FRAME_BYTE(f)
Definition: ftstream.h:126
tt_face_load_os2
tt_face_load_os2(TT_Face face, FT_Stream stream)
Definition: ttload.c:949
FT_FRAME_CHAR
#define FT_FRAME_CHAR(f)
Definition: ftstream.h:127
SFNT_HeaderRec_::offset
FT_ULong offset
Definition: tttypes.h:107
TT_OS2_::sxHeight
FT_Short sxHeight
Definition: tttables.h:394
FT_FRAME_EXTRACT
#define FT_FRAME_EXTRACT(size, bytes)
Definition: ftstream.h:524
TTAG_OS2
#define TTAG_OS2
Definition: tttags.h:82
tt_face_lookup_table
tt_face_lookup_table(TT_Face face, FT_ULong tag)
Definition: ttload.c:57
FT_GET_ULONG
#define FT_GET_ULONG()
Definition: ftstream.h:300
TT_MaxProfile_::maxCompositeContours
FT_UShort maxCompositeContours
Definition: tttables.h:535
TTAG_head
#define TTAG_head
Definition: tttags.h:63
FT_FRAME_ENTER
#define FT_FRAME_ENTER(size)
Definition: ftstream.h:517
xMin
bbox xMin
Definition: ftbbox.c:602
tt_face_load_name
tt_face_load_name(TT_Face face, FT_Stream stream)
Definition: ttload.c:738
TT_MaxProfile_::maxTwilightPoints
FT_UShort maxTwilightPoints
Definition: tttables.h:537
FT_GET_LONG
#define FT_GET_LONG()
Definition: ftstream.h:299
FT_UShort
unsigned short FT_UShort
Definition: fttypes.h:205
FT_StreamRec_
Definition: ftsystem.h:321
tt_face_load_post
tt_face_load_post(TT_Face face, FT_Stream stream)
Definition: ttload.c:1089
TT_FaceRec_
Definition: tttypes.h:1258
FT_FRAME_SHORT
#define FT_FRAME_SHORT(f)
Definition: ftstream.h:122
TRUE
#define TRUE
Definition: ftobjs.h:53
ttload.h
TT_OS2_::usDefaultChar
FT_UShort usDefaultChar
Definition: tttables.h:396
tt_face_goto_table
tt_face_goto_table(TT_Face face, FT_ULong tag, FT_Stream stream, FT_ULong *length)
Definition: ttload.c:127
TTAG_META
#define TTAG_META
Definition: tttags.h:75
TT_GaspRangeRec_::maxPPEM
FT_UShort maxPPEM
Definition: tttypes.h:279
FT_FRAME_START
#define FT_FRAME_START(size)
Definition: ftstream.h:117
TT_GaspRangeRec_::gaspFlag
FT_UShort gaspFlag
Definition: tttypes.h:280
TT_NameEntryRec_::string
FT_Byte * string
Definition: tttypes.h:213
TTAG_post
#define TTAG_post
Definition: tttags.h:86
SFNT_HeaderRec_
Definition: tttypes.h:99
TT_Postscript_::FormatType
FT_Fixed FormatType
Definition: tttables.h:416
size
GLsizei size
Definition: gl2ext.h:1467