Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
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 1996-2006, 2009, 2012 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 
19 #ifndef __SFNT_H__
20 #define __SFNT_H__
21 
22 
23 #include <ft2build.h>
24 #include FT_INTERNAL_DRIVER_H
25 #include FT_INTERNAL_TRUETYPE_TYPES_H
26 
27 
29 
30 
31  /*************************************************************************/
32  /* */
33  /* <FuncType> */
34  /* TT_Init_Face_Func */
35  /* */
36  /* <Description> */
37  /* First part of the SFNT face object initialization. This finds */
38  /* the face in a SFNT file or collection, and load its format tag in */
39  /* face->format_tag. */
40  /* */
41  /* <Input> */
42  /* stream :: The input stream. */
43  /* */
44  /* face :: A handle to the target face object. */
45  /* */
46  /* face_index :: The index of the TrueType font, if we are opening a */
47  /* collection. */
48  /* */
49  /* num_params :: The number of additional parameters. */
50  /* */
51  /* params :: Optional additional parameters. */
52  /* */
53  /* <Return> */
54  /* FreeType error code. 0 means success. */
55  /* */
56  /* <Note> */
57  /* The stream cursor must be at the font file's origin. */
58  /* */
59  /* This function recognizes fonts embedded in a `TrueType */
60  /* collection'. */
61  /* */
62  /* Once the format tag has been validated by the font driver, it */
63  /* should then call the TT_Load_Face_Func() callback to read the rest */
64  /* of the SFNT tables in the object. */
65  /* */
66  typedef FT_Error
68  TT_Face face,
69  FT_Int face_index,
70  FT_Int num_params,
72 
73 
74  /*************************************************************************/
75  /* */
76  /* <FuncType> */
77  /* TT_Load_Face_Func */
78  /* */
79  /* <Description> */
80  /* Second part of the SFNT face object initialization. This loads */
81  /* the common SFNT tables (head, OS/2, maxp, metrics, etc.) in the */
82  /* face object. */
83  /* */
84  /* <Input> */
85  /* stream :: The input stream. */
86  /* */
87  /* face :: A handle to the target face object. */
88  /* */
89  /* face_index :: The index of the TrueType font, if we are opening a */
90  /* collection. */
91  /* */
92  /* num_params :: The number of additional parameters. */
93  /* */
94  /* params :: Optional additional parameters. */
95  /* */
96  /* <Return> */
97  /* FreeType error code. 0 means success. */
98  /* */
99  /* <Note> */
100  /* This function must be called after TT_Init_Face_Func(). */
101  /* */
102  typedef FT_Error
104  TT_Face face,
105  FT_Int face_index,
106  FT_Int num_params,
107  FT_Parameter* params );
108 
109 
110  /*************************************************************************/
111  /* */
112  /* <FuncType> */
113  /* TT_Done_Face_Func */
114  /* */
115  /* <Description> */
116  /* A callback used to delete the common SFNT data from a face. */
117  /* */
118  /* <Input> */
119  /* face :: A handle to the target face object. */
120  /* */
121  /* <Note> */
122  /* This function does NOT destroy the face object. */
123  /* */
124  typedef void
126 
127 
128 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
129 
130  /*************************************************************************/
131  /* */
132  /* <FuncType> */
133  /* TT_Load_SFNT_HeaderRec_Func */
134  /* */
135  /* <Description> */
136  /* Loads the header of a SFNT font file. Supports collections. */
137  /* */
138  /* <Input> */
139  /* face :: A handle to the target face object. */
140  /* */
141  /* stream :: The input stream. */
142  /* */
143  /* face_index :: The index of the TrueType font, if we are opening a */
144  /* collection. */
145  /* */
146  /* <Output> */
147  /* sfnt :: The SFNT header. */
148  /* */
149  /* <Return> */
150  /* FreeType error code. 0 means success. */
151  /* */
152  /* <Note> */
153  /* The stream cursor must be at the font file's origin. */
154  /* */
155  /* This function recognizes fonts embedded in a `TrueType */
156  /* collection'. */
157  /* */
158  /* This function checks that the header is valid by looking at the */
159  /* values of `search_range', `entry_selector', and `range_shift'. */
160  /* */
161  typedef FT_Error
162  (*TT_Load_SFNT_HeaderRec_Func)( TT_Face face,
164  FT_Long face_index,
165  SFNT_Header sfnt );
166 
167 
168  /*************************************************************************/
169  /* */
170  /* <FuncType> */
171  /* TT_Load_Directory_Func */
172  /* */
173  /* <Description> */
174  /* Loads the table directory into a face object. */
175  /* */
176  /* <Input> */
177  /* face :: A handle to the target face object. */
178  /* */
179  /* stream :: The input stream. */
180  /* */
181  /* sfnt :: The SFNT header. */
182  /* */
183  /* <Return> */
184  /* FreeType error code. 0 means success. */
185  /* */
186  /* <Note> */
187  /* The stream cursor must be on the first byte after the 4-byte font */
188  /* format tag. This is the case just after a call to */
189  /* TT_Load_Format_Tag(). */
190  /* */
191  typedef FT_Error
192  (*TT_Load_Directory_Func)( TT_Face face,
194  SFNT_Header sfnt );
195 
196 #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
197 
198 
199  /*************************************************************************/
200  /* */
201  /* <FuncType> */
202  /* TT_Load_Any_Func */
203  /* */
204  /* <Description> */
205  /* Load any font table into client memory. */
206  /* */
207  /* <Input> */
208  /* face :: The face object to look for. */
209  /* */
210  /* tag :: The tag of table to load. Use the value 0 if you want */
211  /* to access the whole font file, else set this parameter */
212  /* to a valid TrueType table tag that you can forge with */
213  /* the MAKE_TT_TAG macro. */
214  /* */
215  /* offset :: The starting offset in the table (or the file if */
216  /* tag == 0). */
217  /* */
218  /* length :: The address of the decision variable: */
219  /* */
220  /* If length == NULL: */
221  /* Loads the whole table. Returns an error if */
222  /* `offset' == 0! */
223  /* */
224  /* If *length == 0: */
225  /* Exits immediately; returning the length of the given */
226  /* table or of the font file, depending on the value of */
227  /* `tag'. */
228  /* */
229  /* If *length != 0: */
230  /* Loads the next `length' bytes of table or font, */
231  /* starting at offset `offset' (in table or font too). */
232  /* */
233  /* <Output> */
234  /* buffer :: The address of target buffer. */
235  /* */
236  /* <Return> */
237  /* TrueType error code. 0 means success. */
238  /* */
239  typedef FT_Error
241  FT_ULong tag,
242  FT_Long offset,
243  FT_Byte *buffer,
244  FT_ULong* length );
245 
246 
247  /*************************************************************************/
248  /* */
249  /* <FuncType> */
250  /* TT_Find_SBit_Image_Func */
251  /* */
252  /* <Description> */
253  /* Check whether an embedded bitmap (an `sbit') exists for a given */
254  /* glyph, at a given strike. */
255  /* */
256  /* <Input> */
257  /* face :: The target face object. */
258  /* */
259  /* glyph_index :: The glyph index. */
260  /* */
261  /* strike_index :: The current strike index. */
262  /* */
263  /* <Output> */
264  /* arange :: The SBit range containing the glyph index. */
265  /* */
266  /* astrike :: The SBit strike containing the glyph index. */
267  /* */
268  /* aglyph_offset :: The offset of the glyph data in `EBDT' table. */
269  /* */
270  /* <Return> */
271  /* FreeType error code. 0 means success. Returns */
272  /* SFNT_Err_Invalid_Argument if no sbit exists for the requested */
273  /* glyph. */
274  /* */
275  typedef FT_Error
277  FT_UInt glyph_index,
278  FT_ULong strike_index,
279  TT_SBit_Range *arange,
280  TT_SBit_Strike *astrike,
281  FT_ULong *aglyph_offset );
282 
283 
284  /*************************************************************************/
285  /* */
286  /* <FuncType> */
287  /* TT_Load_SBit_Metrics_Func */
288  /* */
289  /* <Description> */
290  /* Get the big metrics for a given embedded bitmap. */
291  /* */
292  /* <Input> */
293  /* stream :: The input stream. */
294  /* */
295  /* range :: The SBit range containing the glyph. */
296  /* */
297  /* <Output> */
298  /* big_metrics :: A big SBit metrics structure for the glyph. */
299  /* */
300  /* <Return> */
301  /* FreeType error code. 0 means success. */
302  /* */
303  /* <Note> */
304  /* The stream cursor must be positioned at the glyph's offset within */
305  /* the `EBDT' table before the call. */
306  /* */
307  /* If the image format uses variable metrics, the stream cursor is */
308  /* positioned just after the metrics header in the `EBDT' table on */
309  /* function exit. */
310  /* */
311  typedef FT_Error
315 
316 
317  /*************************************************************************/
318  /* */
319  /* <FuncType> */
320  /* TT_Load_SBit_Image_Func */
321  /* */
322  /* <Description> */
323  /* Load a given glyph sbit image from the font resource. This also */
324  /* returns its metrics. */
325  /* */
326  /* <Input> */
327  /* face :: */
328  /* The target face object. */
329  /* */
330  /* strike_index :: */
331  /* The strike index. */
332  /* */
333  /* glyph_index :: */
334  /* The current glyph index. */
335  /* */
336  /* load_flags :: */
337  /* The current load flags. */
338  /* */
339  /* stream :: */
340  /* The input stream. */
341  /* */
342  /* <Output> */
343  /* amap :: */
344  /* The target pixmap. */
345  /* */
346  /* ametrics :: */
347  /* A big sbit metrics structure for the glyph image. */
348  /* */
349  /* <Return> */
350  /* FreeType error code. 0 means success. Returns an error if no */
351  /* glyph sbit exists for the index. */
352  /* */
353  /* <Note> */
354  /* The `map.buffer' field is always freed before the glyph is loaded. */
355  /* */
356  typedef FT_Error
358  FT_ULong strike_index,
359  FT_UInt glyph_index,
360  FT_UInt load_flags,
362  FT_Bitmap *amap,
363  TT_SBit_MetricsRec *ametrics );
364 
365 
366 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
367 
368  /*************************************************************************/
369  /* */
370  /* <FuncType> */
371  /* TT_Set_SBit_Strike_OldFunc */
372  /* */
373  /* <Description> */
374  /* Select an sbit strike for a given size request. */
375  /* */
376  /* <Input> */
377  /* face :: The target face object. */
378  /* */
379  /* req :: The size request. */
380  /* */
381  /* <Output> */
382  /* astrike_index :: The index of the sbit strike. */
383  /* */
384  /* <Return> */
385  /* FreeType error code. 0 means success. Returns an error if no */
386  /* sbit strike exists for the selected ppem values. */
387  /* */
388  typedef FT_Error
389  (*TT_Set_SBit_Strike_OldFunc)( TT_Face face,
390  FT_UInt x_ppem,
391  FT_UInt y_ppem,
392  FT_ULong* astrike_index );
393 
394 
395  /*************************************************************************/
396  /* */
397  /* <FuncType> */
398  /* TT_CharMap_Load_Func */
399  /* */
400  /* <Description> */
401  /* Loads a given TrueType character map into memory. */
402  /* */
403  /* <Input> */
404  /* face :: A handle to the parent face object. */
405  /* */
406  /* stream :: A handle to the current stream object. */
407  /* */
408  /* <InOut> */
409  /* cmap :: A pointer to a cmap object. */
410  /* */
411  /* <Return> */
412  /* FreeType error code. 0 means success. */
413  /* */
414  /* <Note> */
415  /* The function assumes that the stream is already in use (i.e., */
416  /* opened). In case of error, all partially allocated tables are */
417  /* released. */
418  /* */
419  typedef FT_Error
420  (*TT_CharMap_Load_Func)( TT_Face face,
421  void* cmap,
422  FT_Stream input );
423 
424 
425  /*************************************************************************/
426  /* */
427  /* <FuncType> */
428  /* TT_CharMap_Free_Func */
429  /* */
430  /* <Description> */
431  /* Destroys a character mapping table. */
432  /* */
433  /* <Input> */
434  /* face :: A handle to the parent face object. */
435  /* */
436  /* cmap :: A handle to a cmap object. */
437  /* */
438  /* <Return> */
439  /* FreeType error code. 0 means success. */
440  /* */
441  typedef FT_Error
442  (*TT_CharMap_Free_Func)( TT_Face face,
443  void* cmap );
444 
445 #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
446 
447 
448  /*************************************************************************/
449  /* */
450  /* <FuncType> */
451  /* TT_Set_SBit_Strike_Func */
452  /* */
453  /* <Description> */
454  /* Select an sbit strike for a given size request. */
455  /* */
456  /* <Input> */
457  /* face :: The target face object. */
458  /* */
459  /* req :: The size request. */
460  /* */
461  /* <Output> */
462  /* astrike_index :: The index of the sbit strike. */
463  /* */
464  /* <Return> */
465  /* FreeType error code. 0 means success. Returns an error if no */
466  /* sbit strike exists for the selected ppem values. */
467  /* */
468  typedef FT_Error
470  FT_Size_Request req,
471  FT_ULong* astrike_index );
472 
473 
474  /*************************************************************************/
475  /* */
476  /* <FuncType> */
477  /* TT_Load_Strike_Metrics_Func */
478  /* */
479  /* <Description> */
480  /* Load the metrics of a given strike. */
481  /* */
482  /* <Input> */
483  /* face :: The target face object. */
484  /* */
485  /* strike_index :: The strike index. */
486  /* */
487  /* <Output> */
488  /* metrics :: the metrics of the strike. */
489  /* */
490  /* <Return> */
491  /* FreeType error code. 0 means success. Returns an error if no */
492  /* such sbit strike exists. */
493  /* */
494  typedef FT_Error
496  FT_ULong strike_index,
498 
499 
500  /*************************************************************************/
501  /* */
502  /* <FuncType> */
503  /* TT_Get_PS_Name_Func */
504  /* */
505  /* <Description> */
506  /* Get the PostScript glyph name of a glyph. */
507  /* */
508  /* <Input> */
509  /* idx :: The glyph index. */
510  /* */
511  /* PSname :: The address of a string pointer. Will be NULL in case */
512  /* of error, otherwise it is a pointer to the glyph name. */
513  /* */
514  /* You must not modify the returned string! */
515  /* */
516  /* <Output> */
517  /* FreeType error code. 0 means success. */
518  /* */
519  typedef FT_Error
521  FT_UInt idx,
522  FT_String** PSname );
523 
524 
525  /*************************************************************************/
526  /* */
527  /* <FuncType> */
528  /* TT_Load_Metrics_Func */
529  /* */
530  /* <Description> */
531  /* Load a metrics table, which is a table with a horizontal and a */
532  /* vertical version. */
533  /* */
534  /* <Input> */
535  /* face :: A handle to the target face object. */
536  /* */
537  /* stream :: The input stream. */
538  /* */
539  /* vertical :: A boolean flag. If set, load the vertical one. */
540  /* */
541  /* <Return> */
542  /* FreeType error code. 0 means success. */
543  /* */
544  typedef FT_Error
547  FT_Bool vertical );
548 
549 
550  /*************************************************************************/
551  /* */
552  /* <FuncType> */
553  /* TT_Get_Metrics_Func */
554  /* */
555  /* <Description> */
556  /* Load the horizontal or vertical header in a face object. */
557  /* */
558  /* <Input> */
559  /* face :: A handle to the target face object. */
560  /* */
561  /* stream :: The input stream. */
562  /* */
563  /* vertical :: A boolean flag. If set, load vertical metrics. */
564  /* */
565  /* <Return> */
566  /* FreeType error code. 0 means success. */
567  /* */
568  typedef FT_Error
570  FT_Bool vertical,
571  FT_UInt gindex,
572  FT_Short* abearing,
573  FT_UShort* aadvance );
574 
575 
576  /*************************************************************************/
577  /* */
578  /* <FuncType> */
579  /* TT_Load_Table_Func */
580  /* */
581  /* <Description> */
582  /* Load a given TrueType table. */
583  /* */
584  /* <Input> */
585  /* face :: A handle to the target face object. */
586  /* */
587  /* stream :: The input stream. */
588  /* */
589  /* <Return> */
590  /* FreeType error code. 0 means success. */
591  /* */
592  /* <Note> */
593  /* The function uses `face->goto_table' to seek the stream to the */
594  /* start of the table, except while loading the font directory. */
595  /* */
596  typedef FT_Error
598  FT_Stream stream );
599 
600 
601  /*************************************************************************/
602  /* */
603  /* <FuncType> */
604  /* TT_Free_Table_Func */
605  /* */
606  /* <Description> */
607  /* Free a given TrueType table. */
608  /* */
609  /* <Input> */
610  /* face :: A handle to the target face object. */
611  /* */
612  typedef void
614 
615 
616  /*
617  * @functype:
618  * TT_Face_GetKerningFunc
619  *
620  * @description:
621  * Return the horizontal kerning value between two glyphs.
622  *
623  * @input:
624  * face :: A handle to the source face object.
625  * left_glyph :: The left glyph index.
626  * right_glyph :: The right glyph index.
627  *
628  * @return:
629  * The kerning value in font units.
630  */
631  typedef FT_Int
633  FT_UInt left_glyph,
634  FT_UInt right_glyph );
635 
636 
637  /*************************************************************************/
638  /* */
639  /* <Struct> */
640  /* SFNT_Interface */
641  /* */
642  /* <Description> */
643  /* This structure holds pointers to the functions used to load and */
644  /* free the basic tables that are required in a `sfnt' font file. */
645  /* */
646  /* <Fields> */
647  /* Check the various xxx_Func() descriptions for details. */
648  /* */
649  typedef struct SFNT_Interface_
650  {
652 
657 
659 
660 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
661  TT_Load_SFNT_HeaderRec_Func load_sfnt_header;
662  TT_Load_Directory_Func load_directory;
663 #endif
664 
665  /* these functions are called by `load_face' but they can also */
666  /* be called from external modules, if there is a need to do so */
673 
676 
677  /* optional tables */
678 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
679  TT_Load_Table_Func load_hdmx_stub;
680  TT_Free_Table_Func free_hdmx_stub;
681 #endif
682 
683  /* this field was called `load_kerning' up to version 2.1.10 */
685 
688 
689  /* see `ttload.h'; this field was called `load_bitmap_header' up to */
690  /* version 2.1.10 */
692 
693 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
694 
695  /* see `ttsbit.h' */
696  TT_Set_SBit_Strike_OldFunc set_sbit_strike_stub;
697  TT_Load_Table_Func load_sbits_stub;
698 
699  /*
700  * The following two fields appeared in version 2.1.8, and were placed
701  * between `load_sbits' and `load_sbit_image'. We support them as a
702  * special exception since they are used by Xfont library within the
703  * X.Org xserver, and because the probability that other rogue clients
704  * use the other version 2.1.7 fields below is _extremely_ low.
705  *
706  * Note that this forces us to disable an interesting memory-saving
707  * optimization though...
708  */
709 
710  TT_Find_SBit_Image_Func find_sbit_image;
711  TT_Load_SBit_Metrics_Func load_sbit_metrics;
712 
713 #endif
714 
716 
717 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
718  TT_Free_Table_Func free_sbits_stub;
719 #endif
720 
721  /* see `ttpost.h' */
724 
725 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
726  TT_CharMap_Load_Func load_charmap_stub;
727  TT_CharMap_Free_Func free_charmap_stub;
728 #endif
729 
730  /* starting here, the structure differs from version 2.1.7 */
731 
732  /* this field was introduced in version 2.1.8, named `get_psname' */
734 
735  /* new elements introduced after version 2.1.10 */
736 
737  /* load the font directory, i.e., the offset table and */
738  /* the table directory */
741 
744 
747 
749 
750  } SFNT_Interface;
751 
752 
753  /* transitional */
755 
756 #ifndef FT_CONFIG_OPTION_PIC
757 
758 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
759 #define FT_DEFINE_DRIVERS_OLD_INTERNAL( a ) \
760  a,
761 #else
762 #define FT_DEFINE_DRIVERS_OLD_INTERNAL( a ) /* empty */
763 #endif
764 
765 #define FT_INTERNAL( a ) \
766  a,
767 
768 #define FT_DEFINE_SFNT_INTERFACE( \
769  class_, \
770  goto_table_, \
771  init_face_, \
772  load_face_, \
773  done_face_, \
774  get_interface_, \
775  load_any_, \
776  load_sfnt_header_, \
777  load_directory_, \
778  load_head_, \
779  load_hhea_, \
780  load_cmap_, \
781  load_maxp_, \
782  load_os2_, \
783  load_post_, \
784  load_name_, \
785  free_name_, \
786  load_hdmx_stub_, \
787  free_hdmx_stub_, \
788  load_kern_, \
789  load_gasp_, \
790  load_pclt_, \
791  load_bhed_, \
792  set_sbit_strike_stub_, \
793  load_sbits_stub_, \
794  find_sbit_image_, \
795  load_sbit_metrics_, \
796  load_sbit_image_, \
797  free_sbits_stub_, \
798  get_psname_, \
799  free_psnames_, \
800  load_charmap_stub_, \
801  free_charmap_stub_, \
802  get_kerning_, \
803  load_font_dir_, \
804  load_hmtx_, \
805  load_eblc_, \
806  free_eblc_, \
807  set_sbit_strike_, \
808  load_strike_metrics_, \
809  get_metrics_ ) \
810  static const SFNT_Interface class_ = \
811  { \
812  FT_INTERNAL( goto_table_ ) \
813  FT_INTERNAL( init_face_ ) \
814  FT_INTERNAL( load_face_ ) \
815  FT_INTERNAL( done_face_ ) \
816  FT_INTERNAL( get_interface_ ) \
817  FT_INTERNAL( load_any_ ) \
818  FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sfnt_header_ ) \
819  FT_DEFINE_DRIVERS_OLD_INTERNAL( load_directory_ ) \
820  FT_INTERNAL( load_head_ ) \
821  FT_INTERNAL( load_hhea_ ) \
822  FT_INTERNAL( load_cmap_ ) \
823  FT_INTERNAL( load_maxp_ ) \
824  FT_INTERNAL( load_os2_ ) \
825  FT_INTERNAL( load_post_ ) \
826  FT_INTERNAL( load_name_ ) \
827  FT_INTERNAL( free_name_ ) \
828  FT_DEFINE_DRIVERS_OLD_INTERNAL( load_hdmx_stub_ ) \
829  FT_DEFINE_DRIVERS_OLD_INTERNAL( free_hdmx_stub_ ) \
830  FT_INTERNAL( load_kern_ ) \
831  FT_INTERNAL( load_gasp_ ) \
832  FT_INTERNAL( load_pclt_ ) \
833  FT_INTERNAL( load_bhed_ ) \
834  FT_DEFINE_DRIVERS_OLD_INTERNAL( set_sbit_strike_stub_ ) \
835  FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sbits_stub_ ) \
836  FT_DEFINE_DRIVERS_OLD_INTERNAL( find_sbit_image_ ) \
837  FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sbit_metrics_ ) \
838  FT_INTERNAL( load_sbit_image_ ) \
839  FT_DEFINE_DRIVERS_OLD_INTERNAL( free_sbits_stub_ ) \
840  FT_INTERNAL( get_psname_ ) \
841  FT_INTERNAL( free_psnames_ ) \
842  FT_DEFINE_DRIVERS_OLD_INTERNAL( load_charmap_stub_ ) \
843  FT_DEFINE_DRIVERS_OLD_INTERNAL( free_charmap_stub_ ) \
844  FT_INTERNAL( get_kerning_ ) \
845  FT_INTERNAL( load_font_dir_ ) \
846  FT_INTERNAL( load_hmtx_ ) \
847  FT_INTERNAL( load_eblc_ ) \
848  FT_INTERNAL( free_eblc_ ) \
849  FT_INTERNAL( set_sbit_strike_ ) \
850  FT_INTERNAL( load_strike_metrics_ ) \
851  FT_INTERNAL( get_metrics_ ) \
852  };
853 
854 #else /* FT_CONFIG_OPTION_PIC */
855 
856 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
857 #define FT_DEFINE_DRIVERS_OLD_INTERNAL( a, a_ ) \
858  clazz->a = a_;
859 #else
860 #define FT_DEFINE_DRIVERS_OLD_INTERNAL( a, a_ ) /* empty */
861 #endif
862 
863 #define FT_INTERNAL( a, a_ ) \
864  clazz->a = a_;
865 
866 #define FT_DEFINE_SFNT_INTERFACE( \
867  class_, \
868  goto_table_, \
869  init_face_, \
870  load_face_, \
871  done_face_, \
872  get_interface_, \
873  load_any_, \
874  load_sfnt_header_, \
875  load_directory_, \
876  load_head_, \
877  load_hhea_, \
878  load_cmap_, \
879  load_maxp_, \
880  load_os2_, \
881  load_post_, \
882  load_name_, \
883  free_name_, \
884  load_hdmx_stub_, \
885  free_hdmx_stub_, \
886  load_kern_, \
887  load_gasp_, \
888  load_pclt_, \
889  load_bhed_, \
890  set_sbit_strike_stub_, \
891  load_sbits_stub_, \
892  find_sbit_image_, \
893  load_sbit_metrics_, \
894  load_sbit_image_, \
895  free_sbits_stub_, \
896  get_psname_, \
897  free_psnames_, \
898  load_charmap_stub_, \
899  free_charmap_stub_, \
900  get_kerning_, \
901  load_font_dir_, \
902  load_hmtx_, \
903  load_eblc_, \
904  free_eblc_, \
905  set_sbit_strike_, \
906  load_strike_metrics_, \
907  get_metrics_ ) \
908  void \
909  FT_Init_Class_ ## class_( FT_Library library, \
910  SFNT_Interface* clazz ) \
911  { \
912  FT_UNUSED( library ); \
913  \
914  FT_INTERNAL( goto_table, goto_table_ ) \
915  FT_INTERNAL( init_face, init_face_ ) \
916  FT_INTERNAL( load_face, load_face_ ) \
917  FT_INTERNAL( done_face, done_face_ ) \
918  FT_INTERNAL( get_interface, get_interface_ ) \
919  FT_INTERNAL( load_any, load_any_ ) \
920  FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sfnt_header, \
921  load_sfnt_header_ ) \
922  FT_DEFINE_DRIVERS_OLD_INTERNAL( load_directory, \
923  load_directory_ ) \
924  FT_INTERNAL( load_head, load_head_ ) \
925  FT_INTERNAL( load_hhea, load_hhea_ ) \
926  FT_INTERNAL( load_cmap, load_cmap_ ) \
927  FT_INTERNAL( load_maxp, load_maxp_ ) \
928  FT_INTERNAL( load_os2, load_os2_ ) \
929  FT_INTERNAL( load_post, load_post_ ) \
930  FT_INTERNAL( load_name, load_name_ ) \
931  FT_INTERNAL( free_name, free_name_ ) \
932  FT_DEFINE_DRIVERS_OLD_INTERNAL( load_hdmx_stub, \
933  load_hdmx_stub_ ) \
934  FT_DEFINE_DRIVERS_OLD_INTERNAL( free_hdmx_stub, \
935  free_hdmx_stub_ ) \
936  FT_INTERNAL( load_kern, load_kern_ ) \
937  FT_INTERNAL( load_gasp, load_gasp_ ) \
938  FT_INTERNAL( load_pclt, load_pclt_ ) \
939  FT_INTERNAL( load_bhed, load_bhed_ ) \
940  FT_DEFINE_DRIVERS_OLD_INTERNAL( set_sbit_strike_stub, \
941  set_sbit_strike_stub_ ) \
942  FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sbits_stub, \
943  load_sbits_stub_ ) \
944  FT_DEFINE_DRIVERS_OLD_INTERNAL( find_sbit_image, \
945  find_sbit_image_ ) \
946  FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sbit_metrics, \
947  load_sbit_metrics_ ) \
948  FT_INTERNAL( load_sbit_image, load_sbit_image_ ) \
949  FT_DEFINE_DRIVERS_OLD_INTERNAL( free_sbits_stub, \
950  free_sbits_stub_ ) \
951  FT_INTERNAL( get_psname, get_psname_ ) \
952  FT_INTERNAL( free_psnames, free_psnames_ ) \
953  FT_DEFINE_DRIVERS_OLD_INTERNAL( load_charmap_stub, \
954  load_charmap_stub_ ) \
955  FT_DEFINE_DRIVERS_OLD_INTERNAL( free_charmap_stub, \
956  free_charmap_stub_ ) \
957  FT_INTERNAL( get_kerning, get_kerning_ ) \
958  FT_INTERNAL( load_font_dir, load_font_dir_ ) \
959  FT_INTERNAL( load_hmtx, load_hmtx_ ) \
960  FT_INTERNAL( load_eblc, load_eblc_ ) \
961  FT_INTERNAL( free_eblc, free_eblc_ ) \
962  FT_INTERNAL( set_sbit_strike, set_sbit_strike_ ) \
963  FT_INTERNAL( load_strike_metrics, load_strike_metrics_ ) \
964  FT_INTERNAL( get_metrics, get_metrics_ ) \
965  }
966 
967 #endif /* FT_CONFIG_OPTION_PIC */
968 
970 
971 #endif /* __SFNT_H__ */
972 
973 
974 /* END */
GLenum GLuint GLenum GLsizei length
TT_Init_Face_Func init_face
Definition: sfnt.h:653
int FT_Error
Definition: fttypes.h:296
GLuint GLuint stream
TT_Load_Strike_Metrics_Func load_strike_metrics
Definition: sfnt.h:746
signed long FT_Long
Definition: fttypes.h:238
SFNT_Interface * SFNT_Service
Definition: sfnt.h:754
unsigned long FT_ULong
Definition: fttypes.h:249
FT_Error(* TT_Load_SBit_Image_Func)(TT_Face face, FT_ULong strike_index, FT_UInt glyph_index, FT_UInt load_flags, FT_Stream stream, FT_Bitmap *amap, TT_SBit_MetricsRec *ametrics)
Definition: sfnt.h:357
TT_Load_Table_Func load_maxp
Definition: sfnt.h:670
#define FT_END_HEADER
Definition: ftheader.h:54
TT_Free_Table_Func free_psnames
Definition: sfnt.h:723
signed int FT_Int
Definition: fttypes.h:216
FT_Error(* TT_Loader_GotoTableFunc)(TT_Face face, FT_ULong tag, FT_Stream stream, FT_ULong *length)
Definition: tttypes.h:988
TT_Get_Metrics_Func get_metrics
Definition: sfnt.h:748
FT_Error(* TT_Get_Metrics_Func)(TT_Face face, FT_Bool vertical, FT_UInt gindex, FT_Short *abearing, FT_UShort *aadvance)
Definition: sfnt.h:569
void(* TT_Free_Table_Func)(TT_Face face)
Definition: sfnt.h:613
TT_Load_Table_Func load_os2
Definition: sfnt.h:671
TT_Load_Table_Func load_head
Definition: sfnt.h:667
FT_Int(* TT_Face_GetKerningFunc)(TT_Face face, FT_UInt left_glyph, FT_UInt right_glyph)
Definition: sfnt.h:632
FT_Error(* TT_Get_PS_Name_Func)(TT_Face face, FT_UInt idx, FT_String **PSname)
Definition: sfnt.h:520
TT_Load_Table_Func load_pclt
Definition: sfnt.h:687
TT_Loader_GotoTableFunc goto_table
Definition: sfnt.h:651
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
GLenum GLint * range
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:104
GLenum GLuint GLint GLenum face
TT_Done_Face_Func done_face
Definition: sfnt.h:655
unsigned char FT_Byte
Definition: fttypes.h:150
FT_BEGIN_HEADER typedef FT_Error(* TT_Init_Face_Func)(FT_Stream stream, TT_Face face, FT_Int face_index, FT_Int num_params, FT_Parameter *params)
Definition: sfnt.h:67
#define FT_BEGIN_HEADER
Definition: ftheader.h:36
FT_Module_Interface(* FT_Module_Requester)(FT_Module module, const char *name)
Definition: ftmodapi.h:153
TT_Load_SBit_Image_Func load_sbit_image
Definition: sfnt.h:715
FT_Error(* TT_Load_SBit_Metrics_Func)(FT_Stream stream, TT_SBit_Range range, TT_SBit_Metrics metrics)
Definition: sfnt.h:312
FT_Error(* TT_Load_Metrics_Func)(TT_Face face, FT_Stream stream, FT_Bool vertical)
Definition: sfnt.h:545
FT_Error(* TT_Find_SBit_Image_Func)(TT_Face face, FT_UInt glyph_index, FT_ULong strike_index, TT_SBit_Range *arange, TT_SBit_Strike *astrike, FT_ULong *aglyph_offset)
Definition: sfnt.h:276
TT_Load_Table_Func load_gasp
Definition: sfnt.h:686
GLenum GLenum GLenum input
TT_Load_Metrics_Func load_hhea
Definition: sfnt.h:668
TT_Set_SBit_Strike_Func set_sbit_strike
Definition: sfnt.h:745
FT_Error(* TT_Set_SBit_Strike_Func)(TT_Face face, FT_Size_Request req, FT_ULong *astrike_index)
Definition: sfnt.h:469
FT_UInt idx
Definition: cffcmap.c:127
TT_Face_GetKerningFunc get_kerning
Definition: sfnt.h:733
char FT_String
Definition: fttypes.h:183
GLuint buffer
TT_Load_Table_Func load_post
Definition: sfnt.h:672
TT_Load_Table_Func load_font_dir
Definition: sfnt.h:739
GLintptr offset
TT_Load_Table_Func load_name
Definition: sfnt.h:674
TT_Load_Face_Func load_face
Definition: sfnt.h:654
signed short FT_Short
Definition: fttypes.h:194
TT_Load_Table_Func load_cmap
Definition: sfnt.h:669
TT_Get_PS_Name_Func get_psname
Definition: sfnt.h:722
TT_Load_Metrics_Func load_hmtx
Definition: sfnt.h:740
TT_Free_Table_Func free_eblc
Definition: sfnt.h:743
GLenum const GLfloat * params
TT_Load_Table_Func load_bhed
Definition: sfnt.h:691
FT_Module_Requester get_interface
Definition: sfnt.h:656
unsigned int FT_UInt
Definition: fttypes.h:227
TT_Load_Any_Func load_any
Definition: sfnt.h:658
FT_Error(* TT_Load_Strike_Metrics_Func)(TT_Face face, FT_ULong strike_index, FT_Size_Metrics *metrics)
Definition: sfnt.h:495
struct SFNT_Interface_ SFNT_Interface
TT_Load_Table_Func load_eblc
Definition: sfnt.h:742
FT_Error(* TT_Load_Face_Func)(FT_Stream stream, TT_Face face, FT_Int face_index, FT_Int num_params, FT_Parameter *params)
Definition: sfnt.h:103
FT_Error(* TT_Load_Any_Func)(TT_Face face, FT_ULong tag, FT_Long offset, FT_Byte *buffer, FT_ULong *length)
Definition: sfnt.h:240
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
unsigned short FT_UShort
Definition: fttypes.h:205
TT_Free_Table_Func free_name
Definition: sfnt.h:675
void(* TT_Done_Face_Func)(TT_Face face)
Definition: sfnt.h:125
TT_Load_Table_Func load_kern
Definition: sfnt.h:684
FT_Error(* TT_Load_Table_Func)(TT_Face face, FT_Stream stream)
Definition: sfnt.h:597