sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
tttypes.h
Go to the documentation of this file.
1/****************************************************************************
2 *
3 * tttypes.h
4 *
5 * Basic SFNT/TrueType type definitions and interface (specification
6 * only).
7 *
8 * Copyright (C) 1996-2025 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
24#ifndef TTTYPES_H_
25#define TTTYPES_H_
26
27
28#include <freetype/tttables.h>
30#include <freetype/ftcolor.h>
31#include "freetype/fttypes.h"
32
33#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
34#include <freetype/ftmm.h>
35#endif
36
37
38FT_BEGIN_HEADER
39
40
41 /*************************************************************************/
42 /*************************************************************************/
43 /*************************************************************************/
44 /*** ***/
45 /*** ***/
46 /*** REQUIRED TRUETYPE/OPENTYPE TABLES DEFINITIONS ***/
47 /*** ***/
48 /*** ***/
49 /*************************************************************************/
50 /*************************************************************************/
51 /*************************************************************************/
52
53
54 /**************************************************************************
55 *
56 * @struct:
57 * TTC_HeaderRec
58 *
59 * @description:
60 * TrueType collection header. This table contains the offsets of the
61 * font headers of each distinct TrueType face in the file.
62 *
63 * @fields:
64 * tag ::
65 * Must be 'ttc~' to indicate a TrueType collection.
66 *
67 * version ::
68 * The version number.
69 *
70 * count ::
71 * The number of faces in the collection. The specification says this
72 * should be an unsigned long, but we use a signed long since we need
73 * the value -1 for specific purposes.
74 *
75 * offsets ::
76 * The offsets of the font headers, one per face.
77 */
78 typedef struct TTC_HeaderRec_
79 {
80 FT_ULong tag;
81 FT_Fixed version;
82 FT_Long count;
83 FT_ULong* offsets;
84
85 } TTC_HeaderRec;
86
87
88 /**************************************************************************
89 *
90 * @struct:
91 * SFNT_HeaderRec
92 *
93 * @description:
94 * SFNT file format header.
95 *
96 * @fields:
97 * format_tag ::
98 * The font format tag.
99 *
100 * num_tables ::
101 * The number of tables in file.
102 *
103 * search_range ::
104 * Must be '16 * (max power of 2 <= num_tables)'.
105 *
106 * entry_selector ::
107 * Must be log2 of 'search_range / 16'.
108 *
109 * range_shift ::
110 * Must be 'num_tables * 16 - search_range'.
111 */
112 typedef struct SFNT_HeaderRec_
113 {
114 FT_ULong format_tag;
115 FT_UShort num_tables;
116 FT_UShort search_range;
117 FT_UShort entry_selector;
118 FT_UShort range_shift;
119
120 FT_ULong offset; /* not in file */
121
122 } SFNT_HeaderRec, *SFNT_Header;
123
124
125 /**************************************************************************
126 *
127 * @struct:
128 * TT_TableRec
129 *
130 * @description:
131 * This structure describes a given table of a TrueType font.
132 *
133 * @fields:
134 * Tag ::
135 * A four-bytes tag describing the table.
136 *
137 * CheckSum ::
138 * The table checksum. This value can be ignored.
139 *
140 * Offset ::
141 * The offset of the table from the start of the TrueType font in its
142 * resource.
143 *
144 * Length ::
145 * The table length (in bytes).
146 */
147 typedef struct TT_TableRec_
148 {
149 FT_ULong Tag; /* table type */
150 FT_ULong CheckSum; /* table checksum */
151 FT_ULong Offset; /* table file offset */
152 FT_ULong Length; /* table length */
153
154 } TT_TableRec, *TT_Table;
155
156
157 /**************************************************************************
158 *
159 * @struct:
160 * TT_LongMetricsRec
161 *
162 * @description:
163 * A structure modeling the long metrics of the 'hmtx' and 'vmtx'
164 * TrueType tables. The values are expressed in font units.
165 *
166 * @fields:
167 * advance ::
168 * The advance width or height for the glyph.
169 *
170 * bearing ::
171 * The left-side or top-side bearing for the glyph.
172 */
173 typedef struct TT_LongMetricsRec_
174 {
175 FT_UShort advance;
176 FT_Short bearing;
177
178 } TT_LongMetricsRec, *TT_LongMetrics;
179
180
181 /**************************************************************************
182 *
183 * @type:
184 * TT_ShortMetrics
185 *
186 * @description:
187 * A simple type to model the short metrics of the 'hmtx' and 'vmtx'
188 * tables.
189 */
190 typedef FT_Short TT_ShortMetrics;
191
192
193 /**************************************************************************
194 *
195 * @struct:
196 * TT_NameRec
197 *
198 * @description:
199 * A structure modeling TrueType name records. Name records are used to
200 * store important strings like family name, style name, copyright,
201 * etc. in _localized_ versions (i.e., language, encoding, etc).
202 *
203 * @fields:
204 * platformID ::
205 * The ID of the name's encoding platform.
206 *
207 * encodingID ::
208 * The platform-specific ID for the name's encoding.
209 *
210 * languageID ::
211 * The platform-specific ID for the name's language.
212 *
213 * nameID ::
214 * The ID specifying what kind of name this is.
215 *
216 * stringLength ::
217 * The length of the string in bytes.
218 *
219 * stringOffset ::
220 * The offset to the string in the 'name' table.
221 *
222 * string ::
223 * A pointer to the string's bytes. Note that these are usually UTF-16
224 * encoded characters.
225 */
226 typedef struct TT_NameRec_
227 {
228 FT_UShort platformID;
229 FT_UShort encodingID;
230 FT_UShort languageID;
231 FT_UShort nameID;
232 FT_UShort stringLength;
233 FT_ULong stringOffset;
234
235 /* this last field is not defined in the spec */
236 /* but used by the FreeType engine */
237
238 FT_Byte* string;
239
240 } TT_NameRec, *TT_Name;
241
242
243 /**************************************************************************
244 *
245 * @struct:
246 * TT_LangTagRec
247 *
248 * @description:
249 * A structure modeling language tag records in SFNT 'name' tables,
250 * introduced in OpenType version 1.6.
251 *
252 * @fields:
253 * stringLength ::
254 * The length of the string in bytes.
255 *
256 * stringOffset ::
257 * The offset to the string in the 'name' table.
258 *
259 * string ::
260 * A pointer to the string's bytes. Note that these are UTF-16BE
261 * encoded characters.
262 */
263 typedef struct TT_LangTagRec_
264 {
265 FT_UShort stringLength;
266 FT_ULong stringOffset;
267
268 /* this last field is not defined in the spec */
269 /* but used by the FreeType engine */
270
271 FT_Byte* string;
272
273 } TT_LangTagRec, *TT_LangTag;
274
275
276 /**************************************************************************
277 *
278 * @struct:
279 * TT_NameTableRec
280 *
281 * @description:
282 * A structure modeling the TrueType name table.
283 *
284 * @fields:
285 * format ::
286 * The format of the name table.
287 *
288 * numNameRecords ::
289 * The number of names in table.
290 *
291 * storageOffset ::
292 * The offset of the name table in the 'name' TrueType table.
293 *
294 * names ::
295 * An array of name records.
296 *
297 * numLangTagRecords ::
298 * The number of language tags in table.
299 *
300 * langTags ::
301 * An array of language tag records.
302 *
303 * stream ::
304 * The file's input stream.
305 */
306 typedef struct TT_NameTableRec_
307 {
308 FT_UShort format;
309 FT_UInt numNameRecords;
310 FT_UInt storageOffset;
311 TT_NameRec* names;
312 FT_UInt numLangTagRecords;
313 TT_LangTagRec* langTags;
314 FT_Stream stream;
315
316 } TT_NameTableRec, *TT_NameTable;
317
318
319 /*************************************************************************/
320 /*************************************************************************/
321 /*************************************************************************/
322 /*** ***/
323 /*** ***/
324 /*** OPTIONAL TRUETYPE/OPENTYPE TABLES DEFINITIONS ***/
325 /*** ***/
326 /*** ***/
327 /*************************************************************************/
328 /*************************************************************************/
329 /*************************************************************************/
330
331
332 /**************************************************************************
333 *
334 * @struct:
335 * TT_GaspRangeRec
336 *
337 * @description:
338 * A tiny structure used to model a gasp range according to the TrueType
339 * specification.
340 *
341 * @fields:
342 * maxPPEM ::
343 * The maximum ppem value to which `gaspFlag` applies.
344 *
345 * gaspFlag ::
346 * A flag describing the grid-fitting and anti-aliasing modes to be
347 * used.
348 */
349 typedef struct TT_GaspRangeRec_
350 {
351 FT_UShort maxPPEM;
352 FT_UShort gaspFlag;
353
354 } TT_GaspRangeRec, *TT_GaspRange;
355
356
357#define TT_GASP_GRIDFIT 0x01
358#define TT_GASP_DOGRAY 0x02
359
360
361 /**************************************************************************
362 *
363 * @struct:
364 * TT_GaspRec
365 *
366 * @description:
367 * A structure modeling the TrueType 'gasp' table used to specify
368 * grid-fitting and anti-aliasing behaviour.
369 *
370 * @fields:
371 * version ::
372 * The version number.
373 *
374 * numRanges ::
375 * The number of gasp ranges in table.
376 *
377 * gaspRanges ::
378 * An array of gasp ranges.
379 */
380 typedef struct TT_Gasp_
381 {
382 FT_UShort version;
383 FT_UShort numRanges;
384 TT_GaspRange gaspRanges;
385
386 } TT_GaspRec;
387
388
389 /*************************************************************************/
390 /*************************************************************************/
391 /*************************************************************************/
392 /*** ***/
393 /*** ***/
394 /*** EMBEDDED BITMAPS SUPPORT ***/
395 /*** ***/
396 /*** ***/
397 /*************************************************************************/
398 /*************************************************************************/
399 /*************************************************************************/
400
401
402 /**************************************************************************
403 *
404 * @struct:
405 * TT_SBit_MetricsRec
406 *
407 * @description:
408 * A structure used to hold the big metrics of a given glyph bitmap in a
409 * TrueType or OpenType font. These are usually found in the 'EBDT'
410 * (Microsoft) or 'bloc' (Apple) table.
411 *
412 * @fields:
413 * height ::
414 * The glyph height in pixels.
415 *
416 * width ::
417 * The glyph width in pixels.
418 *
419 * horiBearingX ::
420 * The horizontal left bearing.
421 *
422 * horiBearingY ::
423 * The horizontal top bearing.
424 *
425 * horiAdvance ::
426 * The horizontal advance.
427 *
428 * vertBearingX ::
429 * The vertical left bearing.
430 *
431 * vertBearingY ::
432 * The vertical top bearing.
433 *
434 * vertAdvance ::
435 * The vertical advance.
436 */
437 typedef struct TT_SBit_MetricsRec_
438 {
439 FT_UShort height;
440 FT_UShort width;
441
442 FT_Short horiBearingX;
443 FT_Short horiBearingY;
444 FT_UShort horiAdvance;
445
446 FT_Short vertBearingX;
447 FT_Short vertBearingY;
448 FT_UShort vertAdvance;
449
450 } TT_SBit_MetricsRec, *TT_SBit_Metrics;
451
452
453 /**************************************************************************
454 *
455 * @struct:
456 * TT_SBit_SmallMetricsRec
457 *
458 * @description:
459 * A structure used to hold the small metrics of a given glyph bitmap in
460 * a TrueType or OpenType font. These are usually found in the 'EBDT'
461 * (Microsoft) or the 'bdat' (Apple) table.
462 *
463 * @fields:
464 * height ::
465 * The glyph height in pixels.
466 *
467 * width ::
468 * The glyph width in pixels.
469 *
470 * bearingX ::
471 * The left-side bearing.
472 *
473 * bearingY ::
474 * The top-side bearing.
475 *
476 * advance ::
477 * The advance width or height.
478 */
480 {
481 FT_Byte height;
482 FT_Byte width;
483
484 FT_Char bearingX;
485 FT_Char bearingY;
486 FT_Byte advance;
487
488 } TT_SBit_SmallMetricsRec, *TT_SBit_SmallMetrics;
489
490
491 /**************************************************************************
492 *
493 * @struct:
494 * TT_SBit_LineMetricsRec
495 *
496 * @description:
497 * A structure used to describe the text line metrics of a given bitmap
498 * strike, for either a horizontal or vertical layout.
499 *
500 * @fields:
501 * ascender ::
502 * The ascender in pixels.
503 *
504 * descender ::
505 * The descender in pixels.
506 *
507 * max_width ::
508 * The maximum glyph width in pixels.
509 *
510 * caret_slope_enumerator ::
511 * Rise of the caret slope, typically set to 1 for non-italic fonts.
512 *
513 * caret_slope_denominator ::
514 * Rise of the caret slope, typically set to 0 for non-italic fonts.
515 *
516 * caret_offset ::
517 * Offset in pixels to move the caret for proper positioning.
518 *
519 * min_origin_SB ::
520 * Minimum of horiBearingX (resp. vertBearingY).
521 * min_advance_SB ::
522 * Minimum of
523 *
524 * horizontal advance - ( horiBearingX + width )
525 *
526 * resp.
527 *
528 * vertical advance - ( vertBearingY + height )
529 *
530 * max_before_BL ::
531 * Maximum of horiBearingY (resp. vertBearingY).
532 *
533 * min_after_BL ::
534 * Minimum of
535 *
536 * horiBearingY - height
537 *
538 * resp.
539 *
540 * vertBearingX - width
541 *
542 * pads ::
543 * Unused (to make the size of the record a multiple of 32 bits.
544 */
546 {
547 FT_Char ascender;
548 FT_Char descender;
549 FT_Byte max_width;
550 FT_Char caret_slope_numerator;
551 FT_Char caret_slope_denominator;
552 FT_Char caret_offset;
553 FT_Char min_origin_SB;
554 FT_Char min_advance_SB;
555 FT_Char max_before_BL;
556 FT_Char min_after_BL;
557 FT_Char pads[2];
558
559 } TT_SBit_LineMetricsRec, *TT_SBit_LineMetrics;
560
561
562 /**************************************************************************
563 *
564 * @struct:
565 * TT_SBit_RangeRec
566 *
567 * @description:
568 * A TrueType/OpenType subIndexTable as defined in the 'EBLC' (Microsoft)
569 * or 'bloc' (Apple) tables.
570 *
571 * @fields:
572 * first_glyph ::
573 * The first glyph index in the range.
574 *
575 * last_glyph ::
576 * The last glyph index in the range.
577 *
578 * index_format ::
579 * The format of index table. Valid values are 1 to 5.
580 *
581 * image_format ::
582 * The format of 'EBDT' image data.
583 *
584 * image_offset ::
585 * The offset to image data in 'EBDT'.
586 *
587 * image_size ::
588 * For index formats 2 and 5. This is the size in bytes of each glyph
589 * bitmap.
590 *
591 * big_metrics ::
592 * For index formats 2 and 5. This is the big metrics for each glyph
593 * bitmap.
594 *
595 * num_glyphs ::
596 * For index formats 4 and 5. This is the number of glyphs in the code
597 * array.
598 *
599 * glyph_offsets ::
600 * For index formats 1 and 3.
601 *
602 * glyph_codes ::
603 * For index formats 4 and 5.
604 *
605 * table_offset ::
606 * The offset of the index table in the 'EBLC' table. Only used during
607 * strike loading.
608 */
609 typedef struct TT_SBit_RangeRec_
610 {
611 FT_UShort first_glyph;
612 FT_UShort last_glyph;
613
614 FT_UShort index_format;
615 FT_UShort image_format;
616 FT_ULong image_offset;
617
618 FT_ULong image_size;
619 TT_SBit_MetricsRec metrics;
620 FT_ULong num_glyphs;
621
622 FT_ULong* glyph_offsets;
623 FT_UShort* glyph_codes;
624
625 FT_ULong table_offset;
626
627 } TT_SBit_RangeRec, *TT_SBit_Range;
628
629
630 /**************************************************************************
631 *
632 * @struct:
633 * TT_SBit_StrikeRec
634 *
635 * @description:
636 * A structure used describe a given bitmap strike in the 'EBLC'
637 * (Microsoft) or 'bloc' (Apple) tables.
638 *
639 * @fields:
640 * num_index_ranges ::
641 * The number of index ranges.
642 *
643 * index_ranges ::
644 * An array of glyph index ranges.
645 *
646 * color_ref ::
647 * Unused. `color_ref` is put in for future enhancements, but these
648 * fields are already in use by other platforms (e.g. Newton). For
649 * details, please see
650 *
651 * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6bloc.html
652 *
653 * hori ::
654 * The line metrics for horizontal layouts.
655 *
656 * vert ::
657 * The line metrics for vertical layouts.
658 *
659 * start_glyph ::
660 * The lowest glyph index for this strike.
661 *
662 * end_glyph ::
663 * The highest glyph index for this strike.
664 *
665 * x_ppem ::
666 * The number of horizontal pixels per EM.
667 *
668 * y_ppem ::
669 * The number of vertical pixels per EM.
670 *
671 * bit_depth ::
672 * The bit depth. Valid values are 1, 2, 4, and 8.
673 *
674 * flags ::
675 * Is this a vertical or horizontal strike? For details, please see
676 *
677 * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6bloc.html
678 */
679 typedef struct TT_SBit_StrikeRec_
680 {
681 FT_Int num_ranges;
682 TT_SBit_Range sbit_ranges;
683 FT_ULong ranges_offset;
684
685 FT_ULong color_ref;
686
687 TT_SBit_LineMetricsRec hori;
688 TT_SBit_LineMetricsRec vert;
689
690 FT_UShort start_glyph;
691 FT_UShort end_glyph;
692
693 FT_Byte x_ppem;
694 FT_Byte y_ppem;
695
696 FT_Byte bit_depth;
697 FT_Char flags;
698
699 } TT_SBit_StrikeRec, *TT_SBit_Strike;
700
701
702 /**************************************************************************
703 *
704 * @struct:
705 * TT_SBit_ComponentRec
706 *
707 * @description:
708 * A simple structure to describe a compound sbit element.
709 *
710 * @fields:
711 * glyph_code ::
712 * The element's glyph index.
713 *
714 * x_offset ::
715 * The element's left bearing.
716 *
717 * y_offset ::
718 * The element's top bearing.
719 */
721 {
722 FT_UShort glyph_code;
723 FT_Char x_offset;
724 FT_Char y_offset;
725
726 } TT_SBit_ComponentRec, *TT_SBit_Component;
727
728
729 /**************************************************************************
730 *
731 * @struct:
732 * TT_SBit_ScaleRec
733 *
734 * @description:
735 * A structure used describe a given bitmap scaling table, as defined in
736 * the 'EBSC' table.
737 *
738 * @fields:
739 * hori ::
740 * The horizontal line metrics.
741 *
742 * vert ::
743 * The vertical line metrics.
744 *
745 * x_ppem ::
746 * The number of horizontal pixels per EM.
747 *
748 * y_ppem ::
749 * The number of vertical pixels per EM.
750 *
751 * x_ppem_substitute ::
752 * Substitution x_ppem value.
753 *
754 * y_ppem_substitute ::
755 * Substitution y_ppem value.
756 */
757 typedef struct TT_SBit_ScaleRec_
758 {
759 TT_SBit_LineMetricsRec hori;
760 TT_SBit_LineMetricsRec vert;
761
762 FT_Byte x_ppem;
763 FT_Byte y_ppem;
764
765 FT_Byte x_ppem_substitute;
766 FT_Byte y_ppem_substitute;
767
768 } TT_SBit_ScaleRec, *TT_SBit_Scale;
769
770
771 /*************************************************************************/
772 /*************************************************************************/
773 /*************************************************************************/
774 /*** ***/
775 /*** ***/
776 /*** POSTSCRIPT GLYPH NAMES SUPPORT ***/
777 /*** ***/
778 /*** ***/
779 /*************************************************************************/
780 /*************************************************************************/
781 /*************************************************************************/
782
783
784 /**************************************************************************
785 *
786 * @struct:
787 * TT_Post_NamesRec
788 *
789 * @description:
790 * Postscript names table, either format 2.0 or 2.5.
791 *
792 * @fields:
793 * loaded ::
794 * A flag to indicate whether the PS names are loaded.
795 *
796 * num_glyphs ::
797 * The number of named glyphs in the table.
798 *
799 * num_names ::
800 * The number of PS names stored in the table.
801 *
802 * glyph_indices ::
803 * The indices of the glyphs in the names arrays.
804 *
805 * glyph_names ::
806 * The PS names not in Mac Encoding.
807 */
808 typedef struct TT_Post_NamesRec_
809 {
810 FT_Bool loaded;
811 FT_UShort num_glyphs;
812 FT_UShort num_names;
813 FT_UShort* glyph_indices;
814 FT_Byte** glyph_names;
815
816 } TT_Post_NamesRec, *TT_Post_Names;
817
818
819 /*************************************************************************/
820 /*************************************************************************/
821 /*************************************************************************/
822 /*** ***/
823 /*** ***/
824 /*** GX VARIATION TABLE SUPPORT ***/
825 /*** ***/
826 /*** ***/
827 /*************************************************************************/
828 /*************************************************************************/
829 /*************************************************************************/
830
831
832#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
833 typedef struct GX_BlendRec_ *GX_Blend;
834#endif
835
836 /*************************************************************************/
837 /*************************************************************************/
838 /*************************************************************************/
839 /*** ***/
840 /*** ***/
841 /*** EMBEDDED BDF PROPERTIES TABLE SUPPORT ***/
842 /*** ***/
843 /*** ***/
844 /*************************************************************************/
845 /*************************************************************************/
846 /*************************************************************************/
847
848 /*
849 * These types are used to support a `BDF ' table that isn't part of the
850 * official TrueType specification. It is mainly used in SFNT-based bitmap
851 * fonts that were generated from a set of BDF fonts.
852 *
853 * The format of the table is as follows.
854 *
855 * USHORT version `BDF ' table version number, should be 0x0001. USHORT
856 * strikeCount Number of strikes (bitmap sizes) in this table. ULONG
857 * stringTable Offset (from start of BDF table) to string
858 * table.
859 *
860 * This is followed by an array of `strikeCount' descriptors, having the
861 * following format.
862 *
863 * USHORT ppem Vertical pixels per EM for this strike. USHORT numItems
864 * Number of items for this strike (properties and
865 * atoms). Maximum is 255.
866 *
867 * This array in turn is followed by `strikeCount' value sets. Each `value
868 * set' is an array of `numItems' items with the following format.
869 *
870 * ULONG item_name Offset in string table to item name.
871 * USHORT item_type The item type. Possible values are
872 * 0 => string (e.g., COMMENT)
873 * 1 => atom (e.g., FONT or even SIZE)
874 * 2 => int32
875 * 3 => uint32
876 * 0x10 => A flag to indicate a properties. This
877 * is ORed with the above values.
878 * ULONG item_value For strings => Offset into string table without
879 * the corresponding double quotes.
880 * For atoms => Offset into string table.
881 * For integers => Direct value.
882 *
883 * All strings in the string table consist of bytes and are
884 * zero-terminated.
885 *
886 */
887
888#ifdef TT_CONFIG_OPTION_BDF
889
890 typedef struct TT_BDFRec_
891 {
892 FT_Byte* table;
893 FT_Byte* table_end;
894 FT_Byte* strings;
895 FT_ULong strings_size;
896 FT_UInt num_strikes;
897 FT_Bool loaded;
898
899 } TT_BDFRec, *TT_BDF;
900
901#endif /* TT_CONFIG_OPTION_BDF */
902
903 /*************************************************************************/
904 /*************************************************************************/
905 /*************************************************************************/
906 /*** ***/
907 /*** ***/
908 /*** ORIGINAL TT_FACE CLASS DEFINITION ***/
909 /*** ***/
910 /*** ***/
911 /*************************************************************************/
912 /*************************************************************************/
913 /*************************************************************************/
914
915
916 /**************************************************************************
917 *
918 * This structure/class is defined here because it is common to the
919 * following formats: TTF, OpenType-TT, and OpenType-CFF.
920 *
921 * Note, however, that the classes TT_Size and TT_GlyphSlot are not shared
922 * between font drivers, and are thus defined in `ttobjs.h`.
923 *
924 */
925
926
927 /**************************************************************************
928 *
929 * @type:
930 * TT_Face
931 *
932 * @description:
933 * A handle to a TrueType face/font object. A TT_Face encapsulates the
934 * resolution and scaling independent parts of a TrueType font resource.
935 *
936 * @note:
937 * The TT_Face structure is also used for CFF support; see file
938 * `cffotypes.h`.
939 */
940 typedef struct TT_FaceRec_* TT_Face;
941
942
943 /* a function type used for the truetype bytecode interpreter hooks */
944 typedef FT_Error
945 (*TT_Interpreter)( void* exec_context );
946
947 /* forward declaration */
948 typedef struct TT_LoaderRec_* TT_Loader;
949
950
951 /**************************************************************************
952 *
953 * @functype:
954 * TT_Loader_GotoTableFunc
955 *
956 * @description:
957 * Seeks a stream to the start of a given TrueType table.
958 *
959 * @input:
960 * face ::
961 * A handle to the target face object.
962 *
963 * tag ::
964 * A 4-byte tag used to name the table.
965 *
966 * stream ::
967 * The input stream.
968 *
969 * @output:
970 * length ::
971 * The length of the table in bytes. Set to 0 if not needed.
972 *
973 * @return:
974 * FreeType error code. 0 means success.
975 *
976 * @note:
977 * The stream cursor must be at the font file's origin.
978 */
979 typedef FT_Error
980 (*TT_Loader_GotoTableFunc)( TT_Face face,
981 FT_ULong tag,
982 FT_Stream stream,
983 FT_ULong* length );
984
985
986 /**************************************************************************
987 *
988 * @functype:
989 * TT_Loader_StartGlyphFunc
990 *
991 * @description:
992 * Seeks a stream to the start of a given glyph element, and opens a
993 * frame for it.
994 *
995 * @input:
996 * loader ::
997 * The current TrueType glyph loader object.
998 *
999 * glyph index :: The index of the glyph to access.
1000 *
1001 * offset ::
1002 * The offset of the glyph according to the 'locations' table.
1003 *
1004 * byte_count ::
1005 * The size of the frame in bytes.
1006 *
1007 * @return:
1008 * FreeType error code. 0 means success.
1009 *
1010 * @note:
1011 * This function is normally equivalent to FT_STREAM_SEEK(offset)
1012 * followed by FT_FRAME_ENTER(byte_count) with the loader's stream, but
1013 * alternative formats (e.g. compressed ones) might use something
1014 * different.
1015 */
1016 typedef FT_Error
1017 (*TT_Loader_StartGlyphFunc)( TT_Loader loader,
1018 FT_UInt glyph_index,
1019 FT_ULong offset,
1020 FT_UInt byte_count );
1021
1022
1023 /**************************************************************************
1024 *
1025 * @functype:
1026 * TT_Loader_ReadGlyphFunc
1027 *
1028 * @description:
1029 * Reads one glyph element (its header, a simple glyph, or a composite)
1030 * from the loader's current stream frame.
1031 *
1032 * @input:
1033 * loader ::
1034 * The current TrueType glyph loader object.
1035 *
1036 * @return:
1037 * FreeType error code. 0 means success.
1038 */
1039 typedef FT_Error
1040 (*TT_Loader_ReadGlyphFunc)( TT_Loader loader );
1041
1042
1043 /**************************************************************************
1044 *
1045 * @functype:
1046 * TT_Loader_EndGlyphFunc
1047 *
1048 * @description:
1049 * Closes the current loader stream frame for the glyph.
1050 *
1051 * @input:
1052 * loader ::
1053 * The current TrueType glyph loader object.
1054 */
1055 typedef void
1056 (*TT_Loader_EndGlyphFunc)( TT_Loader loader );
1057
1058
1059 typedef enum TT_SbitTableType_
1060 {
1061 TT_SBIT_TABLE_TYPE_NONE = 0,
1062 TT_SBIT_TABLE_TYPE_EBLC, /* `EBLC' (Microsoft), */
1063 /* `bloc' (Apple) */
1064 TT_SBIT_TABLE_TYPE_CBLC, /* `CBLC' (Google) */
1065 TT_SBIT_TABLE_TYPE_SBIX, /* `sbix' (Apple) */
1066
1067 /* do not remove */
1068 TT_SBIT_TABLE_TYPE_MAX
1069
1070 } TT_SbitTableType;
1071
1072
1073 /* OpenType 1.8 brings new tables for variation font support; */
1074 /* to make the old MM and GX fonts still work we need to check */
1075 /* the presence (and validity) of the functionality provided */
1076 /* by those tables. The following flag macros are for the */
1077 /* field `variation_support'. */
1078 /* */
1079 /* Note that `fvar' gets checked immediately at font loading, */
1080 /* while the other features are only loaded if MM support is */
1081 /* actually requested. */
1082
1083 /* FVAR */
1084#define TT_FACE_FLAG_VAR_FVAR ( 1 << 0 )
1085
1086 /* HVAR */
1087#define TT_FACE_FLAG_VAR_HADVANCE ( 1 << 1 )
1088#define TT_FACE_FLAG_VAR_LSB ( 1 << 2 )
1089#define TT_FACE_FLAG_VAR_RSB ( 1 << 3 )
1090
1091 /* VVAR */
1092#define TT_FACE_FLAG_VAR_VADVANCE ( 1 << 4 )
1093#define TT_FACE_FLAG_VAR_TSB ( 1 << 5 )
1094#define TT_FACE_FLAG_VAR_BSB ( 1 << 6 )
1095#define TT_FACE_FLAG_VAR_VORG ( 1 << 7 )
1096
1097 /* MVAR */
1098#define TT_FACE_FLAG_VAR_MVAR ( 1 << 8 )
1099
1100
1101 /**************************************************************************
1102 *
1103 * TrueType Face Type
1104 *
1105 * @struct:
1106 * TT_Face
1107 *
1108 * @description:
1109 * The TrueType face class. These objects model the resolution and
1110 * point-size independent data found in a TrueType font file.
1111 *
1112 * @fields:
1113 * root ::
1114 * The base FT_Face structure, managed by the base layer.
1115 *
1116 * ttc_header ::
1117 * The TrueType collection header, used when the file is a 'ttc' rather
1118 * than a 'ttf'. For ordinary font files, the field `ttc_header.count`
1119 * is set to 0.
1120 *
1121 * format_tag ::
1122 * The font format tag.
1123 *
1124 * num_tables ::
1125 * The number of TrueType tables in this font file.
1126 *
1127 * dir_tables ::
1128 * The directory of TrueType tables for this font file.
1129 *
1130 * header ::
1131 * The font's font header ('head' table). Read on font opening.
1132 *
1133 * horizontal ::
1134 * The font's horizontal header ('hhea' table). This field also
1135 * contains the associated horizontal metrics table ('hmtx').
1136 *
1137 * max_profile ::
1138 * The font's maximum profile table. Read on font opening. Note that
1139 * some maximum values cannot be taken directly from this table. We
1140 * thus define additional fields below to hold the computed maxima.
1141 *
1142 * vertical_info ::
1143 * A boolean which is set when the font file contains vertical metrics.
1144 * If not, the value of the 'vertical' field is undefined.
1145 *
1146 * vertical ::
1147 * The font's vertical header ('vhea' table). This field also contains
1148 * the associated vertical metrics table ('vmtx'), if found.
1149 * IMPORTANT: The contents of this field is undefined if the
1150 * `vertical_info` field is unset.
1151 *
1152 * num_names ::
1153 * The number of name records within this TrueType font.
1154 *
1155 * name_table ::
1156 * The table of name records ('name').
1157 *
1158 * os2 ::
1159 * The font's OS/2 table ('OS/2').
1160 *
1161 * postscript ::
1162 * The font's PostScript table ('post' table). The PostScript glyph
1163 * names are not loaded by the driver on face opening. See the
1164 * 'ttpost' module for more details.
1165 *
1166 * cmap_table ::
1167 * Address of the face's 'cmap' SFNT table in memory (it's an extracted
1168 * frame).
1169 *
1170 * cmap_size ::
1171 * The size in bytes of the `cmap_table` described above.
1172 *
1173 * goto_table ::
1174 * A function called by each TrueType table loader to position a
1175 * stream's cursor to the start of a given table according to its tag.
1176 * It defaults to TT_Goto_Face but can be different for strange formats
1177 * (e.g. Type 42).
1178 *
1179 * access_glyph_frame ::
1180 * A function used to access the frame of a given glyph within the
1181 * face's font file.
1182 *
1183 * forget_glyph_frame ::
1184 * A function used to forget the frame of a given glyph when all data
1185 * has been loaded.
1186 *
1187 * read_glyph_header ::
1188 * A function used to read a glyph header. It must be called between
1189 * an 'access' and 'forget'.
1190 *
1191 * read_simple_glyph ::
1192 * A function used to read a simple glyph. It must be called after the
1193 * header was read, and before the 'forget'.
1194 *
1195 * read_composite_glyph ::
1196 * A function used to read a composite glyph. It must be called after
1197 * the header was read, and before the 'forget'.
1198 *
1199 * sfnt ::
1200 * A pointer to the SFNT service.
1201 *
1202 * psnames ::
1203 * A pointer to the PostScript names service.
1204 *
1205 * mm ::
1206 * A pointer to the Multiple Masters service.
1207 *
1208 * tt_var ::
1209 * A pointer to the Metrics Variations service for the "truetype"
1210 * driver.
1211 *
1212 * face_var ::
1213 * A pointer to the Metrics Variations service for this `TT_Face`'s
1214 * driver.
1215 *
1216 * psaux ::
1217 * A pointer to the PostScript Auxiliary service.
1218 *
1219 * gasp ::
1220 * The grid-fitting and scaling properties table ('gasp'). This table
1221 * is optional in TrueType/OpenType fonts.
1222 *
1223 * pclt ::
1224 * The 'pclt' SFNT table.
1225 *
1226 * num_sbit_scales ::
1227 * The number of sbit scales for this font.
1228 *
1229 * sbit_scales ::
1230 * Array of sbit scales embedded in this font. This table is optional
1231 * in a TrueType/OpenType font.
1232 *
1233 * postscript_names ::
1234 * A table used to store the Postscript names of the glyphs for this
1235 * font. See the file `ttconfig.h` for comments on the
1236 * TT_CONFIG_OPTION_POSTSCRIPT_NAMES option.
1237 *
1238 * palette_data ::
1239 * Some fields from the 'CPAL' table that are directly indexed.
1240 *
1241 * palette_index ::
1242 * The current palette index, as set by @FT_Palette_Select.
1243 *
1244 * palette ::
1245 * An array containing the current palette's colors.
1246 *
1247 * have_foreground_color ::
1248 * There was a call to @FT_Palette_Set_Foreground_Color.
1249 *
1250 * foreground_color ::
1251 * The current foreground color corresponding to 'CPAL' color index
1252 * 0xFFFF. Only valid if `have_foreground_color` is set.
1253 *
1254 * font_program_size ::
1255 * Size in bytecodes of the face's font program. 0 if none defined.
1256 * Ignored for Type 2 fonts.
1257 *
1258 * font_program ::
1259 * The face's font program (bytecode stream) executed at load time,
1260 * also used during glyph rendering. Comes from the 'fpgm' table.
1261 * Ignored for Type 2 font fonts.
1262 *
1263 * cvt_program_size ::
1264 * The size in bytecodes of the face's cvt program. Ignored for Type 2
1265 * fonts.
1266 *
1267 * cvt_program ::
1268 * The face's cvt program (bytecode stream) executed each time an
1269 * instance/size is changed/reset. Comes from the 'prep' table.
1270 * Ignored for Type 2 fonts.
1271 *
1272 * cvt_size ::
1273 * Size of the control value table (in entries). Ignored for Type 2
1274 * fonts.
1275 *
1276 * cvt ::
1277 * The face's original control value table. Coordinates are expressed
1278 * in unscaled font units (in 26.6 format). Comes from the 'cvt~'
1279 * table. Ignored for Type 2 fonts.
1280 *
1281 * If varied by the `CVAR' table, non-integer values are possible.
1282 *
1283 * extra ::
1284 * Reserved for third-party font drivers.
1285 *
1286 * postscript_name ::
1287 * The PS name of the font. Used by the postscript name service.
1288 *
1289 * glyf_len ::
1290 * The length of the 'glyf' table. Needed for malformed 'loca' tables.
1291 *
1292 * glyf_offset ::
1293 * The file offset of the 'glyf' table.
1294 *
1295 * is_cff2 ::
1296 * Set if the font format is CFF2.
1297 *
1298 * doblend ::
1299 * A boolean which is set if the font should be blended (this is for GX
1300 * var).
1301 *
1302 * blend ::
1303 * Contains the data needed to control GX variation tables (rather like
1304 * Multiple Master data).
1305 *
1306 * variation_support ::
1307 * Flags that indicate which OpenType functionality related to font
1308 * variation support is present, valid, and usable. For example,
1309 * TT_FACE_FLAG_VAR_FVAR is only set if we have at least one design
1310 * axis.
1311 *
1312 * var_postscript_prefix ::
1313 * The PostScript name prefix needed for constructing a variation font
1314 * instance's PS name .
1315 *
1316 * var_postscript_prefix_len ::
1317 * The length of the `var_postscript_prefix` string.
1318 *
1319 * var_default_named_instance ::
1320 * The index of the default named instance.
1321 *
1322 * non_var_style_name ::
1323 * The non-variation style name, used as a backup.
1324 *
1325 * horz_metrics_size ::
1326 * The size of the 'hmtx' table.
1327 *
1328 * vert_metrics_size ::
1329 * The size of the 'vmtx' table.
1330 *
1331 * num_locations ::
1332 * The number of glyph locations in this TrueType file. This should be
1333 * one more than the number of glyphs. Ignored for Type 2 fonts.
1334 *
1335 * glyph_locations ::
1336 * An array of longs. These are offsets to glyph data within the
1337 * 'glyf' table. Ignored for Type 2 font faces.
1338 *
1339 * hdmx_table ::
1340 * A pointer to the 'hdmx' table.
1341 *
1342 * hdmx_table_size ::
1343 * The size of the 'hdmx' table.
1344 *
1345 * hdmx_record_count ::
1346 * The number of hdmx records.
1347 *
1348 * hdmx_record_size ::
1349 * The size of a single hdmx record.
1350 *
1351 * hdmx_records ::
1352 * A array of pointers to the 'hdmx' table records sorted by ppem.
1353 *
1354 * sbit_table ::
1355 * A pointer to the font's embedded bitmap location table.
1356 *
1357 * sbit_table_size ::
1358 * The size of `sbit_table`.
1359 *
1360 * sbit_table_type ::
1361 * The sbit table type (CBLC, sbix, etc.).
1362 *
1363 * sbit_num_strikes ::
1364 * The number of sbit strikes exposed by FreeType's API, omitting
1365 * invalid strikes.
1366 *
1367 * sbit_strike_map ::
1368 * A mapping between the strike indices exposed by the API and the
1369 * indices used in the font's sbit table.
1370 *
1371 * kern_table ::
1372 * A pointer to the 'kern' table.
1373 *
1374 * kern_table_size ::
1375 * The size of the 'kern' table.
1376 *
1377 * num_kern_tables ::
1378 * The number of supported kern subtables (up to 32; FreeType
1379 * recognizes only horizontal ones with format 0).
1380 *
1381 * kern_avail_bits ::
1382 * The availability status of kern subtables; if bit n is set, table n
1383 * is available.
1384 *
1385 * kern_order_bits ::
1386 * The sortedness status of kern subtables; if bit n is set, table n is
1387 * sorted.
1388 *
1389 * bdf ::
1390 * Data related to an SFNT font's 'bdf' table; see `tttypes.h`.
1391 *
1392 * horz_metrics_offset ::
1393 * The file offset of the 'hmtx' table.
1394 *
1395 * vert_metrics_offset ::
1396 * The file offset of the 'vmtx' table.
1397 *
1398 * ebdt_start ::
1399 * The file offset of the sbit data table (CBDT, bdat, etc.).
1400 *
1401 * ebdt_size ::
1402 * The size of the sbit data table.
1403 *
1404 * cpal ::
1405 * A pointer to data related to the 'CPAL' table. `NULL` if the table
1406 * is not available.
1407 *
1408 * colr ::
1409 * A pointer to data related to the 'COLR' table. `NULL` if the table
1410 * is not available.
1411 *
1412 * svg ::
1413 * A pointer to data related to the 'SVG' table. `NULL` if the table
1414 * is not available.
1415 */
1416 typedef struct TT_FaceRec_
1417 {
1418 FT_FaceRec root;
1419
1420 TTC_HeaderRec ttc_header;
1421
1422 FT_ULong format_tag;
1423 FT_UShort num_tables;
1424 TT_Table dir_tables;
1425
1426 TT_Header header; /* TrueType header table */
1427 TT_HoriHeader horizontal; /* TrueType horizontal header */
1428
1429 TT_MaxProfile max_profile;
1430
1431 FT_Bool vertical_info;
1432 TT_VertHeader vertical; /* TT Vertical header, if present */
1433
1434 FT_UShort num_names; /* number of name records */
1435 TT_NameTableRec name_table; /* name table */
1436
1437 TT_OS2 os2; /* TrueType OS/2 table */
1438 TT_Postscript postscript; /* TrueType Postscript table */
1439
1440 FT_Byte* cmap_table; /* extracted `cmap' table */
1441 FT_ULong cmap_size;
1442
1443 TT_Loader_GotoTableFunc goto_table;
1444
1445 TT_Loader_StartGlyphFunc access_glyph_frame;
1446 TT_Loader_EndGlyphFunc forget_glyph_frame;
1447 TT_Loader_ReadGlyphFunc read_glyph_header;
1448 TT_Loader_ReadGlyphFunc read_simple_glyph;
1449 TT_Loader_ReadGlyphFunc read_composite_glyph;
1450
1451 /* a typeless pointer to the SFNT_Interface table used to load */
1452 /* the basic TrueType tables in the face object */
1453 void* sfnt;
1454
1455 /* a typeless pointer to the FT_Service_PsCMapsRec table used to */
1456 /* handle glyph names <-> unicode & Mac values */
1457 void* psnames;
1458
1459#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
1460 /* a typeless pointer to the FT_Service_MultiMasters table used to */
1461 /* handle variation fonts */
1462 void* mm;
1463
1464 /* a typeless pointer to the FT_Service_MetricsVariationsRec table */
1465 /* used to handle the HVAR, VVAR, and MVAR OpenType tables by the */
1466 /* "truetype" driver */
1467 void* tt_var;
1468
1469 /* a typeless pointer to the FT_Service_MetricsVariationsRec table */
1470 /* used to handle the HVAR, VVAR, and MVAR OpenType tables by this */
1471 /* TT_Face's driver */
1472 void* face_var; /* since 2.13.1 */
1473#endif
1474
1475 /* a typeless pointer to the PostScript Aux service */
1476 void* psaux;
1477
1478
1479 /************************************************************************
1480 *
1481 * Optional TrueType/OpenType tables
1482 *
1483 */
1484
1485 /* grid-fitting and scaling table */
1486 TT_GaspRec gasp; /* the `gasp' table */
1487
1488 /* PCL 5 table */
1489 TT_PCLT pclt;
1490
1491 /* embedded bitmaps support */
1492 FT_ULong num_sbit_scales;
1493 TT_SBit_Scale sbit_scales;
1494
1495 /* postscript names table */
1496 TT_Post_NamesRec postscript_names;
1497
1498 /* glyph colors */
1499 FT_Palette_Data palette_data; /* since 2.10 */
1500 FT_UShort palette_index;
1501 FT_Color* palette;
1502 FT_Bool have_foreground_color;
1503 FT_Color foreground_color;
1504
1505
1506 /************************************************************************
1507 *
1508 * TrueType-specific fields (ignored by the CFF driver)
1509 *
1510 */
1511
1512 /* the font program, if any */
1513 FT_ULong font_program_size;
1514 FT_Byte* font_program;
1515
1516 /* the cvt program, if any */
1517 FT_ULong cvt_program_size;
1518 FT_Byte* cvt_program;
1519
1520 /* the original, unscaled, control value table */
1521 FT_ULong cvt_size;
1522 FT_Int32* cvt;
1523
1524
1525 /************************************************************************
1526 *
1527 * Other tables or fields. This is used by derivative formats like
1528 * OpenType.
1529 *
1530 */
1531
1532 FT_Generic extra;
1533
1534 const char* postscript_name;
1535
1536 FT_ULong glyf_len;
1537 FT_ULong glyf_offset; /* since 2.7.1 */
1538
1539 FT_Bool is_cff2; /* since 2.7.1 */
1540
1541#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
1542 FT_Bool doblend;
1543 GX_Blend blend;
1544
1545 FT_UInt32 variation_support; /* since 2.7.1 */
1546
1547 const char* var_postscript_prefix; /* since 2.7.2 */
1548 FT_UInt var_postscript_prefix_len; /* since 2.7.2 */
1549
1550 FT_UInt var_default_named_instance; /* since 2.13.1 */
1551
1552 const char* non_var_style_name; /* since 2.13.1 */
1553#endif
1554
1555 /* since version 2.2 */
1556
1557 FT_ULong horz_metrics_size;
1558 FT_ULong vert_metrics_size;
1559
1560 FT_ULong num_locations; /* up to 0xFFFF + 1 */
1561 FT_Byte* glyph_locations;
1562
1563 FT_Byte* hdmx_table;
1564 FT_ULong hdmx_table_size;
1565 FT_UInt hdmx_record_count;
1566 FT_ULong hdmx_record_size;
1567 FT_Byte** hdmx_records;
1568
1569 FT_Byte* sbit_table;
1570 FT_ULong sbit_table_size;
1571 TT_SbitTableType sbit_table_type;
1572 FT_UInt sbit_num_strikes;
1573 FT_UInt* sbit_strike_map;
1574
1575 FT_Byte* kern_table;
1576 FT_ULong kern_table_size;
1577 FT_UInt num_kern_tables;
1578 FT_UInt32 kern_avail_bits;
1579 FT_UInt32 kern_order_bits;
1580
1581#ifdef TT_CONFIG_OPTION_BDF
1582 TT_BDFRec bdf;
1583#endif /* TT_CONFIG_OPTION_BDF */
1584
1585 /* since 2.3.0 */
1586 FT_ULong horz_metrics_offset;
1587 FT_ULong vert_metrics_offset;
1588
1589#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
1590 /* since 2.7 */
1591 FT_ULong ebdt_start; /* either `CBDT', `EBDT', or `bdat' */
1592 FT_ULong ebdt_size;
1593#endif
1594
1595 /* since 2.10 */
1596 void* cpal;
1597 void* colr;
1598
1599 /* since 2.12 */
1600 void* svg;
1601
1602#ifdef TT_CONFIG_OPTION_GPOS_KERNING
1603 /* since 2.13.3 */
1604 FT_Byte* gpos_table;
1605 /* since 2.14 */
1606 /* This is actually an array of GPOS lookup subtables. */
1607 FT_UInt32* gpos_lookups_kerning;
1608 FT_UInt num_gpos_lookups_kerning;
1609#endif
1610
1611 } TT_FaceRec;
1612
1613
1614 /**************************************************************************
1615 *
1616 * @struct:
1617 * TT_GlyphZoneRec
1618 *
1619 * @description:
1620 * A glyph zone is used to load, scale and hint glyph outline
1621 * coordinates.
1622 *
1623 * @fields:
1624 * n_points ::
1625 * The current number of points in the zone.
1626 *
1627 * n_contours ::
1628 * The current number of contours in the zone.
1629 *
1630 * org ::
1631 * The original glyph coordinates (font units/scaled).
1632 *
1633 * cur ::
1634 * The current glyph coordinates (scaled/hinted).
1635 *
1636 * tags ::
1637 * The point control tags.
1638 *
1639 * contours ::
1640 * The contours end points.
1641 *
1642 * first_point ::
1643 * Offset of the current subglyph's first point.
1644 */
1645 typedef struct TT_GlyphZoneRec_
1646 {
1647 FT_UShort n_points; /* number of points in zone */
1648 FT_UShort n_contours; /* number of contours */
1649
1650 FT_Vector* org; /* original point coordinates */
1651 FT_Vector* cur; /* current point coordinates */
1652 FT_Vector* orus; /* original (unscaled) point coordinates */
1653
1654 FT_Byte* tags; /* current touch flags */
1655 FT_UShort* contours; /* contour end points */
1656
1657 FT_UShort first_point; /* offset of first (#0) point */
1658
1659 } TT_GlyphZoneRec, *TT_GlyphZone;
1660
1661
1662 /* handle to execution context */
1663 typedef struct TT_ExecContextRec_* TT_ExecContext;
1664
1665
1666 /**************************************************************************
1667 *
1668 * @type:
1669 * TT_Size
1670 *
1671 * @description:
1672 * A handle to a TrueType size object.
1673 */
1674 typedef struct TT_SizeRec_* TT_Size;
1675
1676
1677 /* glyph loader structure */
1678 typedef struct TT_LoaderRec_
1679 {
1680 TT_Face face;
1681 TT_Size size;
1682 FT_GlyphSlot glyph;
1683 FT_GlyphLoader gloader;
1684
1685 FT_ULong load_flags;
1686 FT_UInt glyph_index;
1687
1688 FT_Stream stream;
1689 FT_UInt byte_len;
1690
1691 FT_Short n_contours;
1692 FT_BBox bbox;
1693 FT_Int left_bearing;
1694 FT_Int advance;
1695 FT_Int linear;
1696 FT_Bool linear_def;
1697 FT_Vector pp1;
1698 FT_Vector pp2;
1699
1700 /* the zone where we load our glyphs */
1701 TT_GlyphZoneRec base;
1702 TT_GlyphZoneRec zone;
1703
1704 TT_ExecContext exec;
1705 FT_ULong ins_pos;
1706
1707 /* for possible extensibility in other formats */
1708 void* other;
1709
1710 /* since version 2.1.8 */
1711 FT_Int top_bearing;
1712 FT_Int vadvance;
1713 FT_Vector pp3;
1714 FT_Vector pp4;
1715
1716 /* since version 2.2.1 */
1717 FT_Byte* cursor;
1718 FT_Byte* limit;
1719
1720 /* since version 2.6.2 */
1721 FT_ListRec composites;
1722
1723 /* since version 2.11.2 */
1724 FT_Byte* widthp;
1725
1726 } TT_LoaderRec;
1727
1728
1729FT_END_HEADER
1730
1731#endif /* TTTYPES_H_ */
1732
1733
1734/* END */
Definition tttypes.h:809