sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
sfnt.h
Go to the documentation of this file.
1/****************************************************************************
2 *
3 * sfnt.h
4 *
5 * High-level 'sfnt' driver interface (specification).
6 *
7 * Copyright (C) 1996-2025 by
8 * David Turner, Robert Wilhelm, and Werner Lemberg.
9 *
10 * This file is part of the FreeType project, and may only be used,
11 * modified, and distributed under the terms of the FreeType project
12 * license, LICENSE.TXT. By continuing to use, modify, or distribute
13 * this file you indicate that you have read the license and
14 * understand and accept it fully.
15 *
16 */
17
18
23#ifndef SFNT_H_
24#define SFNT_H_
25
26
30
31
32FT_BEGIN_HEADER
33
34
35 /**************************************************************************
36 *
37 * @functype:
38 * TT_Init_Face_Func
39 *
40 * @description:
41 * First part of the SFNT face object initialization. This finds the
42 * face in a SFNT file or collection, and load its format tag in
43 * face->format_tag.
44 *
45 * @input:
46 * stream ::
47 * The input stream.
48 *
49 * face ::
50 * A handle to the target face object.
51 *
52 * face_index ::
53 * The index of the TrueType font, if we are opening a collection, in
54 * bits 0-15. The numbered instance index~+~1 of a GX (sub)font, if
55 * applicable, in bits 16-30.
56 *
57 * num_params ::
58 * The number of additional parameters.
59 *
60 * params ::
61 * Optional additional parameters.
62 *
63 * @return:
64 * FreeType error code. 0 means success.
65 *
66 * @note:
67 * The stream cursor must be at the font file's origin.
68 *
69 * This function recognizes fonts embedded in a 'TrueType collection'.
70 *
71 * Once the format tag has been validated by the font driver, it should
72 * then call the TT_Load_Face_Func() callback to read the rest of the
73 * SFNT tables in the object.
74 */
75 typedef FT_Error
76 (*TT_Init_Face_Func)( FT_Stream stream,
77 TT_Face face,
78 FT_Int face_index,
79 FT_Int num_params,
80 FT_Parameter* params );
81
82
83 /**************************************************************************
84 *
85 * @functype:
86 * TT_Load_Face_Func
87 *
88 * @description:
89 * Second part of the SFNT face object initialization. This loads the
90 * common SFNT tables (head, OS/2, maxp, metrics, etc.) in the face
91 * object.
92 *
93 * @input:
94 * stream ::
95 * The input stream.
96 *
97 * face ::
98 * A handle to the target face object.
99 *
100 * face_index ::
101 * The index of the TrueType font, if we are opening a collection, in
102 * bits 0-15. The numbered instance index~+~1 of a GX (sub)font, if
103 * applicable, in bits 16-30.
104 *
105 * num_params ::
106 * The number of additional parameters.
107 *
108 * params ::
109 * Optional additional parameters.
110 *
111 * @return:
112 * FreeType error code. 0 means success.
113 *
114 * @note:
115 * This function must be called after TT_Init_Face_Func().
116 */
117 typedef FT_Error
118 (*TT_Load_Face_Func)( FT_Stream stream,
119 TT_Face face,
120 FT_Int face_index,
121 FT_Int num_params,
122 FT_Parameter* params );
123
124
125 /**************************************************************************
126 *
127 * @functype:
128 * TT_Done_Face_Func
129 *
130 * @description:
131 * A callback used to delete the common SFNT data from a face.
132 *
133 * @input:
134 * face ::
135 * A handle to the target face object.
136 *
137 * @note:
138 * This function does NOT destroy the face object.
139 */
140 typedef void
141 (*TT_Done_Face_Func)( TT_Face face );
142
143
144 /**************************************************************************
145 *
146 * @functype:
147 * TT_Load_Any_Func
148 *
149 * @description:
150 * Load any font table into client memory.
151 *
152 * @input:
153 * face ::
154 * The face object to look for.
155 *
156 * tag ::
157 * The tag of table to load. Use the value 0 if you want to access the
158 * whole font file, else set this parameter to a valid TrueType table
159 * tag that you can forge with the MAKE_TT_TAG macro.
160 *
161 * offset ::
162 * The starting offset in the table (or the file if tag == 0).
163 *
164 * length ::
165 * The address of the decision variable:
166 *
167 * If `length == NULL`: Loads the whole table. Returns an error if
168 * 'offset' == 0!
169 *
170 * If `*length == 0`: Exits immediately; returning the length of the
171 * given table or of the font file, depending on the value of 'tag'.
172 *
173 * If `*length != 0`: Loads the next 'length' bytes of table or font,
174 * starting at offset 'offset' (in table or font too).
175 *
176 * @output:
177 * buffer ::
178 * The address of target buffer.
179 *
180 * @return:
181 * TrueType error code. 0 means success.
182 */
183 typedef FT_Error
184 (*TT_Load_Any_Func)( TT_Face face,
185 FT_ULong tag,
186 FT_Long offset,
187 FT_Byte *buffer,
188 FT_ULong* length );
189
190
191 /**************************************************************************
192 *
193 * @functype:
194 * TT_Find_SBit_Image_Func
195 *
196 * @description:
197 * Check whether an embedded bitmap (an 'sbit') exists for a given glyph,
198 * at a given strike.
199 *
200 * @input:
201 * face ::
202 * The target face object.
203 *
204 * glyph_index ::
205 * The glyph index.
206 *
207 * strike_index ::
208 * The current strike index.
209 *
210 * @output:
211 * arange ::
212 * The SBit range containing the glyph index.
213 *
214 * astrike ::
215 * The SBit strike containing the glyph index.
216 *
217 * aglyph_offset ::
218 * The offset of the glyph data in 'EBDT' table.
219 *
220 * @return:
221 * FreeType error code. 0 means success. Returns
222 * SFNT_Err_Invalid_Argument if no sbit exists for the requested glyph.
223 */
224 typedef FT_Error
225 (*TT_Find_SBit_Image_Func)( TT_Face face,
226 FT_UInt glyph_index,
227 FT_ULong strike_index,
228 TT_SBit_Range *arange,
229 TT_SBit_Strike *astrike,
230 FT_ULong *aglyph_offset );
231
232
233 /**************************************************************************
234 *
235 * @functype:
236 * TT_Load_SBit_Metrics_Func
237 *
238 * @description:
239 * Get the big metrics for a given embedded bitmap.
240 *
241 * @input:
242 * stream ::
243 * The input stream.
244 *
245 * range ::
246 * The SBit range containing the glyph.
247 *
248 * @output:
249 * big_metrics ::
250 * A big SBit metrics structure for the glyph.
251 *
252 * @return:
253 * FreeType error code. 0 means success.
254 *
255 * @note:
256 * The stream cursor must be positioned at the glyph's offset within the
257 * 'EBDT' table before the call.
258 *
259 * If the image format uses variable metrics, the stream cursor is
260 * positioned just after the metrics header in the 'EBDT' table on
261 * function exit.
262 */
263 typedef FT_Error
264 (*TT_Load_SBit_Metrics_Func)( FT_Stream stream,
265 TT_SBit_Range range,
266 TT_SBit_Metrics metrics );
267
268
269 /**************************************************************************
270 *
271 * @functype:
272 * TT_Load_SBit_Image_Func
273 *
274 * @description:
275 * Load a given glyph sbit image from the font resource. This also
276 * returns its metrics.
277 *
278 * @input:
279 * face ::
280 * The target face object.
281 *
282 * strike_index ::
283 * The strike index.
284 *
285 * glyph_index ::
286 * The current glyph index.
287 *
288 * load_flags ::
289 * The current load flags.
290 *
291 * stream ::
292 * The input stream.
293 *
294 * @output:
295 * amap ::
296 * The target pixmap.
297 *
298 * ametrics ::
299 * A big sbit metrics structure for the glyph image.
300 *
301 * @return:
302 * FreeType error code. 0 means success. Returns an error if no glyph
303 * sbit exists for the index.
304 *
305 * @note:
306 * The `map.buffer` field is always freed before the glyph is loaded.
307 */
308 typedef FT_Error
309 (*TT_Load_SBit_Image_Func)( TT_Face face,
310 FT_ULong strike_index,
311 FT_UInt glyph_index,
312 FT_UInt load_flags,
313 FT_Stream stream,
314 FT_Bitmap *amap,
315 TT_SBit_MetricsRec *ametrics );
316
317
318 /**************************************************************************
319 *
320 * @functype:
321 * TT_Load_Svg_Doc_Func
322 *
323 * @description:
324 * Scan the SVG document list to find the document containing the glyph
325 * that has the ID 'glyph*XXX*', where *XXX* is the value of
326 * `glyph_index` as a decimal integer.
327 *
328 * @inout:
329 * glyph ::
330 * The glyph slot from which pointers to the SVG document list is to be
331 * grabbed. The results are stored back in the slot.
332 *
333 * @input:
334 * glyph_index ::
335 * The index of the glyph that is to be looked up.
336 *
337 * @return:
338 * FreeType error code. 0 means success.
339 */
340 typedef FT_Error
341 (*TT_Load_Svg_Doc_Func)( FT_GlyphSlot glyph,
342 FT_UInt glyph_index );
343
344
345 /**************************************************************************
346 *
347 * @functype:
348 * TT_Set_SBit_Strike_Func
349 *
350 * @description:
351 * Select an sbit strike for a given size request.
352 *
353 * @input:
354 * face ::
355 * The target face object.
356 *
357 * req ::
358 * The size request.
359 *
360 * @output:
361 * astrike_index ::
362 * The index of the sbit strike.
363 *
364 * @return:
365 * FreeType error code. 0 means success. Returns an error if no sbit
366 * strike exists for the selected ppem values.
367 */
368 typedef FT_Error
369 (*TT_Set_SBit_Strike_Func)( TT_Face face,
370 FT_Size_Request req,
371 FT_ULong* astrike_index );
372
373
374 /**************************************************************************
375 *
376 * @functype:
377 * TT_Load_Strike_Metrics_Func
378 *
379 * @description:
380 * Load the metrics of a given strike.
381 *
382 * @input:
383 * face ::
384 * The target face object.
385 *
386 * strike_index ::
387 * The strike index.
388 *
389 * @output:
390 * metrics ::
391 * the metrics of the strike.
392 *
393 * @return:
394 * FreeType error code. 0 means success. Returns an error if no such
395 * sbit strike exists.
396 */
397 typedef FT_Error
398 (*TT_Load_Strike_Metrics_Func)( TT_Face face,
399 FT_ULong strike_index,
400 FT_Size_Metrics* metrics );
401
402
403 /**************************************************************************
404 *
405 * @functype:
406 * TT_Get_PS_Name_Func
407 *
408 * @description:
409 * Get the PostScript glyph name of a glyph.
410 *
411 * @input:
412 * idx ::
413 * The glyph index.
414 *
415 * PSname ::
416 * The address of a string pointer. Will be `NULL` in case of error,
417 * otherwise it is a pointer to the glyph name.
418 *
419 * You must not modify the returned string!
420 *
421 * @output:
422 * FreeType error code. 0 means success.
423 */
424 typedef FT_Error
425 (*TT_Get_PS_Name_Func)( TT_Face face,
426 FT_UInt idx,
427 FT_String** PSname );
428
429
430 /**************************************************************************
431 *
432 * @functype:
433 * TT_Load_Metrics_Func
434 *
435 * @description:
436 * Load a metrics table, which is a table with a horizontal and a
437 * vertical version.
438 *
439 * @input:
440 * face ::
441 * A handle to the target face object.
442 *
443 * stream ::
444 * The input stream.
445 *
446 * vertical ::
447 * A boolean flag. If set, load the vertical one.
448 *
449 * @return:
450 * FreeType error code. 0 means success.
451 */
452 typedef FT_Error
453 (*TT_Load_Metrics_Func)( TT_Face face,
454 FT_Stream stream,
455 FT_Bool vertical );
456
457
458 /**************************************************************************
459 *
460 * @functype:
461 * TT_Get_Metrics_Func
462 *
463 * @description:
464 * Load the horizontal or vertical header in a face object.
465 *
466 * @input:
467 * face ::
468 * A handle to the target face object.
469 *
470 * vertical ::
471 * A boolean flag. If set, load vertical metrics.
472 *
473 * gindex ::
474 * The glyph index.
475 *
476 * @output:
477 * abearing ::
478 * The horizontal (or vertical) bearing. Set to zero in case of error.
479 *
480 * aadvance ::
481 * The horizontal (or vertical) advance. Set to zero in case of error.
482 */
483 typedef void
484 (*TT_Get_Metrics_Func)( TT_Face face,
485 FT_Bool vertical,
486 FT_UInt gindex,
487 FT_Short* abearing,
488 FT_UShort* aadvance );
489
490
491 /**************************************************************************
492 *
493 * @functype:
494 * TT_Set_Palette_Func
495 *
496 * @description:
497 * Load the colors into `face->palette` for a given palette index.
498 *
499 * @input:
500 * face ::
501 * The target face object.
502 *
503 * idx ::
504 * The palette index.
505 *
506 * @return:
507 * FreeType error code. 0 means success.
508 */
509 typedef FT_Error
510 (*TT_Set_Palette_Func)( TT_Face face,
511 FT_UInt idx );
512
513
514 /**************************************************************************
515 *
516 * @functype:
517 * TT_Get_Colr_Layer_Func
518 *
519 * @description:
520 * Iteratively get the color layer data of a given glyph index.
521 *
522 * @input:
523 * face ::
524 * The target face object.
525 *
526 * base_glyph ::
527 * The glyph index the colored glyph layers are associated with.
528 *
529 * @inout:
530 * iterator ::
531 * An @FT_LayerIterator object. For the first call you should set
532 * `iterator->p` to `NULL`. For all following calls, simply use the
533 * same object again.
534 *
535 * @output:
536 * aglyph_index ::
537 * The glyph index of the current layer.
538 *
539 * acolor_index ::
540 * The color index into the font face's color palette of the current
541 * layer. The value 0xFFFF is special; it doesn't reference a palette
542 * entry but indicates that the text foreground color should be used
543 * instead (to be set up by the application outside of FreeType).
544 *
545 * @return:
546 * Value~1 if everything is OK. If there are no more layers (or if there
547 * are no layers at all), value~0 gets returned. In case of an error,
548 * value~0 is returned also.
549 */
550 typedef FT_Bool
551 (*TT_Get_Colr_Layer_Func)( TT_Face face,
552 FT_UInt base_glyph,
553 FT_UInt *aglyph_index,
554 FT_UInt *acolor_index,
555 FT_LayerIterator* iterator );
556
557
558 /**************************************************************************
559 *
560 * @functype:
561 * TT_Get_Color_Glyph_Paint_Func
562 *
563 * @description:
564 * Find the root @FT_OpaquePaint object for a given glyph ID.
565 *
566 * @input:
567 * face ::
568 * The target face object.
569 *
570 * base_glyph ::
571 * The glyph index the colored glyph layers are associated with.
572 *
573 * @output:
574 * paint ::
575 * The root @FT_OpaquePaint object.
576 *
577 * @return:
578 * Value~1 if everything is OK. If no color glyph is found, or the root
579 * paint could not be retrieved, value~0 gets returned. In case of an
580 * error, value~0 is returned also.
581 */
582 typedef FT_Bool
583 ( *TT_Get_Color_Glyph_Paint_Func )( TT_Face face,
584 FT_UInt base_glyph,
585 FT_Color_Root_Transform root_transform,
586 FT_OpaquePaint *paint );
587
588
589 /**************************************************************************
590 *
591 * @functype:
592 * TT_Get_Color_Glyph_ClipBox_Func
593 *
594 * @description:
595 * Search for a 'COLR' v1 clip box for the specified `base_glyph` and
596 * fill the `clip_box` parameter with the 'COLR' v1 'ClipBox' information
597 * if one is found.
598 *
599 * @input:
600 * face ::
601 * A handle to the parent face object.
602 *
603 * base_glyph ::
604 * The glyph index for which to retrieve the clip box.
605 *
606 * @output:
607 * clip_box ::
608 * The clip box for the requested `base_glyph` if one is found. The
609 * clip box is computed taking scale and transformations configured on
610 * the @FT_Face into account. @FT_ClipBox contains @FT_Vector values
611 * in 26.6 format.
612 *
613 * @note:
614 * To retrieve the clip box in font units, reset scale to units-per-em
615 * and remove transforms configured using @FT_Set_Transform.
616 *
617 * @return:
618 * Value~1 if a ClipBox is found. If no clip box is found or an
619 * error occurred, value~0 is returned.
620 */
621 typedef FT_Bool
622 ( *TT_Get_Color_Glyph_ClipBox_Func )( TT_Face face,
623 FT_UInt base_glyph,
624 FT_ClipBox* clip_box );
625
626
627 /**************************************************************************
628 *
629 * @functype:
630 * TT_Get_Paint_Layers_Func
631 *
632 * @description:
633 * Access the layers of a `PaintColrLayers` table.
634 *
635 * @input:
636 * face ::
637 * The target face object.
638 *
639 * @inout:
640 * iterator ::
641 * The @FT_LayerIterator from an @FT_PaintColrLayers object, for which
642 * the layers are to be retrieved. The internal state of the iterator
643 * is incremented after one call to this function for retrieving one
644 * layer.
645 *
646 * @output:
647 * paint ::
648 * The root @FT_OpaquePaint object referencing the actual paint table.
649 *
650 * @return:
651 * Value~1 if everything is OK. Value~0 gets returned when the paint
652 * object can not be retrieved or any other error occurs.
653 */
654 typedef FT_Bool
655 ( *TT_Get_Paint_Layers_Func )( TT_Face face,
656 FT_LayerIterator* iterator,
657 FT_OpaquePaint *paint );
658
659
660 /**************************************************************************
661 *
662 * @functype:
663 * TT_Get_Colorline_Stops_Func
664 *
665 * @description:
666 * Get the gradient and solid fill information for a given glyph.
667 *
668 * @input:
669 * face ::
670 * The target face object.
671 *
672 * @inout:
673 * iterator ::
674 * An @FT_ColorStopIterator object. For the first call you should set
675 * `iterator->p` to `NULL`. For all following calls, simply use the
676 * same object again.
677 *
678 * @output:
679 * color_stop ::
680 * Color index and alpha value for the retrieved color stop.
681 *
682 * @return:
683 * Value~1 if everything is OK. If there are no more color stops,
684 * value~0 gets returned. In case of an error, value~0 is returned
685 * also.
686 */
687 typedef FT_Bool
688 ( *TT_Get_Colorline_Stops_Func )( TT_Face face,
689 FT_ColorStop *color_stop,
690 FT_ColorStopIterator* iterator );
691
692
693 /**************************************************************************
694 *
695 * @functype:
696 * TT_Get_Paint_Func
697 *
698 * @description:
699 * Get the paint details for a given @FT_OpaquePaint object.
700 *
701 * @input:
702 * face ::
703 * The target face object.
704 *
705 * opaque_paint ::
706 * The @FT_OpaquePaint object.
707 *
708 * @output:
709 * paint ::
710 * An @FT_COLR_Paint object holding the details on `opaque_paint`.
711 *
712 * @return:
713 * Value~1 if everything is OK. Value~0 if no details can be found for
714 * this paint or any other error occurred.
715 */
716 typedef FT_Bool
717 ( *TT_Get_Paint_Func )( TT_Face face,
718 FT_OpaquePaint opaque_paint,
719 FT_COLR_Paint *paint );
720
721
722 /**************************************************************************
723 *
724 * @functype:
725 * TT_Blend_Colr_Func
726 *
727 * @description:
728 * Blend the bitmap in `new_glyph` into `base_glyph` using the color
729 * specified by `color_index`. If `color_index` is 0xFFFF, use
730 * `face->foreground_color` if `face->have_foreground_color` is set.
731 * Otherwise check `face->palette_data.palette_flags`: If present and
732 * @FT_PALETTE_FOR_DARK_BACKGROUND is set, use BGRA value 0xFFFFFFFF
733 * (white opaque). Otherwise use BGRA value 0x000000FF (black opaque).
734 *
735 * @input:
736 * face ::
737 * The target face object.
738 *
739 * color_index ::
740 * Color index from the COLR table.
741 *
742 * base_glyph ::
743 * Slot for bitmap to be merged into. The underlying bitmap may get
744 * reallocated.
745 *
746 * new_glyph ::
747 * Slot to be incooperated into `base_glyph`.
748 *
749 * @return:
750 * FreeType error code. 0 means success. Returns an error if
751 * color_index is invalid or reallocation fails.
752 */
753 typedef FT_Error
754 (*TT_Blend_Colr_Func)( TT_Face face,
755 FT_UInt color_index,
756 FT_GlyphSlot base_glyph,
757 FT_GlyphSlot new_glyph );
758
759
760 /**************************************************************************
761 *
762 * @functype:
763 * TT_Get_Name_Func
764 *
765 * @description:
766 * From the 'name' table, return a given ENGLISH name record in ASCII.
767 *
768 * @input:
769 * face ::
770 * A handle to the source face object.
771 *
772 * nameid ::
773 * The name id of the name record to return.
774 *
775 * @inout:
776 * name ::
777 * The address of an allocated string pointer. `NULL` if no name is
778 * present.
779 *
780 * @return:
781 * FreeType error code. 0 means success.
782 */
783 typedef FT_Error
784 (*TT_Get_Name_Func)( TT_Face face,
785 FT_UShort nameid,
786 FT_String** name );
787
788
789 /**************************************************************************
790 *
791 * @functype:
792 * TT_Get_Name_ID_Func
793 *
794 * @description:
795 * Search whether an ENGLISH version for a given name ID is in the 'name'
796 * table.
797 *
798 * @input:
799 * face ::
800 * A handle to the source face object.
801 *
802 * nameid ::
803 * The name id of the name record to return.
804 *
805 * @output:
806 * win ::
807 * If non-negative, an index into the 'name' table with the
808 * corresponding (3,1) or (3,0) Windows entry.
809 *
810 * apple ::
811 * If non-negative, an index into the 'name' table with the
812 * corresponding (1,0) Apple entry.
813 *
814 * @return:
815 * 1 if there is either a win or apple entry (or both), 0 otherwise.
816 */
817 typedef FT_Bool
818 (*TT_Get_Name_ID_Func)( TT_Face face,
819 FT_UShort nameid,
820 FT_Int *win,
821 FT_Int *apple );
822
823
824 /**************************************************************************
825 *
826 * @functype:
827 * TT_Load_Table_Func
828 *
829 * @description:
830 * Load a given TrueType table.
831 *
832 * @input:
833 * face ::
834 * A handle to the target face object.
835 *
836 * stream ::
837 * The input stream.
838 *
839 * @return:
840 * FreeType error code. 0 means success.
841 *
842 * @note:
843 * The function uses `face->goto_table` to seek the stream to the start
844 * of the table, except while loading the font directory.
845 */
846 typedef FT_Error
847 (*TT_Load_Table_Func)( TT_Face face,
848 FT_Stream stream );
849
850
851 /**************************************************************************
852 *
853 * @functype:
854 * TT_Free_Table_Func
855 *
856 * @description:
857 * Free a given TrueType table.
858 *
859 * @input:
860 * face ::
861 * A handle to the target face object.
862 */
863 typedef void
864 (*TT_Free_Table_Func)( TT_Face face );
865
866
867 /*
868 * @functype:
869 * TT_Face_GetKerningFunc
870 *
871 * @description:
872 * Return the horizontal kerning value between two glyphs.
873 *
874 * @input:
875 * face ::
876 * A handle to the source face object.
877 *
878 * left_glyph ::
879 * The left glyph index.
880 *
881 * right_glyph ::
882 * The right glyph index.
883 *
884 * @return:
885 * The kerning value in font units.
886 */
887 typedef FT_Int
888 (*TT_Face_GetKerningFunc)( TT_Face face,
889 FT_UInt left_glyph,
890 FT_UInt right_glyph );
891
892
893 /**************************************************************************
894 *
895 * @struct:
896 * SFNT_Interface
897 *
898 * @description:
899 * This structure holds pointers to the functions used to load and free
900 * the basic tables that are required in a 'sfnt' font file.
901 *
902 * @fields:
903 * Check the various xxx_Func() descriptions for details.
904 */
905 typedef struct SFNT_Interface_
906 {
907 TT_Loader_GotoTableFunc goto_table;
908
909 TT_Init_Face_Func init_face;
910 TT_Load_Face_Func load_face;
911 TT_Done_Face_Func done_face;
912 FT_Module_Requester get_interface;
913
914 TT_Load_Any_Func load_any;
915
916 /* these functions are called by `load_face' but they can also */
917 /* be called from external modules, if there is a need to do so */
918 TT_Load_Table_Func load_head;
919 TT_Load_Metrics_Func load_hhea;
920 TT_Load_Table_Func load_cmap;
921 TT_Load_Table_Func load_maxp;
922 TT_Load_Table_Func load_os2;
923 TT_Load_Table_Func load_post;
924
925 TT_Load_Table_Func load_name;
926 TT_Free_Table_Func free_name;
927
928 /* this field was called `load_kerning' up to version 2.1.10 */
929 TT_Load_Table_Func load_kern;
930
931 TT_Load_Table_Func load_gpos;
932 TT_Load_Table_Func load_gasp;
933 TT_Load_Table_Func load_pclt;
934
935 /* see `ttload.h'; this field was called `load_bitmap_header' up to */
936 /* version 2.1.10 */
937 TT_Load_Table_Func load_bhed;
938
939 TT_Load_SBit_Image_Func load_sbit_image;
940
941 /* see `ttpost.h' */
942 TT_Get_PS_Name_Func get_psname;
943 TT_Free_Table_Func free_psnames;
944
945 /* starting here, the structure differs from version 2.1.7 */
946
947 /* this field was introduced in version 2.1.8, named `get_psname' */
948 TT_Face_GetKerningFunc get_kerning;
949
950 /* new elements introduced after version 2.1.10 */
951
952 TT_Face_GetKerningFunc get_gpos_kerning;
953
954 /* load the font directory, i.e., the offset table and */
955 /* the table directory */
956 TT_Load_Table_Func load_font_dir;
957 TT_Load_Metrics_Func load_hmtx;
958
959 TT_Load_Table_Func load_eblc;
960 TT_Free_Table_Func free_eblc;
961
962 TT_Set_SBit_Strike_Func set_sbit_strike;
963 TT_Load_Strike_Metrics_Func load_strike_metrics;
964
965 TT_Load_Table_Func load_cpal;
966 TT_Load_Table_Func load_colr;
967 TT_Free_Table_Func free_cpal;
968 TT_Free_Table_Func free_colr;
969 TT_Set_Palette_Func set_palette;
970 TT_Get_Colr_Layer_Func get_colr_layer;
971 TT_Get_Color_Glyph_Paint_Func get_colr_glyph_paint;
972 TT_Get_Color_Glyph_ClipBox_Func get_color_glyph_clipbox;
973 TT_Get_Paint_Layers_Func get_paint_layers;
974 TT_Get_Colorline_Stops_Func get_colorline_stops;
975 TT_Get_Paint_Func get_paint;
976 TT_Blend_Colr_Func colr_blend;
977
978 TT_Get_Metrics_Func get_metrics;
979
980 TT_Get_Name_Func get_name;
981 TT_Get_Name_ID_Func get_name_id;
982
983 /* OpenType SVG Support */
984 TT_Load_Table_Func load_svg;
985 TT_Free_Table_Func free_svg;
986 TT_Load_Svg_Doc_Func load_svg_doc;
987
988 } SFNT_Interface;
989
990
991 /* transitional */
992 typedef SFNT_Interface* SFNT_Service;
993
994
995#define FT_DEFINE_SFNT_INTERFACE( \
996 class_, \
997 goto_table_, \
998 init_face_, \
999 load_face_, \
1000 done_face_, \
1001 get_interface_, \
1002 load_any_, \
1003 load_head_, \
1004 load_hhea_, \
1005 load_cmap_, \
1006 load_maxp_, \
1007 load_os2_, \
1008 load_post_, \
1009 load_name_, \
1010 free_name_, \
1011 load_kern_, \
1012 load_gpos_, \
1013 load_gasp_, \
1014 load_pclt_, \
1015 load_bhed_, \
1016 load_sbit_image_, \
1017 get_psname_, \
1018 free_psnames_, \
1019 get_kerning_, \
1020 get_gpos_kerning_, \
1021 load_font_dir_, \
1022 load_hmtx_, \
1023 load_eblc_, \
1024 free_eblc_, \
1025 set_sbit_strike_, \
1026 load_strike_metrics_, \
1027 load_cpal_, \
1028 load_colr_, \
1029 free_cpal_, \
1030 free_colr_, \
1031 set_palette_, \
1032 get_colr_layer_, \
1033 get_colr_glyph_paint_, \
1034 get_color_glyph_clipbox, \
1035 get_paint_layers_, \
1036 get_colorline_stops_, \
1037 get_paint_, \
1038 colr_blend_, \
1039 get_metrics_, \
1040 get_name_, \
1041 get_name_id_, \
1042 load_svg_, \
1043 free_svg_, \
1044 load_svg_doc_ ) \
1045 static const SFNT_Interface class_ = \
1046 { \
1047 goto_table_, \
1048 init_face_, \
1049 load_face_, \
1050 done_face_, \
1051 get_interface_, \
1052 load_any_, \
1053 load_head_, \
1054 load_hhea_, \
1055 load_cmap_, \
1056 load_maxp_, \
1057 load_os2_, \
1058 load_post_, \
1059 load_name_, \
1060 free_name_, \
1061 load_kern_, \
1062 load_gpos_, \
1063 load_gasp_, \
1064 load_pclt_, \
1065 load_bhed_, \
1066 load_sbit_image_, \
1067 get_psname_, \
1068 free_psnames_, \
1069 get_kerning_, \
1070 get_gpos_kerning_, \
1071 load_font_dir_, \
1072 load_hmtx_, \
1073 load_eblc_, \
1074 free_eblc_, \
1075 set_sbit_strike_, \
1076 load_strike_metrics_, \
1077 load_cpal_, \
1078 load_colr_, \
1079 free_cpal_, \
1080 free_colr_, \
1081 set_palette_, \
1082 get_colr_layer_, \
1083 get_colr_glyph_paint_, \
1084 get_color_glyph_clipbox, \
1085 get_paint_layers_, \
1086 get_colorline_stops_, \
1087 get_paint_, \
1088 colr_blend_, \
1089 get_metrics_, \
1090 get_name_, \
1091 get_name_id_, \
1092 load_svg_, \
1093 free_svg_, \
1094 load_svg_doc_ \
1095 };
1096
1097
1098FT_END_HEADER
1099
1100#endif /* SFNT_H_ */
1101
1102
1103/* END */