1 /*******************************************************************
2  *
3  *  ftxpost.h
4  *
5  *    post table support API extension
6  *
7  *  Copyright 1996-1999 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  *  The post table is not completely loaded by the core engine.  This
18  *  file loads the missing PS glyph names and implements an API to
19  *  access them.
20  *
21  ******************************************************************/
22 
23 #ifndef FTXPOST_H
24 #define FTXPOST_H
25 
26 #include "freetype.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #define TT_Err_Invalid_Post_Table_Format  0x0B00
33 #define TT_Err_Invalid_Post_Table         0x0B01
34 
35   /* the 258 standard Mac glyph names, used for format 1.0 and 2.5 */
36 
37   extern TT_String*  TT_Post_Default_Names[];
38 
39 
40   /* format 2.0 table */
41 
42   struct TT_Post_20_
43   {
44     TT_UShort   numGlyphs;
45     TT_UShort*  glyphNameIndex;
46     TT_Char**   glyphNames;
47   };
48 
49   typedef struct TT_Post_20_  TT_Post_20;
50 
51   struct TT_Post_25_
52   {
53     TT_UShort  numGlyphs;
54     TT_Char*   offset;
55   };
56 
57   typedef struct TT_Post_25_  TT_Post_25;
58 
59 #if 0
60   /* format 4.0 table -- not implemented yet */
61 
62   struct TT_Post_40_
63   {
64   };
65 
66   typedef struct TT_Post_40_  TT_Post_40;
67 #endif
68 
69 
70   struct TT_Post_
71   {
72     TT_Long  offset;
73     TT_Long  length;
74     TT_Bool  loaded;
75 
76     union
77     {
78       TT_Post_20  post20;
79       TT_Post_25  post25;
80 #if 0
81       TT_Post_40  post40;
82 #endif
83     } p;
84   };
85 
86   typedef struct TT_Post_  TT_Post;
87 
88 
89   EXPORT_DEF
90   TT_Error TT_Init_Post_Extension( TT_Engine  engine );
91 
92   EXPORT_DEF
93   TT_Error TT_Load_PS_Names( TT_Face   face,
94                              TT_Post*  post );
95   EXPORT_DEF
96   TT_Error TT_Get_PS_Name( TT_Face      face,
97                            TT_UShort    index,
98                            TT_String**  PSname );
99 
100 #ifdef __cplusplus
101 }
102 #endif
103 
104 #endif /* FTXPOST_H */
105 
106 
107 /* END */
108