ReactOS 0.4.16-dev-2332-g4cba65d
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 (C) 1996-2020 by
9 * David Turner, Robert Wilhelm, and Werner Lemberg.
10 *
11 * This file is part of the FreeType project, and may only be used,
12 * modified, and distributed under the terms of the FreeType project
13 * license, LICENSE.TXT. By continuing to use, modify, or distribute
14 * this file you indicate that you have read the license and
15 * understand and accept it fully.
16 *
17 */
18
19
22#include <freetype/tttags.h>
23#include "ttload.h"
24
25#include "sferrors.h"
26
27
28 /**************************************************************************
29 *
30 * The macro FT_COMPONENT is used in trace mode. It is an implicit
31 * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
32 * messages during execution.
33 */
34#undef FT_COMPONENT
35#define FT_COMPONENT ttload
36
37
38 /**************************************************************************
39 *
40 * @Function:
41 * tt_face_lookup_table
42 *
43 * @Description:
44 * Looks for a TrueType table by name.
45 *
46 * @Input:
47 * face ::
48 * A face object handle.
49 *
50 * tag ::
51 * The searched tag.
52 *
53 * @Return:
54 * A pointer to the table directory entry. 0 if not found.
55 */
59 {
62#ifdef FT_DEBUG_LEVEL_TRACE
63 FT_Bool zero_length = FALSE;
64#endif
65
66
67 FT_TRACE4(( "tt_face_lookup_table: %p, `%c%c%c%c' -- ",
68 (void *)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 ::
115 * A face object handle.
116 *
117 * tag ::
118 * The searched tag.
119 *
120 * stream ::
121 * The stream to seek when the table is found.
122 *
123 * @Output:
124 * length ::
125 * The length of the table if found, undefined otherwise.
126 *
127 * @Return:
128 * FreeType error code. 0 means success.
129 */
135 {
138
139
141 if ( table )
142 {
143 if ( length )
144 *length = table->Length;
145
146 if ( FT_STREAM_SEEK( table->Offset ) )
147 goto Exit;
148 }
149 else
150 error = FT_THROW( Table_Missing );
151
152 Exit:
153 return error;
154 }
155
156
157 /* Here, we */
158 /* */
159 /* - check that `num_tables' is valid (and adjust it if necessary); */
160 /* also return the number of valid table entries */
161 /* */
162 /* - look for a `head' table, check its size, and parse it to check */
163 /* whether its `magic' field is correctly set */
164 /* */
165 /* - errors (except errors returned by stream handling) */
166 /* */
167 /* SFNT_Err_Unknown_File_Format: */
168 /* no table is defined in directory, it is not sfnt-wrapped */
169 /* data */
170 /* SFNT_Err_Table_Missing: */
171 /* table directory is valid, but essential tables */
172 /* (head/bhed/SING) are missing */
173 /* */
174 static FT_Error
178 {
180 FT_UShort nn, valid_entries = 0;
181 FT_UInt has_head = 0, has_sing = 0, has_meta = 0;
182 FT_ULong offset = sfnt->offset + 12;
183
184 static const FT_Frame_Field table_dir_entry_fields[] =
185 {
186#undef FT_STRUCTURE
187#define FT_STRUCTURE TT_TableRec
188
189 FT_FRAME_START( 16 ),
191 FT_FRAME_ULONG( CheckSum ),
195 };
196
197
198 if ( FT_STREAM_SEEK( offset ) )
199 goto Exit;
200
201 for ( nn = 0; nn < sfnt->num_tables; nn++ )
202 {
204
205
206 if ( FT_STREAM_READ_FIELDS( table_dir_entry_fields, &table ) )
207 {
208 nn--;
209 FT_TRACE2(( "check_table_dir:"
210 " can read only %d table%s in font (instead of %d)\n",
211 nn, nn == 1 ? "" : "s", sfnt->num_tables ));
212 sfnt->num_tables = nn;
213 break;
214 }
215
216 /* we ignore invalid tables */
217
218 if ( table.Offset > stream->size )
219 {
220 FT_TRACE2(( "check_table_dir: table entry %d invalid\n", nn ));
221 continue;
222 }
223 else if ( table.Length > stream->size - table.Offset )
224 {
225 /* Some tables have such a simple structure that clipping its */
226 /* contents is harmless. This also makes FreeType less sensitive */
227 /* to invalid table lengths (which programs like Acroread seem to */
228 /* ignore in general). */
229
230 if ( table.Tag == TTAG_hmtx ||
231 table.Tag == TTAG_vmtx )
232 valid_entries++;
233 else
234 {
235 FT_TRACE2(( "check_table_dir: table entry %d invalid\n", nn ));
236 continue;
237 }
238 }
239 else
240 valid_entries++;
241
242 if ( table.Tag == TTAG_head || table.Tag == TTAG_bhed )
243 {
244 FT_UInt32 magic;
245
246
247#ifndef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
248 if ( table.Tag == TTAG_head )
249#endif
250 has_head = 1;
251
252 /*
253 * The table length should be 0x36, but certain font tools make it
254 * 0x38, so we will just check that it is greater.
255 *
256 * Note that according to the specification, the table must be
257 * padded to 32-bit lengths, but this doesn't apply to the value of
258 * its `Length' field!
259 *
260 */
261 if ( table.Length < 0x36 )
262 {
263 FT_TRACE2(( "check_table_dir:"
264 " `head' or `bhed' table too small\n" ));
265 error = FT_THROW( Table_Missing );
266 goto Exit;
267 }
268
269 if ( FT_STREAM_SEEK( table.Offset + 12 ) ||
270 FT_READ_ULONG( magic ) )
271 goto Exit;
272
273 if ( magic != 0x5F0F3CF5UL )
274 FT_TRACE2(( "check_table_dir:"
275 " invalid magic number in `head' or `bhed' table\n"));
276
277 if ( FT_STREAM_SEEK( offset + ( nn + 1 ) * 16 ) )
278 goto Exit;
279 }
280 else if ( table.Tag == TTAG_SING )
281 has_sing = 1;
282 else if ( table.Tag == TTAG_META )
283 has_meta = 1;
284 }
285
286 *valid = valid_entries;
287
288 if ( !valid_entries )
289 {
290 FT_TRACE2(( "check_table_dir: no valid tables found\n" ));
291 error = FT_THROW( Unknown_File_Format );
292 goto Exit;
293 }
294
295 /* if `sing' and `meta' tables are present, there is no `head' table */
296 if ( has_head || ( has_sing && has_meta ) )
297 {
299 goto Exit;
300 }
301 else
302 {
303 FT_TRACE2(( "check_table_dir:" ));
304#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
305 FT_TRACE2(( " neither `head', `bhed', nor `sing' table found\n" ));
306#else
307 FT_TRACE2(( " neither `head' nor `sing' table found\n" ));
308#endif
309 error = FT_THROW( Table_Missing );
310 }
311
312 Exit:
313 return error;
314 }
315
316
317 /**************************************************************************
318 *
319 * @Function:
320 * tt_face_load_font_dir
321 *
322 * @Description:
323 * Loads the header of a SFNT font file.
324 *
325 * @Input:
326 * face ::
327 * A handle to the target face object.
328 *
329 * stream ::
330 * The input stream.
331 *
332 * @Output:
333 * sfnt ::
334 * The SFNT header.
335 *
336 * @Return:
337 * FreeType error code. 0 means success.
338 *
339 * @Note:
340 * The stream cursor must be at the beginning of the font directory.
341 */
345 {
348 FT_Memory memory = stream->memory;
349 FT_UShort nn, valid_entries = 0;
350
351 static const FT_Frame_Field offset_table_fields[] =
352 {
353#undef FT_STRUCTURE
354#define FT_STRUCTURE SFNT_HeaderRec
355
356 FT_FRAME_START( 8 ),
357 FT_FRAME_USHORT( num_tables ),
358 FT_FRAME_USHORT( search_range ),
359 FT_FRAME_USHORT( entry_selector ),
360 FT_FRAME_USHORT( range_shift ),
362 };
363
364
365 FT_TRACE2(( "tt_face_load_font_dir: %p\n", (void *)face ));
366
367 /* read the offset table */
368
369 sfnt.offset = FT_STREAM_POS();
370
371 if ( FT_READ_ULONG( sfnt.format_tag ) ||
372 FT_STREAM_READ_FIELDS( offset_table_fields, &sfnt ) )
373 goto Exit;
374
375 /* many fonts don't have these fields set correctly */
376#if 0
377 if ( sfnt.search_range != 1 << ( sfnt.entry_selector + 4 ) ||
378 sfnt.search_range + sfnt.range_shift != sfnt.num_tables << 4 )
379 return FT_THROW( Unknown_File_Format );
380#endif
381
382 /* load the table directory */
383
384 FT_TRACE2(( "-- Number of tables: %10u\n", sfnt.num_tables ));
385 FT_TRACE2(( "-- Format version: 0x%08lx\n", sfnt.format_tag ));
386
387 if ( sfnt.format_tag != TTAG_OTTO )
388 {
389 /* check first */
390 error = check_table_dir( &sfnt, stream, &valid_entries );
391 if ( error )
392 {
393 FT_TRACE2(( "tt_face_load_font_dir:"
394 " invalid table directory for TrueType\n" ));
395 goto Exit;
396 }
397 }
398 else
399 {
400 valid_entries = sfnt.num_tables;
401 if ( !valid_entries )
402 {
403 FT_TRACE2(( "tt_face_load_font_dir: no valid tables found\n" ));
404 error = FT_THROW( Unknown_File_Format );
405 goto Exit;
406 }
407 }
408
409 face->num_tables = valid_entries;
410 face->format_tag = sfnt.format_tag;
411
412 if ( FT_QNEW_ARRAY( face->dir_tables, face->num_tables ) )
413 goto Exit;
414
415 if ( FT_STREAM_SEEK( sfnt.offset + 12 ) ||
416 FT_FRAME_ENTER( sfnt.num_tables * 16L ) )
417 goto Exit;
418
419 FT_TRACE2(( "\n"
420 " tag offset length checksum\n"
421 " ----------------------------------\n" ));
422
423 valid_entries = 0;
424 for ( nn = 0; nn < sfnt.num_tables; nn++ )
425 {
427 FT_UShort i;
428 FT_Bool duplicate;
429
430
431 entry.Tag = FT_GET_TAG4();
432 entry.CheckSum = FT_GET_ULONG();
433 entry.Offset = FT_GET_ULONG();
434 entry.Length = FT_GET_ULONG();
435
436 /* ignore invalid tables that can't be sanitized */
437
438 if ( entry.Offset > stream->size )
439 continue;
440 else if ( entry.Length > stream->size - entry.Offset )
441 {
442 if ( entry.Tag == TTAG_hmtx ||
443 entry.Tag == TTAG_vmtx )
444 {
445#ifdef FT_DEBUG_LEVEL_TRACE
446 FT_ULong old_length = entry.Length;
447#endif
448
449
450 /* make metrics table length a multiple of 4 */
451 entry.Length = ( stream->size - entry.Offset ) & ~3U;
452
453 FT_TRACE2(( " %c%c%c%c %08lx %08lx %08lx"
454 " (sanitized; original length %08lx)",
455 (FT_Char)( entry.Tag >> 24 ),
456 (FT_Char)( entry.Tag >> 16 ),
457 (FT_Char)( entry.Tag >> 8 ),
458 (FT_Char)( entry.Tag ),
459 entry.Offset,
460 entry.Length,
461 entry.CheckSum,
462 old_length ));
463 }
464 else
465 continue;
466 }
467#ifdef FT_DEBUG_LEVEL_TRACE
468 else
469 FT_TRACE2(( " %c%c%c%c %08lx %08lx %08lx",
470 (FT_Char)( entry.Tag >> 24 ),
471 (FT_Char)( entry.Tag >> 16 ),
472 (FT_Char)( entry.Tag >> 8 ),
473 (FT_Char)( entry.Tag ),
474 entry.Offset,
475 entry.Length,
476 entry.CheckSum ));
477#endif
478
479 /* ignore duplicate tables – the first one wins */
480 duplicate = 0;
481 for ( i = 0; i < valid_entries; i++ )
482 {
483 if ( face->dir_tables[i].Tag == entry.Tag )
484 {
485 duplicate = 1;
486 break;
487 }
488 }
489 if ( duplicate )
490 {
491 FT_TRACE2(( " (duplicate, ignored)\n" ));
492 continue;
493 }
494 else
495 {
496 FT_TRACE2(( "\n" ));
497
498 /* we finally have a valid entry */
499 face->dir_tables[valid_entries++] = entry;
500 }
501 }
502
503 /* final adjustment to number of tables */
504 face->num_tables = valid_entries;
505
507
508 FT_TRACE2(( "table directory loaded\n\n" ));
509
510 Exit:
511 return error;
512 }
513
514
515 /**************************************************************************
516 *
517 * @Function:
518 * tt_face_load_any
519 *
520 * @Description:
521 * Loads any font table into client memory.
522 *
523 * @Input:
524 * face ::
525 * The face object to look for.
526 *
527 * tag ::
528 * The tag of table to load. Use the value 0 if you want
529 * to access the whole font file, else set this parameter
530 * to a valid TrueType table tag that you can forge with
531 * the MAKE_TT_TAG macro.
532 *
533 * offset ::
534 * The starting offset in the table (or the file if
535 * tag == 0).
536 *
537 * length ::
538 * The address of the decision variable:
539 *
540 * If length == NULL:
541 * Loads the whole table. Returns an error if
542 * `offset' == 0!
543 *
544 * If *length == 0:
545 * Exits immediately; returning the length of the given
546 * table or of the font file, depending on the value of
547 * `tag'.
548 *
549 * If *length != 0:
550 * Loads the next `length' bytes of table or font,
551 * starting at offset `offset' (in table or font too).
552 *
553 * @Output:
554 * buffer ::
555 * The address of target buffer.
556 *
557 * @Return:
558 * FreeType error code. 0 means success.
559 */
566 {
571
572
573 if ( tag != 0 )
574 {
575 /* look for tag in font directory */
577 if ( !table )
578 {
579 error = FT_THROW( Table_Missing );
580 goto Exit;
581 }
582
583 offset += table->Offset;
584 size = table->Length;
585 }
586 else
587 /* tag == 0 -- the user wants to access the font file directly */
588 size = face->root.stream->size;
589
590 if ( length && *length == 0 )
591 {
592 *length = size;
593
594 return FT_Err_Ok;
595 }
596
597 if ( length )
598 size = *length;
599
600 stream = face->root.stream;
601 /* the `if' is syntactic sugar for picky compilers */
603 goto Exit;
604
605 Exit:
606 return error;
607 }
608
609
610 /**************************************************************************
611 *
612 * @Function:
613 * tt_face_load_generic_header
614 *
615 * @Description:
616 * Loads the TrueType table `head' or `bhed'.
617 *
618 * @Input:
619 * face ::
620 * A handle to the target face object.
621 *
622 * stream ::
623 * The input stream.
624 *
625 * @Return:
626 * FreeType error code. 0 means success.
627 */
628 static FT_Error
631 FT_ULong tag )
632 {
635
636 static const FT_Frame_Field header_fields[] =
637 {
638#undef FT_STRUCTURE
639#define FT_STRUCTURE TT_Header
640
641 FT_FRAME_START( 54 ),
642 FT_FRAME_ULONG ( Table_Version ),
643 FT_FRAME_ULONG ( Font_Revision ),
644 FT_FRAME_LONG ( CheckSum_Adjust ),
645 FT_FRAME_LONG ( Magic_Number ),
647 FT_FRAME_USHORT( Units_Per_EM ),
648 FT_FRAME_ULONG ( Created[0] ),
649 FT_FRAME_ULONG ( Created[1] ),
650 FT_FRAME_ULONG ( Modified[0] ),
651 FT_FRAME_ULONG ( Modified[1] ),
652 FT_FRAME_SHORT ( xMin ),
653 FT_FRAME_SHORT ( yMin ),
654 FT_FRAME_SHORT ( xMax ),
655 FT_FRAME_SHORT ( yMax ),
656 FT_FRAME_USHORT( Mac_Style ),
657 FT_FRAME_USHORT( Lowest_Rec_PPEM ),
658 FT_FRAME_SHORT ( Font_Direction ),
659 FT_FRAME_SHORT ( Index_To_Loc_Format ),
660 FT_FRAME_SHORT ( Glyph_Data_Format ),
662 };
663
664
665 error = face->goto_table( face, tag, stream, 0 );
666 if ( error )
667 goto Exit;
668
669 header = &face->header;
670
671 if ( FT_STREAM_READ_FIELDS( header_fields, header ) )
672 goto Exit;
673
674 FT_TRACE3(( "Units per EM: %4u\n", header->Units_Per_EM ));
675 FT_TRACE3(( "IndexToLoc: %4d\n", header->Index_To_Loc_Format ));
676
677 Exit:
678 return error;
679 }
680
681
685 {
687 }
688
689
690#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
691
693 tt_face_load_bhed( TT_Face face,
695 {
697 }
698
699#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
700
701
702 /**************************************************************************
703 *
704 * @Function:
705 * tt_face_load_maxp
706 *
707 * @Description:
708 * Loads the maximum profile into a face object.
709 *
710 * @Input:
711 * face ::
712 * A handle to the target face object.
713 *
714 * stream ::
715 * The input stream.
716 *
717 * @Return:
718 * FreeType error code. 0 means success.
719 */
723 {
725 TT_MaxProfile* maxProfile = &face->max_profile;
726
727 static const FT_Frame_Field maxp_fields[] =
728 {
729#undef FT_STRUCTURE
730#define FT_STRUCTURE TT_MaxProfile
731
732 FT_FRAME_START( 6 ),
736 };
737
738 static const FT_Frame_Field maxp_fields_extra[] =
739 {
740 FT_FRAME_START( 26 ),
741 FT_FRAME_USHORT( maxPoints ),
742 FT_FRAME_USHORT( maxContours ),
743 FT_FRAME_USHORT( maxCompositePoints ),
744 FT_FRAME_USHORT( maxCompositeContours ),
745 FT_FRAME_USHORT( maxZones ),
746 FT_FRAME_USHORT( maxTwilightPoints ),
747 FT_FRAME_USHORT( maxStorage ),
748 FT_FRAME_USHORT( maxFunctionDefs ),
749 FT_FRAME_USHORT( maxInstructionDefs ),
750 FT_FRAME_USHORT( maxStackElements ),
751 FT_FRAME_USHORT( maxSizeOfInstructions ),
752 FT_FRAME_USHORT( maxComponentElements ),
753 FT_FRAME_USHORT( maxComponentDepth ),
755 };
756
757
758 error = face->goto_table( face, TTAG_maxp, stream, 0 );
759 if ( error )
760 goto Exit;
761
762 if ( FT_STREAM_READ_FIELDS( maxp_fields, maxProfile ) )
763 goto Exit;
764
765 maxProfile->maxPoints = 0;
766 maxProfile->maxContours = 0;
767 maxProfile->maxCompositePoints = 0;
768 maxProfile->maxCompositeContours = 0;
769 maxProfile->maxZones = 0;
770 maxProfile->maxTwilightPoints = 0;
771 maxProfile->maxStorage = 0;
772 maxProfile->maxFunctionDefs = 0;
773 maxProfile->maxInstructionDefs = 0;
774 maxProfile->maxStackElements = 0;
775 maxProfile->maxSizeOfInstructions = 0;
776 maxProfile->maxComponentElements = 0;
777 maxProfile->maxComponentDepth = 0;
778
779 if ( maxProfile->version >= 0x10000L )
780 {
781 if ( FT_STREAM_READ_FIELDS( maxp_fields_extra, maxProfile ) )
782 goto Exit;
783
784 /* XXX: an adjustment that is necessary to load certain */
785 /* broken fonts like `Keystrokes MT' :-( */
786 /* */
787 /* We allocate 64 function entries by default when */
788 /* the maxFunctionDefs value is smaller. */
789
790 if ( maxProfile->maxFunctionDefs < 64 )
791 maxProfile->maxFunctionDefs = 64;
792
793 /* we add 4 phantom points later */
794 if ( maxProfile->maxTwilightPoints > ( 0xFFFFU - 4 ) )
795 {
796 FT_TRACE0(( "tt_face_load_maxp:"
797 " too much twilight points in `maxp' table;\n"
798 " "
799 " some glyphs might be rendered incorrectly\n" ));
800
801 maxProfile->maxTwilightPoints = 0xFFFFU - 4;
802 }
803 }
804
805 FT_TRACE3(( "numGlyphs: %u\n", maxProfile->numGlyphs ));
806
807 Exit:
808 return error;
809 }
810
811
812 /**************************************************************************
813 *
814 * @Function:
815 * tt_face_load_name
816 *
817 * @Description:
818 * Loads the name records.
819 *
820 * @Input:
821 * face ::
822 * A handle to the target face object.
823 *
824 * stream ::
825 * The input stream.
826 *
827 * @Return:
828 * FreeType error code. 0 means success.
829 */
833 {
835 FT_Memory memory = stream->memory;
836 FT_ULong table_pos, table_len;
837 FT_ULong storage_start, storage_limit;
839
840 static const FT_Frame_Field name_table_fields[] =
841 {
842#undef FT_STRUCTURE
843#define FT_STRUCTURE TT_NameTableRec
844
845 FT_FRAME_START( 6 ),
847 FT_FRAME_USHORT( numNameRecords ),
848 FT_FRAME_USHORT( storageOffset ),
850 };
851
852 static const FT_Frame_Field name_record_fields[] =
853 {
854#undef FT_STRUCTURE
855#define FT_STRUCTURE TT_NameRec
856
857 /* no FT_FRAME_START */
858 FT_FRAME_USHORT( platformID ),
859 FT_FRAME_USHORT( encodingID ),
860 FT_FRAME_USHORT( languageID ),
861 FT_FRAME_USHORT( nameID ),
862 FT_FRAME_USHORT( stringLength ),
863 FT_FRAME_USHORT( stringOffset ),
865 };
866
867 static const FT_Frame_Field langTag_record_fields[] =
868 {
869#undef FT_STRUCTURE
870#define FT_STRUCTURE TT_LangTagRec
871
872 /* no FT_FRAME_START */
873 FT_FRAME_USHORT( stringLength ),
874 FT_FRAME_USHORT( stringOffset ),
876 };
877
878
879 table = &face->name_table;
880 table->stream = stream;
881
882 error = face->goto_table( face, TTAG_name, stream, &table_len );
883 if ( error )
884 goto Exit;
885
886 table_pos = FT_STREAM_POS();
887
888 if ( FT_STREAM_READ_FIELDS( name_table_fields, table ) )
889 goto Exit;
890
891 /* Some popular Asian fonts have an invalid `storageOffset' value (it */
892 /* should be at least `6 + 12*numNameRecords'). However, the string */
893 /* offsets, computed as `storageOffset + entry->stringOffset', are */
894 /* valid pointers within the name table... */
895 /* */
896 /* We thus can't check `storageOffset' right now. */
897 /* */
898 storage_start = table_pos + 6 + 12 * table->numNameRecords;
899 storage_limit = table_pos + table_len;
900
901 if ( storage_start > storage_limit )
902 {
903 FT_ERROR(( "tt_face_load_name: invalid `name' table\n" ));
904 error = FT_THROW( Name_Table_Missing );
905 goto Exit;
906 }
907
908 /* `name' format 1 contains additional language tag records, */
909 /* which we load first */
910 if ( table->format == 1 )
911 {
912 if ( FT_STREAM_SEEK( storage_start ) ||
913 FT_READ_USHORT( table->numLangTagRecords ) )
914 goto Exit;
915
916 storage_start += 2 + 4 * table->numLangTagRecords;
917
918 /* allocate language tag records array */
919 if ( FT_NEW_ARRAY( table->langTags, table->numLangTagRecords ) ||
920 FT_FRAME_ENTER( table->numLangTagRecords * 4 ) )
921 goto Exit;
922
923 /* load language tags */
924 {
925 TT_LangTag entry = table->langTags;
926 TT_LangTag limit = FT_OFFSET( entry, table->numLangTagRecords );
927
928
929 for ( ; entry < limit; entry++ )
930 {
931 (void)FT_STREAM_READ_FIELDS( langTag_record_fields, entry );
932
933 /* check that the langTag string is within the table */
934 entry->stringOffset += table_pos + table->storageOffset;
935 if ( entry->stringOffset < storage_start ||
936 entry->stringOffset + entry->stringLength > storage_limit )
937 {
938 /* invalid entry; ignore it */
939 entry->stringLength = 0;
940 }
941 }
942 }
943
945
946 (void)FT_STREAM_SEEK( table_pos + 6 );
947 }
948
949 /* allocate name records array */
950 if ( FT_NEW_ARRAY( table->names, table->numNameRecords ) ||
951 FT_FRAME_ENTER( table->numNameRecords * 12 ) )
952 goto Exit;
953
954 /* load name records */
955 {
956 TT_Name entry = table->names;
957 FT_UInt count = table->numNameRecords;
958
959
960 for ( ; count > 0; count-- )
961 {
962 if ( FT_STREAM_READ_FIELDS( name_record_fields, entry ) )
963 continue;
964
965 /* check that the name is not empty */
966 if ( entry->stringLength == 0 )
967 continue;
968
969 /* check that the name string is within the table */
970 entry->stringOffset += table_pos + table->storageOffset;
971 if ( entry->stringOffset < storage_start ||
972 entry->stringOffset + entry->stringLength > storage_limit )
973 {
974 /* invalid entry; ignore it */
975 continue;
976 }
977
978 /* assure that we have a valid language tag ID, and */
979 /* that the corresponding langTag entry is valid, too */
980 if ( table->format == 1 && entry->languageID >= 0x8000U )
981 {
982 if ( entry->languageID - 0x8000U >= table->numLangTagRecords ||
983 !table->langTags[entry->languageID - 0x8000U].stringLength )
984 {
985 /* invalid entry; ignore it */
986 continue;
987 }
988 }
989
990 entry++;
991 }
992
993 /* reduce array size to the actually used elements */
994 count = (FT_UInt)( entry - table->names );
995 (void)FT_RENEW_ARRAY( table->names,
996 table->numNameRecords,
997 count );
998 table->numNameRecords = count;
999 }
1000
1001 FT_FRAME_EXIT();
1002
1003 /* everything went well, update face->num_names */
1004 face->num_names = (FT_UShort)table->numNameRecords;
1005
1006 Exit:
1007 return error;
1008 }
1009
1010
1011 /**************************************************************************
1012 *
1013 * @Function:
1014 * tt_face_free_name
1015 *
1016 * @Description:
1017 * Frees the name records.
1018 *
1019 * @Input:
1020 * face ::
1021 * A handle to the target face object.
1022 */
1023 FT_LOCAL_DEF( void )
1025 {
1026 FT_Memory memory = face->root.driver->root.memory;
1027 TT_NameTable table = &face->name_table;
1028
1029
1030 if ( table->names )
1031 {
1032 TT_Name entry = table->names;
1033 TT_Name limit = entry + table->numNameRecords;
1034
1035
1036 for ( ; entry < limit; entry++ )
1037 FT_FREE( entry->string );
1038
1039 FT_FREE( table->names );
1040 }
1041
1042 if ( table->langTags )
1043 {
1044 TT_LangTag entry = table->langTags;
1045 TT_LangTag limit = entry + table->numLangTagRecords;
1046
1047
1048 for ( ; entry < limit; entry++ )
1049 FT_FREE( entry->string );
1050
1051 FT_FREE( table->langTags );
1052 }
1053
1054 table->numNameRecords = 0;
1055 table->numLangTagRecords = 0;
1056 table->format = 0;
1057 table->storageOffset = 0;
1058 }
1059
1060
1061 /**************************************************************************
1062 *
1063 * @Function:
1064 * tt_face_load_cmap
1065 *
1066 * @Description:
1067 * Loads the cmap directory in a face object. The cmaps themselves
1068 * are loaded on demand in the `ttcmap.c' module.
1069 *
1070 * @Input:
1071 * face ::
1072 * A handle to the target face object.
1073 *
1074 * stream ::
1075 * A handle to the input stream.
1076 *
1077 * @Return:
1078 * FreeType error code. 0 means success.
1079 */
1080
1084 {
1086
1087
1088 error = face->goto_table( face, TTAG_cmap, stream, &face->cmap_size );
1089 if ( error )
1090 goto Exit;
1091
1092 if ( FT_FRAME_EXTRACT( face->cmap_size, face->cmap_table ) )
1093 face->cmap_size = 0;
1094
1095 Exit:
1096 return error;
1097 }
1098
1099
1100
1101 /**************************************************************************
1102 *
1103 * @Function:
1104 * tt_face_load_os2
1105 *
1106 * @Description:
1107 * Loads the OS2 table.
1108 *
1109 * @Input:
1110 * face ::
1111 * A handle to the target face object.
1112 *
1113 * stream ::
1114 * A handle to the input stream.
1115 *
1116 * @Return:
1117 * FreeType error code. 0 means success.
1118 */
1122 {
1124 TT_OS2* os2;
1125
1126 static const FT_Frame_Field os2_fields[] =
1127 {
1128#undef FT_STRUCTURE
1129#define FT_STRUCTURE TT_OS2
1130
1131 FT_FRAME_START( 78 ),
1133 FT_FRAME_SHORT ( xAvgCharWidth ),
1134 FT_FRAME_USHORT( usWeightClass ),
1135 FT_FRAME_USHORT( usWidthClass ),
1136 FT_FRAME_SHORT ( fsType ),
1137 FT_FRAME_SHORT ( ySubscriptXSize ),
1138 FT_FRAME_SHORT ( ySubscriptYSize ),
1139 FT_FRAME_SHORT ( ySubscriptXOffset ),
1140 FT_FRAME_SHORT ( ySubscriptYOffset ),
1141 FT_FRAME_SHORT ( ySuperscriptXSize ),
1142 FT_FRAME_SHORT ( ySuperscriptYSize ),
1143 FT_FRAME_SHORT ( ySuperscriptXOffset ),
1144 FT_FRAME_SHORT ( ySuperscriptYOffset ),
1145 FT_FRAME_SHORT ( yStrikeoutSize ),
1146 FT_FRAME_SHORT ( yStrikeoutPosition ),
1147 FT_FRAME_SHORT ( sFamilyClass ),
1148 FT_FRAME_BYTE ( panose[0] ),
1149 FT_FRAME_BYTE ( panose[1] ),
1150 FT_FRAME_BYTE ( panose[2] ),
1151 FT_FRAME_BYTE ( panose[3] ),
1152 FT_FRAME_BYTE ( panose[4] ),
1153 FT_FRAME_BYTE ( panose[5] ),
1154 FT_FRAME_BYTE ( panose[6] ),
1155 FT_FRAME_BYTE ( panose[7] ),
1156 FT_FRAME_BYTE ( panose[8] ),
1157 FT_FRAME_BYTE ( panose[9] ),
1158 FT_FRAME_ULONG ( ulUnicodeRange1 ),
1159 FT_FRAME_ULONG ( ulUnicodeRange2 ),
1160 FT_FRAME_ULONG ( ulUnicodeRange3 ),
1161 FT_FRAME_ULONG ( ulUnicodeRange4 ),
1162 FT_FRAME_BYTE ( achVendID[0] ),
1163 FT_FRAME_BYTE ( achVendID[1] ),
1164 FT_FRAME_BYTE ( achVendID[2] ),
1165 FT_FRAME_BYTE ( achVendID[3] ),
1166
1167 FT_FRAME_USHORT( fsSelection ),
1168 FT_FRAME_USHORT( usFirstCharIndex ),
1169 FT_FRAME_USHORT( usLastCharIndex ),
1170 FT_FRAME_SHORT ( sTypoAscender ),
1171 FT_FRAME_SHORT ( sTypoDescender ),
1172 FT_FRAME_SHORT ( sTypoLineGap ),
1173 FT_FRAME_USHORT( usWinAscent ),
1174 FT_FRAME_USHORT( usWinDescent ),
1176 };
1177
1178 /* `OS/2' version 1 and newer */
1179 static const FT_Frame_Field os2_fields_extra1[] =
1180 {
1181 FT_FRAME_START( 8 ),
1182 FT_FRAME_ULONG( ulCodePageRange1 ),
1183 FT_FRAME_ULONG( ulCodePageRange2 ),
1185 };
1186
1187 /* `OS/2' version 2 and newer */
1188 static const FT_Frame_Field os2_fields_extra2[] =
1189 {
1190 FT_FRAME_START( 10 ),
1191 FT_FRAME_SHORT ( sxHeight ),
1192 FT_FRAME_SHORT ( sCapHeight ),
1193 FT_FRAME_USHORT( usDefaultChar ),
1194 FT_FRAME_USHORT( usBreakChar ),
1195 FT_FRAME_USHORT( usMaxContext ),
1197 };
1198
1199 /* `OS/2' version 5 and newer */
1200 static const FT_Frame_Field os2_fields_extra5[] =
1201 {
1202 FT_FRAME_START( 4 ),
1203 FT_FRAME_USHORT( usLowerOpticalPointSize ),
1204 FT_FRAME_USHORT( usUpperOpticalPointSize ),
1206 };
1207
1208
1209 /* We now support old Mac fonts where the OS/2 table doesn't */
1210 /* exist. Simply put, we set the `version' field to 0xFFFF */
1211 /* and test this value each time we need to access the table. */
1212 error = face->goto_table( face, TTAG_OS2, stream, 0 );
1213 if ( error )
1214 goto Exit;
1215
1216 os2 = &face->os2;
1217
1218 if ( FT_STREAM_READ_FIELDS( os2_fields, os2 ) )
1219 goto Exit;
1220
1221 os2->ulCodePageRange1 = 0;
1222 os2->ulCodePageRange2 = 0;
1223 os2->sxHeight = 0;
1224 os2->sCapHeight = 0;
1225 os2->usDefaultChar = 0;
1226 os2->usBreakChar = 0;
1227 os2->usMaxContext = 0;
1228 os2->usLowerOpticalPointSize = 0;
1229 os2->usUpperOpticalPointSize = 0xFFFF;
1230
1231 if ( os2->version >= 0x0001 )
1232 {
1233 /* only version 1 tables */
1234 if ( FT_STREAM_READ_FIELDS( os2_fields_extra1, os2 ) )
1235 goto Exit;
1236
1237 if ( os2->version >= 0x0002 )
1238 {
1239 /* only version 2 tables */
1240 if ( FT_STREAM_READ_FIELDS( os2_fields_extra2, os2 ) )
1241 goto Exit;
1242
1243 if ( os2->version >= 0x0005 )
1244 {
1245 /* only version 5 tables */
1246 if ( FT_STREAM_READ_FIELDS( os2_fields_extra5, os2 ) )
1247 goto Exit;
1248 }
1249 }
1250 }
1251
1252 FT_TRACE3(( "sTypoAscender: %4d\n", os2->sTypoAscender ));
1253 FT_TRACE3(( "sTypoDescender: %4d\n", os2->sTypoDescender ));
1254 FT_TRACE3(( "usWinAscent: %4u\n", os2->usWinAscent ));
1255 FT_TRACE3(( "usWinDescent: %4u\n", os2->usWinDescent ));
1256 FT_TRACE3(( "fsSelection: 0x%2x\n", os2->fsSelection ));
1257
1258 Exit:
1259 return error;
1260 }
1261
1262
1263 /**************************************************************************
1264 *
1265 * @Function:
1266 * tt_face_load_postscript
1267 *
1268 * @Description:
1269 * Loads the Postscript table.
1270 *
1271 * @Input:
1272 * face ::
1273 * A handle to the target face object.
1274 *
1275 * stream ::
1276 * A handle to the input stream.
1277 *
1278 * @Return:
1279 * FreeType error code. 0 means success.
1280 */
1284 {
1286 TT_Postscript* post = &face->postscript;
1287
1288 static const FT_Frame_Field post_fields[] =
1289 {
1290#undef FT_STRUCTURE
1291#define FT_STRUCTURE TT_Postscript
1292
1293 FT_FRAME_START( 32 ),
1294 FT_FRAME_LONG ( FormatType ),
1295 FT_FRAME_LONG ( italicAngle ),
1296 FT_FRAME_SHORT( underlinePosition ),
1297 FT_FRAME_SHORT( underlineThickness ),
1298 FT_FRAME_ULONG( isFixedPitch ),
1299 FT_FRAME_ULONG( minMemType42 ),
1300 FT_FRAME_ULONG( maxMemType42 ),
1301 FT_FRAME_ULONG( minMemType1 ),
1302 FT_FRAME_ULONG( maxMemType1 ),
1304 };
1305
1306
1307 error = face->goto_table( face, TTAG_post, stream, 0 );
1308 if ( error )
1309 return error;
1310
1311 if ( FT_STREAM_READ_FIELDS( post_fields, post ) )
1312 return error;
1313
1314 /* we don't load the glyph names, we do that in another */
1315 /* module (ttpost). */
1316
1317 FT_TRACE3(( "FormatType: 0x%lx\n", post->FormatType ));
1318 FT_TRACE3(( "isFixedPitch: %s\n", post->isFixedPitch
1319 ? " yes" : " no" ));
1320
1321 return FT_Err_Ok;
1322 }
1323
1324
1325 /**************************************************************************
1326 *
1327 * @Function:
1328 * tt_face_load_pclt
1329 *
1330 * @Description:
1331 * Loads the PCL 5 Table.
1332 *
1333 * @Input:
1334 * face ::
1335 * A handle to the target face object.
1336 *
1337 * stream ::
1338 * A handle to the input stream.
1339 *
1340 * @Return:
1341 * FreeType error code. 0 means success.
1342 */
1346 {
1347 static const FT_Frame_Field pclt_fields[] =
1348 {
1349#undef FT_STRUCTURE
1350#define FT_STRUCTURE TT_PCLT
1351
1352 FT_FRAME_START( 54 ),
1354 FT_FRAME_ULONG ( FontNumber ),
1355 FT_FRAME_USHORT( Pitch ),
1356 FT_FRAME_USHORT( xHeight ),
1358 FT_FRAME_USHORT( TypeFamily ),
1359 FT_FRAME_USHORT( CapHeight ),
1360 FT_FRAME_USHORT( SymbolSet ),
1361 FT_FRAME_BYTES ( TypeFace, 16 ),
1362 FT_FRAME_BYTES ( CharacterComplement, 8 ),
1363 FT_FRAME_BYTES ( FileName, 6 ),
1364 FT_FRAME_CHAR ( StrokeWeight ),
1365 FT_FRAME_CHAR ( WidthType ),
1366 FT_FRAME_BYTE ( SerifStyle ),
1369 };
1370
1372 TT_PCLT* pclt = &face->pclt;
1373
1374
1375 /* optional table */
1376 error = face->goto_table( face, TTAG_PCLT, stream, 0 );
1377 if ( error )
1378 goto Exit;
1379
1380 if ( FT_STREAM_READ_FIELDS( pclt_fields, pclt ) )
1381 goto Exit;
1382
1383 Exit:
1384 return error;
1385 }
1386
1387
1388 /**************************************************************************
1389 *
1390 * @Function:
1391 * tt_face_load_gasp
1392 *
1393 * @Description:
1394 * Loads the `gasp' table into a face object.
1395 *
1396 * @Input:
1397 * face ::
1398 * A handle to the target face object.
1399 *
1400 * stream ::
1401 * The input stream.
1402 *
1403 * @Return:
1404 * FreeType error code. 0 means success.
1405 */
1409 {
1411 FT_Memory memory = stream->memory;
1412
1413 FT_UInt j,num_ranges;
1414 TT_GaspRange gaspranges = NULL;
1415
1416
1417 /* the gasp table is optional */
1418 error = face->goto_table( face, TTAG_gasp, stream, 0 );
1419 if ( error )
1420 goto Exit;
1421
1422 if ( FT_FRAME_ENTER( 4L ) )
1423 goto Exit;
1424
1425 face->gasp.version = FT_GET_USHORT();
1426 face->gasp.numRanges = FT_GET_USHORT();
1427
1428 FT_FRAME_EXIT();
1429
1430 /* only support versions 0 and 1 of the table */
1431 if ( face->gasp.version >= 2 )
1432 {
1433 face->gasp.numRanges = 0;
1434 error = FT_THROW( Invalid_Table );
1435 goto Exit;
1436 }
1437
1438 num_ranges = face->gasp.numRanges;
1439 FT_TRACE3(( "numRanges: %u\n", num_ranges ));
1440
1441 if ( FT_QNEW_ARRAY( face->gasp.gaspRanges, num_ranges ) ||
1442 FT_FRAME_ENTER( num_ranges * 4L ) )
1443 goto Exit;
1444
1445 gaspranges = face->gasp.gaspRanges;
1446
1447 for ( j = 0; j < num_ranges; j++ )
1448 {
1449 gaspranges[j].maxPPEM = FT_GET_USHORT();
1450 gaspranges[j].gaspFlag = FT_GET_USHORT();
1451
1452 FT_TRACE3(( "gaspRange %d: rangeMaxPPEM %5d, rangeGaspBehavior 0x%x\n",
1453 j,
1454 gaspranges[j].maxPPEM,
1455 gaspranges[j].gaspFlag ));
1456 }
1457
1458 FT_FRAME_EXIT();
1459
1460 Exit:
1461 return error;
1462 }
1463
1464
1465/* END */
const DWORD Style
Definition: appswitch.c:72
#define FT_LOCAL_DEF(x)
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static const WCHAR version[]
Definition: asmname.c:66
return FT_Err_Ok
Definition: ftbbox.c:526
#define FT_TRACE0(varformat)
Definition: ftdebug.h:187
#define FT_ERROR(varformat)
Definition: ftdebug.h:211
#define FT_TRACE3(varformat)
Definition: ftdebug.h:190
#define FT_THROW(e)
Definition: ftdebug.h:243
#define FT_TRACE2(varformat)
Definition: ftdebug.h:189
#define FT_TRACE4(varformat)
Definition: ftdebug.h:191
#define FT_NEW_ARRAY(ptr, count)
Definition: ftmemory.h:341
#define FT_FREE(ptr)
Definition: ftmemory.h:337
#define FT_OFFSET(base, count)
Definition: ftmemory.h:66
#define FT_RENEW_ARRAY(ptr, curcnt, newcnt)
Definition: ftmemory.h:344
#define FT_QNEW_ARRAY(ptr, count)
Definition: ftmemory.h:350
#define FT_FRAME_ENTER(size)
Definition: ftstream.h:548
#define FT_READ_USHORT(var)
Definition: ftstream.h:339
#define FT_FRAME_END
Definition: ftstream.h:118
#define FT_GET_ULONG()
Definition: ftstream.h:315
#define FT_STREAM_SEEK(position)
Definition: ftstream.h:525
#define FT_READ_ULONG(var)
Definition: ftstream.h:343
#define FT_FRAME_SHORT(f)
Definition: ftstream.h:122
#define FT_STREAM_POS()
Definition: ftstream.h:522
#define FT_FRAME_BYTE(f)
Definition: ftstream.h:126
#define FT_FRAME_ULONG(f)
Definition: ftstream.h:121
#define FT_GET_TAG4()
Definition: ftstream.h:316
#define FT_FRAME_EXIT()
Definition: ftstream.h:553
#define FT_FRAME_EXTRACT(size, bytes)
Definition: ftstream.h:556
#define FT_STREAM_READ_FIELDS(fields, object)
Definition: ftstream.h:544
#define FT_STREAM_READ_AT(position, buffer, count)
Definition: ftstream.h:538
#define FT_FRAME_BYTES(field, count)
Definition: ftstream.h:140
#define FT_FRAME_START(size)
Definition: ftstream.h:117
#define FT_FRAME_CHAR(f)
Definition: ftstream.h:127
#define FT_FRAME_USHORT(f)
Definition: ftstream.h:123
#define FT_FRAME_LONG(f)
Definition: ftstream.h:120
#define FT_GET_USHORT()
Definition: ftstream.h:311
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:64
signed char FT_Char
Definition: fttypes.h:143
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
unsigned long FT_ULong
Definition: fttypes.h:253
unsigned char FT_Byte
Definition: fttypes.h:154
int FT_Error
Definition: fttypes.h:299
signed long FT_Long
Definition: fttypes.h:242
unsigned short FT_UShort
Definition: fttypes.h:209
unsigned int FT_UInt
Definition: fttypes.h:231
BOOLEAN valid
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum const GLvoid GLbitfield GLsizei numGlyphs
Definition: glext.h:11715
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLintptr offset
Definition: glext.h:5920
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
GLint limit
Definition: glext.h:10326
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
uint32_t entry
Definition: isohybrid.c:63
#define error(str)
Definition: mkdosfs.c:1605
static char memory[1024 *256]
Definition: process.c:122
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
static void Exit(void)
Definition: sock.c:1330
FT_UShort gaspFlag
Definition: tttypes.h:347
FT_UShort maxPPEM
Definition: tttypes.h:346
FT_UShort maxZones
Definition: tttables.h:575
FT_UShort maxComponentElements
Definition: tttables.h:582
FT_UShort maxPoints
Definition: tttables.h:571
FT_UShort maxStackElements
Definition: tttables.h:580
FT_UShort maxInstructionDefs
Definition: tttables.h:579
FT_UShort maxStorage
Definition: tttables.h:577
FT_Fixed version
Definition: tttables.h:569
FT_UShort maxContours
Definition: tttables.h:572
FT_UShort numGlyphs
Definition: tttables.h:570
FT_UShort maxTwilightPoints
Definition: tttables.h:576
FT_UShort maxCompositeContours
Definition: tttables.h:574
FT_UShort maxComponentDepth
Definition: tttables.h:583
FT_UShort maxCompositePoints
Definition: tttables.h:573
FT_UShort maxSizeOfInstructions
Definition: tttables.h:581
FT_UShort maxFunctionDefs
Definition: tttables.h:578
FT_Short sTypoDescender
Definition: tttables.h:407
FT_UShort version
Definition: tttables.h:377
FT_ULong ulCodePageRange1
Definition: tttables.h:414
FT_UShort fsSelection
Definition: tttables.h:403
FT_UShort usMaxContext
Definition: tttables.h:423
FT_UShort usBreakChar
Definition: tttables.h:422
FT_Short sxHeight
Definition: tttables.h:419
FT_UShort usWinDescent
Definition: tttables.h:410
FT_UShort usLowerOpticalPointSize
Definition: tttables.h:427
FT_Short sTypoAscender
Definition: tttables.h:406
FT_UShort usUpperOpticalPointSize
Definition: tttables.h:428
FT_Short sCapHeight
Definition: tttables.h:420
FT_ULong ulCodePageRange2
Definition: tttables.h:415
FT_UShort usWinAscent
Definition: tttables.h:409
FT_UShort usDefaultChar
Definition: tttables.h:421
FT_Fixed FormatType
Definition: tttables.h:452
FT_ULong isFixedPitch
Definition: tttables.h:456
Definition: format.c:58
Definition: parse.h:23
unsigned int size
Definition: parse.h:27
Definition: ecma_167.h:138
SFNT_Service sfnt
Definition: ttdriver.c:208
tt_face_free_name(TT_Face face)
Definition: ttload.c:1024
tt_face_load_post(TT_Face face, FT_Stream stream)
Definition: ttload.c:1282
tt_face_load_pclt(TT_Face face, FT_Stream stream)
Definition: ttload.c:1344
tt_face_load_gasp(TT_Face face, FT_Stream stream)
Definition: ttload.c:1407
tt_face_load_font_dir(TT_Face face, FT_Stream stream)
Definition: ttload.c:343
tt_face_load_head(TT_Face face, FT_Stream stream)
Definition: ttload.c:683
tt_face_load_os2(TT_Face face, FT_Stream stream)
Definition: ttload.c:1120
tt_face_load_maxp(TT_Face face, FT_Stream stream)
Definition: ttload.c:721
tt_face_load_any(TT_Face face, FT_ULong tag, FT_Long offset, FT_Byte *buffer, FT_ULong *length)
Definition: ttload.c:561
tt_face_goto_table(TT_Face face, FT_ULong tag, FT_Stream stream, FT_ULong *length)
Definition: ttload.c:131
static FT_Error check_table_dir(SFNT_Header sfnt, FT_Stream stream, FT_UShort *valid)
Definition: ttload.c:175
tt_face_load_cmap(TT_Face face, FT_Stream stream)
Definition: ttload.c:1082
tt_face_load_name(TT_Face face, FT_Stream stream)
Definition: ttload.c:831
static FT_Error tt_face_load_generic_header(TT_Face face, FT_Stream stream, FT_ULong tag)
Definition: ttload.c:629
tt_face_lookup_table(TT_Face face, FT_ULong tag)
Definition: ttload.c:57
FT_BEGIN_HEADER struct TT_Header_ TT_Header
#define TTAG_gasp
Definition: tttags.h:60
#define TTAG_OS2
Definition: tttags.h:88
#define TTAG_cmap
Definition: tttags.h:47
#define TTAG_hmtx
Definition: tttags.h:70
#define TTAG_OTTO
Definition: tttags.h:89
#define TTAG_META
Definition: tttags.h:80
#define TTAG_head
Definition: tttags.h:68
#define TTAG_name
Definition: tttags.h:86
#define TTAG_bhed
Definition: tttags.h:39
#define TTAG_vmtx
Definition: tttags.h:106
#define TTAG_post
Definition: tttags.h:92
#define TTAG_SING
Definition: tttags.h:97
#define TTAG_PCLT
Definition: tttags.h:90
#define TTAG_maxp
Definition: tttags.h:79
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4071
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170