sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
tttables.h
Go to the documentation of this file.
1/****************************************************************************
2 *
3 * tttables.h
4 *
5 * Basic SFNT/TrueType tables definitions and interface
6 * (specification 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 TTTABLES_H_
25#define TTTABLES_H_
26
27
28#include <freetype/freetype.h>
29
30#ifdef FREETYPE_H
31#error "freetype.h of FreeType 1 has been loaded!"
32#error "Please fix the directory search order for header files"
33#error "so that freetype.h of FreeType 2 is found first."
34#endif
35
36
37FT_BEGIN_HEADER
38
39 /**************************************************************************
40 *
41 * @section:
42 * truetype_tables
43 *
44 * @title:
45 * TrueType Tables
46 *
47 * @abstract:
48 * TrueType-specific table types and functions.
49 *
50 * @description:
51 * This section contains definitions of some basic tables specific to
52 * TrueType and OpenType as well as some routines used to access and
53 * process them.
54 *
55 * @order:
56 * TT_Header
57 * TT_HoriHeader
58 * TT_VertHeader
59 * TT_OS2
60 * TT_Postscript
61 * TT_PCLT
62 * TT_MaxProfile
63 *
64 * FT_Sfnt_Tag
65 * FT_Get_Sfnt_Table
66 * FT_Load_Sfnt_Table
67 * FT_Sfnt_Table_Info
68 *
69 * FT_Get_CMap_Language_ID
70 * FT_Get_CMap_Format
71 *
72 * FT_PARAM_TAG_UNPATENTED_HINTING
73 *
74 */
75
76
77 /**************************************************************************
78 *
79 * @struct:
80 * TT_Header
81 *
82 * @description:
83 * A structure to model a TrueType font header table. All fields follow
84 * the OpenType specification. The 64-bit timestamps are stored in
85 * two-element arrays `Created` and `Modified`, first the upper then
86 * the lower 32~bits.
87 */
88 typedef struct TT_Header_
89 {
90 FT_Fixed Table_Version;
91 FT_Fixed Font_Revision;
92
93 FT_Long CheckSum_Adjust;
94 FT_Long Magic_Number;
95
96 FT_UShort Flags;
97 FT_UShort Units_Per_EM;
98
99 FT_ULong Created [2];
100 FT_ULong Modified[2];
101
102 FT_Short xMin;
103 FT_Short yMin;
104 FT_Short xMax;
105 FT_Short yMax;
106
107 FT_UShort Mac_Style;
108 FT_UShort Lowest_Rec_PPEM;
109
110 FT_Short Font_Direction;
111 FT_Short Index_To_Loc_Format;
112 FT_Short Glyph_Data_Format;
113
114 } TT_Header;
115
116
117 /**************************************************************************
118 *
119 * @struct:
120 * TT_HoriHeader
121 *
122 * @description:
123 * A structure to model a TrueType horizontal header, the 'hhea' table,
124 * as well as the corresponding horizontal metrics table, 'hmtx'.
125 *
126 * @fields:
127 * Version ::
128 * The table version.
129 *
130 * Ascender ::
131 * The font's ascender, i.e., the distance from the baseline to the
132 * top-most of all glyph points found in the font.
133 *
134 * This value is invalid in many fonts, as it is usually set by the
135 * font designer, and often reflects only a portion of the glyphs found
136 * in the font (maybe ASCII).
137 *
138 * You should use the `sTypoAscender` field of the 'OS/2' table instead
139 * if you want the correct one.
140 *
141 * Descender ::
142 * The font's descender, i.e., the distance from the baseline to the
143 * bottom-most of all glyph points found in the font. It is negative.
144 *
145 * This value is invalid in many fonts, as it is usually set by the
146 * font designer, and often reflects only a portion of the glyphs found
147 * in the font (maybe ASCII).
148 *
149 * You should use the `sTypoDescender` field of the 'OS/2' table
150 * instead if you want the correct one.
151 *
152 * Line_Gap ::
153 * The font's line gap, i.e., the distance to add to the ascender and
154 * descender to get the BTB, i.e., the baseline-to-baseline distance
155 * for the font.
156 *
157 * advance_Width_Max ::
158 * This field is the maximum of all advance widths found in the font.
159 * It can be used to compute the maximum width of an arbitrary string
160 * of text.
161 *
162 * min_Left_Side_Bearing ::
163 * The minimum left side bearing of all glyphs within the font.
164 *
165 * min_Right_Side_Bearing ::
166 * The minimum right side bearing of all glyphs within the font.
167 *
168 * xMax_Extent ::
169 * The maximum horizontal extent (i.e., the 'width' of a glyph's
170 * bounding box) for all glyphs in the font.
171 *
172 * caret_Slope_Rise ::
173 * The rise coefficient of the cursor's slope of the cursor
174 * (slope=rise/run).
175 *
176 * caret_Slope_Run ::
177 * The run coefficient of the cursor's slope.
178 *
179 * caret_Offset ::
180 * The cursor's offset for slanted fonts.
181 *
182 * Reserved ::
183 * 8~reserved bytes.
184 *
185 * metric_Data_Format ::
186 * Always~0.
187 *
188 * number_Of_HMetrics ::
189 * Number of HMetrics entries in the 'hmtx' table -- this value can be
190 * smaller than the total number of glyphs in the font.
191 *
192 * long_metrics ::
193 * A pointer into the 'hmtx' table.
194 *
195 * short_metrics ::
196 * A pointer into the 'hmtx' table.
197 *
198 * @note:
199 * For OpenType Font Variations, the values of the following fields can
200 * change after a call to @FT_Set_Var_Design_Coordinates (and friends) if
201 * the font contains an 'MVAR' table: `caret_Slope_Rise`,
202 * `caret_Slope_Run`, and `caret_Offset`.
203 */
204 typedef struct TT_HoriHeader_
205 {
206 FT_Fixed Version;
207 FT_Short Ascender;
208 FT_Short Descender;
209 FT_Short Line_Gap;
210
211 FT_UShort advance_Width_Max; /* advance width maximum */
212
213 FT_Short min_Left_Side_Bearing; /* minimum left-sb */
214 FT_Short min_Right_Side_Bearing; /* minimum right-sb */
215 FT_Short xMax_Extent; /* xmax extents */
216 FT_Short caret_Slope_Rise;
217 FT_Short caret_Slope_Run;
218 FT_Short caret_Offset;
219
220 FT_Short Reserved[4];
221
222 FT_Short metric_Data_Format;
223 FT_UShort number_Of_HMetrics;
224
225 /* The following fields are not defined by the OpenType specification */
226 /* but they are used to connect the metrics header to the relevant */
227 /* 'hmtx' table. */
228
229 void* long_metrics;
230 void* short_metrics;
231
232 } TT_HoriHeader;
233
234
235 /**************************************************************************
236 *
237 * @struct:
238 * TT_VertHeader
239 *
240 * @description:
241 * A structure used to model a TrueType vertical header, the 'vhea'
242 * table, as well as the corresponding vertical metrics table, 'vmtx'.
243 *
244 * @fields:
245 * Version ::
246 * The table version.
247 *
248 * Ascender ::
249 * The font's ascender, i.e., the distance from the baseline to the
250 * top-most of all glyph points found in the font.
251 *
252 * This value is invalid in many fonts, as it is usually set by the
253 * font designer, and often reflects only a portion of the glyphs found
254 * in the font (maybe ASCII).
255 *
256 * You should use the `sTypoAscender` field of the 'OS/2' table instead
257 * if you want the correct one.
258 *
259 * Descender ::
260 * The font's descender, i.e., the distance from the baseline to the
261 * bottom-most of all glyph points found in the font. It is negative.
262 *
263 * This value is invalid in many fonts, as it is usually set by the
264 * font designer, and often reflects only a portion of the glyphs found
265 * in the font (maybe ASCII).
266 *
267 * You should use the `sTypoDescender` field of the 'OS/2' table
268 * instead if you want the correct one.
269 *
270 * Line_Gap ::
271 * The font's line gap, i.e., the distance to add to the ascender and
272 * descender to get the BTB, i.e., the baseline-to-baseline distance
273 * for the font.
274 *
275 * advance_Height_Max ::
276 * This field is the maximum of all advance heights found in the font.
277 * It can be used to compute the maximum height of an arbitrary string
278 * of text.
279 *
280 * min_Top_Side_Bearing ::
281 * The minimum top side bearing of all glyphs within the font.
282 *
283 * min_Bottom_Side_Bearing ::
284 * The minimum bottom side bearing of all glyphs within the font.
285 *
286 * yMax_Extent ::
287 * The maximum vertical extent (i.e., the 'height' of a glyph's
288 * bounding box) for all glyphs in the font.
289 *
290 * caret_Slope_Rise ::
291 * The rise coefficient of the cursor's slope of the cursor
292 * (slope=rise/run).
293 *
294 * caret_Slope_Run ::
295 * The run coefficient of the cursor's slope.
296 *
297 * caret_Offset ::
298 * The cursor's offset for slanted fonts.
299 *
300 * Reserved ::
301 * 8~reserved bytes.
302 *
303 * metric_Data_Format ::
304 * Always~0.
305 *
306 * number_Of_VMetrics ::
307 * Number of VMetrics entries in the 'vmtx' table -- this value can be
308 * smaller than the total number of glyphs in the font.
309 *
310 * long_metrics ::
311 * A pointer into the 'vmtx' table.
312 *
313 * short_metrics ::
314 * A pointer into the 'vmtx' table.
315 *
316 * @note:
317 * For OpenType Font Variations, the values of the following fields can
318 * change after a call to @FT_Set_Var_Design_Coordinates (and friends) if
319 * the font contains an 'MVAR' table: `Ascender`, `Descender`,
320 * `Line_Gap`, `caret_Slope_Rise`, `caret_Slope_Run`, and `caret_Offset`.
321 */
322 typedef struct TT_VertHeader_
323 {
324 FT_Fixed Version;
325 FT_Short Ascender;
326 FT_Short Descender;
327 FT_Short Line_Gap;
328
329 FT_UShort advance_Height_Max; /* advance height maximum */
330
331 FT_Short min_Top_Side_Bearing; /* minimum top-sb */
332 FT_Short min_Bottom_Side_Bearing; /* minimum bottom-sb */
333 FT_Short yMax_Extent; /* ymax extents */
334 FT_Short caret_Slope_Rise;
335 FT_Short caret_Slope_Run;
336 FT_Short caret_Offset;
337
338 FT_Short Reserved[4];
339
340 FT_Short metric_Data_Format;
341 FT_UShort number_Of_VMetrics;
342
343 /* The following fields are not defined by the OpenType specification */
344 /* but they are used to connect the metrics header to the relevant */
345 /* 'vmtx' table. */
346
347 void* long_metrics;
348 void* short_metrics;
349
350 } TT_VertHeader;
351
352
353 /**************************************************************************
354 *
355 * @struct:
356 * TT_OS2
357 *
358 * @description:
359 * A structure to model a TrueType 'OS/2' table. All fields comply to
360 * the OpenType specification.
361 *
362 * Note that we now support old Mac fonts that do not include an 'OS/2'
363 * table. In this case, the `version` field is always set to 0xFFFF.
364 *
365 * @note:
366 * For OpenType Font Variations, the values of the following fields can
367 * change after a call to @FT_Set_Var_Design_Coordinates (and friends) if
368 * the font contains an 'MVAR' table: `sCapHeight`, `sTypoAscender`,
369 * `sTypoDescender`, `sTypoLineGap`, `sxHeight`, `usWinAscent`,
370 * `usWinDescent`, `yStrikeoutPosition`, `yStrikeoutSize`,
371 * `ySubscriptXOffset`, `ySubScriptXSize`, `ySubscriptYOffset`,
372 * `ySubscriptYSize`, `ySuperscriptXOffset`, `ySuperscriptXSize`,
373 * `ySuperscriptYOffset`, and `ySuperscriptYSize`.
374 *
375 * Possible values for bits in the `ulUnicodeRangeX` fields are given by
376 * the @TT_UCR_XXX macros.
377 */
378
379 typedef struct TT_OS2_
380 {
381 FT_UShort version; /* 0x0001 - more or 0xFFFF */
382 FT_Short xAvgCharWidth;
383 FT_UShort usWeightClass;
384 FT_UShort usWidthClass;
385 FT_UShort fsType;
386 FT_Short ySubscriptXSize;
387 FT_Short ySubscriptYSize;
388 FT_Short ySubscriptXOffset;
389 FT_Short ySubscriptYOffset;
390 FT_Short ySuperscriptXSize;
391 FT_Short ySuperscriptYSize;
392 FT_Short ySuperscriptXOffset;
393 FT_Short ySuperscriptYOffset;
394 FT_Short yStrikeoutSize;
395 FT_Short yStrikeoutPosition;
396 FT_Short sFamilyClass;
397
398 FT_Byte panose[10];
399
400 FT_ULong ulUnicodeRange1; /* Bits 0-31 */
401 FT_ULong ulUnicodeRange2; /* Bits 32-63 */
402 FT_ULong ulUnicodeRange3; /* Bits 64-95 */
403 FT_ULong ulUnicodeRange4; /* Bits 96-127 */
404
405 FT_Char achVendID[4];
406
407 FT_UShort fsSelection;
408 FT_UShort usFirstCharIndex;
409 FT_UShort usLastCharIndex;
410 FT_Short sTypoAscender;
411 FT_Short sTypoDescender;
412 FT_Short sTypoLineGap;
413 FT_UShort usWinAscent;
414 FT_UShort usWinDescent;
415
416 /* only version 1 and higher: */
417
418 FT_ULong ulCodePageRange1; /* Bits 0-31 */
419 FT_ULong ulCodePageRange2; /* Bits 32-63 */
420
421 /* only version 2 and higher: */
422
423 FT_Short sxHeight;
424 FT_Short sCapHeight;
425 FT_UShort usDefaultChar;
426 FT_UShort usBreakChar;
427 FT_UShort usMaxContext;
428
429 /* only version 5 and higher: */
430
431 FT_UShort usLowerOpticalPointSize; /* in twips (1/20 points) */
432 FT_UShort usUpperOpticalPointSize; /* in twips (1/20 points) */
433
434 } TT_OS2;
435
436
437 /**************************************************************************
438 *
439 * @struct:
440 * TT_Postscript
441 *
442 * @description:
443 * A structure to model a TrueType 'post' table. All fields comply to
444 * the OpenType specification. This structure does not reference a
445 * font's PostScript glyph names; use @FT_Get_Glyph_Name to retrieve
446 * them.
447 *
448 * @note:
449 * For OpenType Font Variations, the values of the following fields can
450 * change after a call to @FT_Set_Var_Design_Coordinates (and friends) if
451 * the font contains an 'MVAR' table: `underlinePosition` and
452 * `underlineThickness`.
453 */
454 typedef struct TT_Postscript_
455 {
456 FT_Fixed FormatType;
457 FT_Fixed italicAngle;
458 FT_Short underlinePosition;
459 FT_Short underlineThickness;
460 FT_ULong isFixedPitch;
461 FT_ULong minMemType42;
462 FT_ULong maxMemType42;
463 FT_ULong minMemType1;
464 FT_ULong maxMemType1;
465
466 /* Glyph names follow in the 'post' table, but we don't */
467 /* load them by default. */
468
469 } TT_Postscript;
470
471
472 /**************************************************************************
473 *
474 * @struct:
475 * TT_PCLT
476 *
477 * @description:
478 * A structure to model a TrueType 'PCLT' table. All fields comply to
479 * the OpenType specification.
480 */
481 typedef struct TT_PCLT_
482 {
483 FT_Fixed Version;
484 FT_ULong FontNumber;
485 FT_UShort Pitch;
486 FT_UShort xHeight;
487 FT_UShort Style;
488 FT_UShort TypeFamily;
489 FT_UShort CapHeight;
490 FT_UShort SymbolSet;
491 FT_Char TypeFace[16];
492 FT_Char CharacterComplement[8];
493 FT_Char FileName[6];
494 FT_Char StrokeWeight;
495 FT_Char WidthType;
496 FT_Byte SerifStyle;
497 FT_Byte Reserved;
498
499 } TT_PCLT;
500
501
502 /**************************************************************************
503 *
504 * @struct:
505 * TT_MaxProfile
506 *
507 * @description:
508 * The maximum profile ('maxp') table contains many max values, which can
509 * be used to pre-allocate arrays for speeding up glyph loading and
510 * hinting.
511 *
512 * @fields:
513 * version ::
514 * The version number.
515 *
516 * numGlyphs ::
517 * The number of glyphs in this TrueType font.
518 *
519 * maxPoints ::
520 * The maximum number of points in a non-composite TrueType glyph. See
521 * also `maxCompositePoints`.
522 *
523 * maxContours ::
524 * The maximum number of contours in a non-composite TrueType glyph.
525 * See also `maxCompositeContours`.
526 *
527 * maxCompositePoints ::
528 * The maximum number of points in a composite TrueType glyph. See
529 * also `maxPoints`.
530 *
531 * maxCompositeContours ::
532 * The maximum number of contours in a composite TrueType glyph. See
533 * also `maxContours`.
534 *
535 * maxZones ::
536 * The maximum number of zones used for glyph hinting.
537 *
538 * maxTwilightPoints ::
539 * The maximum number of points in the twilight zone used for glyph
540 * hinting.
541 *
542 * maxStorage ::
543 * The maximum number of elements in the storage area used for glyph
544 * hinting.
545 *
546 * maxFunctionDefs ::
547 * The maximum number of function definitions in the TrueType bytecode
548 * for this font.
549 *
550 * maxInstructionDefs ::
551 * The maximum number of instruction definitions in the TrueType
552 * bytecode for this font.
553 *
554 * maxStackElements ::
555 * The maximum number of stack elements used during bytecode
556 * interpretation.
557 *
558 * maxSizeOfInstructions ::
559 * The maximum number of TrueType opcodes used for glyph hinting.
560 *
561 * maxComponentElements ::
562 * The maximum number of simple (i.e., non-composite) glyphs in a
563 * composite glyph.
564 *
565 * maxComponentDepth ::
566 * The maximum nesting depth of composite glyphs.
567 *
568 * @note:
569 * This structure is only used during font loading.
570 */
571 typedef struct TT_MaxProfile_
572 {
573 FT_Fixed version;
574 FT_UShort numGlyphs;
575 FT_UShort maxPoints;
576 FT_UShort maxContours;
577 FT_UShort maxCompositePoints;
578 FT_UShort maxCompositeContours;
579 FT_UShort maxZones;
580 FT_UShort maxTwilightPoints;
581 FT_UShort maxStorage;
582 FT_UShort maxFunctionDefs;
583 FT_UShort maxInstructionDefs;
584 FT_UShort maxStackElements;
585 FT_UShort maxSizeOfInstructions;
586 FT_UShort maxComponentElements;
587 FT_UShort maxComponentDepth;
588
589 } TT_MaxProfile;
590
591
592 /**************************************************************************
593 *
594 * @enum:
595 * FT_Sfnt_Tag
596 *
597 * @description:
598 * An enumeration to specify indices of SFNT tables loaded and parsed by
599 * FreeType during initialization of an SFNT font. Used in the
600 * @FT_Get_Sfnt_Table API function.
601 *
602 * @values:
603 * FT_SFNT_HEAD ::
604 * To access the font's @TT_Header structure.
605 *
606 * FT_SFNT_MAXP ::
607 * To access the font's @TT_MaxProfile structure.
608 *
609 * FT_SFNT_OS2 ::
610 * To access the font's @TT_OS2 structure.
611 *
612 * FT_SFNT_HHEA ::
613 * To access the font's @TT_HoriHeader structure.
614 *
615 * FT_SFNT_VHEA ::
616 * To access the font's @TT_VertHeader structure.
617 *
618 * FT_SFNT_POST ::
619 * To access the font's @TT_Postscript structure.
620 *
621 * FT_SFNT_PCLT ::
622 * To access the font's @TT_PCLT structure.
623 */
624 typedef enum FT_Sfnt_Tag_
625 {
626 FT_SFNT_HEAD,
627 FT_SFNT_MAXP,
628 FT_SFNT_OS2,
629 FT_SFNT_HHEA,
630 FT_SFNT_VHEA,
631 FT_SFNT_POST,
632 FT_SFNT_PCLT,
633
634 FT_SFNT_MAX
635
636 } FT_Sfnt_Tag;
637
638 /* these constants are deprecated; use the corresponding `FT_Sfnt_Tag` */
639 /* values instead */
640#define ft_sfnt_head FT_SFNT_HEAD
641#define ft_sfnt_maxp FT_SFNT_MAXP
642#define ft_sfnt_os2 FT_SFNT_OS2
643#define ft_sfnt_hhea FT_SFNT_HHEA
644#define ft_sfnt_vhea FT_SFNT_VHEA
645#define ft_sfnt_post FT_SFNT_POST
646#define ft_sfnt_pclt FT_SFNT_PCLT
647
648
649 /**************************************************************************
650 *
651 * @function:
652 * FT_Get_Sfnt_Table
653 *
654 * @description:
655 * Return a pointer to a given SFNT table stored within a face.
656 *
657 * @input:
658 * face ::
659 * A handle to the source.
660 *
661 * tag ::
662 * The index of the SFNT table.
663 *
664 * @return:
665 * A type-less pointer to the table. This will be `NULL` in case of
666 * error, or if the corresponding table was not found **OR** loaded from
667 * the file.
668 *
669 * Use a typecast according to `tag` to access the structure elements.
670 *
671 * @note:
672 * The table is owned by the face object and disappears with it.
673 *
674 * This function is only useful to access SFNT tables that are loaded by
675 * the sfnt, truetype, and opentype drivers. See @FT_Sfnt_Tag for a
676 * list.
677 *
678 * @example:
679 * Here is an example demonstrating access to the 'vhea' table.
680 *
681 * ```
682 * TT_VertHeader* vert_header;
683 *
684 *
685 * vert_header =
686 * (TT_VertHeader*)FT_Get_Sfnt_Table( face, FT_SFNT_VHEA );
687 * ```
688 */
689 FT_EXPORT( void* )
690 FT_Get_Sfnt_Table( FT_Face face,
691 FT_Sfnt_Tag tag );
692
693
694 /**************************************************************************
695 *
696 * @function:
697 * FT_Load_Sfnt_Table
698 *
699 * @description:
700 * Load any SFNT font table into client memory.
701 *
702 * @input:
703 * face ::
704 * A handle to the source face.
705 *
706 * tag ::
707 * The four-byte tag of the table to load. Use value~0 if you want to
708 * access the whole font file. Otherwise, you can use one of the
709 * definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new
710 * one with @FT_MAKE_TAG.
711 *
712 * [Since 2.14] Use value~1 if you want to access the table directory
713 * of the (currently selected) font.
714 *
715 * offset ::
716 * The starting offset in the table (or file if tag~==~0).
717 *
718 * @output:
719 * buffer ::
720 * The target buffer address. The client must ensure that the memory
721 * array is big enough to hold the data.
722 *
723 * @inout:
724 * length ::
725 * If the `length` parameter is `NULL`, try to load the whole table.
726 * Return an error code if it fails.
727 *
728 * Else, if `*length` is~0, exit immediately while returning the
729 * table's (or file) full size in it.
730 *
731 * Else the number of bytes to read from the table or file, from the
732 * starting offset.
733 *
734 * @return:
735 * FreeType error code. 0~means success.
736 *
737 * @note:
738 * If you need to determine the table's length you should first call this
739 * function with `*length` set to~0, as in the following example:
740 *
741 * ```
742 * FT_ULong length = 0;
743 *
744 *
745 * error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );
746 * if ( error ) { ... table does not exist ... }
747 *
748 * buffer = malloc( length );
749 * if ( buffer == NULL ) { ... not enough memory ... }
750 *
751 * error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
752 * if ( error ) { ... could not load table ... }
753 * ```
754 *
755 * Note that structures like @TT_Header or @TT_OS2 can't be used with
756 * this function; they are limited to @FT_Get_Sfnt_Table. Reason is that
757 * those structures depend on the processor architecture, with varying
758 * size (e.g. 32bit vs. 64bit) or order (big endian vs. little endian).
759 *
760 */
761 FT_EXPORT( FT_Error )
762 FT_Load_Sfnt_Table( FT_Face face,
763 FT_ULong tag,
764 FT_Long offset,
765 FT_Byte* buffer,
766 FT_ULong* length );
767
768
769 /**************************************************************************
770 *
771 * @function:
772 * FT_Sfnt_Table_Info
773 *
774 * @description:
775 * Return information on an SFNT table.
776 *
777 * @input:
778 * face ::
779 * A handle to the source face.
780 *
781 * table_index ::
782 * The index of an SFNT table. The function returns
783 * FT_Err_Table_Missing for an invalid value.
784 *
785 * @inout:
786 * tag ::
787 * The name tag of the SFNT table. If the value is `NULL`,
788 * `table_index` is ignored, and `length` returns the number of SFNT
789 * tables in the font.
790 *
791 * @output:
792 * length ::
793 * The length of the SFNT table (or the number of SFNT tables,
794 * depending on `tag`).
795 *
796 * @return:
797 * FreeType error code. 0~means success.
798 *
799 * @note:
800 * While parsing fonts, FreeType handles SFNT tables with length zero as
801 * missing.
802 *
803 */
804 FT_EXPORT( FT_Error )
805 FT_Sfnt_Table_Info( FT_Face face,
806 FT_UInt table_index,
807 FT_ULong *tag,
808 FT_ULong *length );
809
810
811 /**************************************************************************
812 *
813 * @function:
814 * FT_Get_CMap_Language_ID
815 *
816 * @description:
817 * Return cmap language ID as specified in the OpenType standard.
818 * Definitions of language ID values are in file @FT_TRUETYPE_IDS_H.
819 *
820 * @input:
821 * charmap ::
822 * The target charmap.
823 *
824 * @return:
825 * The language ID of `charmap`. If `charmap` doesn't belong to an SFNT
826 * face, just return~0 as the default value.
827 *
828 * For a format~14 cmap (to access Unicode IVS), the return value is
829 * 0xFFFFFFFF.
830 */
831 FT_EXPORT( FT_ULong )
832 FT_Get_CMap_Language_ID( FT_CharMap charmap );
833
834
835 /**************************************************************************
836 *
837 * @function:
838 * FT_Get_CMap_Format
839 *
840 * @description:
841 * Return the format of an SFNT 'cmap' table.
842 *
843 * @input:
844 * charmap ::
845 * The target charmap.
846 *
847 * @return:
848 * The format of `charmap`. If `charmap` doesn't belong to an SFNT face
849 * (including the synthetic Unicode charmap sometimes created by
850 * FreeType), return -1.
851 */
852 FT_EXPORT( FT_Long )
853 FT_Get_CMap_Format( FT_CharMap charmap );
854
855 /* */
856
857
858FT_END_HEADER
859
860#endif /* TTTABLES_H_ */
861
862
863/* END */