xref: /inferno-os/include/freetype/internal/t1types.h (revision 37da2899f40661e3e9631e497da8dc59b971cbd0)
1 /***************************************************************************/
2 /*                                                                         */
3 /*  t1types.h                                                              */
4 /*                                                                         */
5 /*    Basic Type1/Type2 type definitions and interface (specification      */
6 /*    only).                                                               */
7 /*                                                                         */
8 /*  Copyright 1996-2001, 2002 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 
20 #ifndef __T1TYPES_H__
21 #define __T1TYPES_H__
22 
23 
24 #include <ft2build.h>
25 #include FT_TYPE1_TABLES_H
26 #include FT_INTERNAL_POSTSCRIPT_NAMES_H
27 #include FT_INTERNAL_POSTSCRIPT_HINTS_H
28 
29 
30 FT_BEGIN_HEADER
31 
32 
33   /*************************************************************************/
34   /*************************************************************************/
35   /*************************************************************************/
36   /***                                                                   ***/
37   /***                                                                   ***/
38   /***              REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS              ***/
39   /***                                                                   ***/
40   /***                                                                   ***/
41   /*************************************************************************/
42   /*************************************************************************/
43   /*************************************************************************/
44 
45 
46   /*************************************************************************/
47   /*                                                                       */
48   /* <Struct>                                                              */
49   /*    T1_EncodingRec                                                     */
50   /*                                                                       */
51   /* <Description>                                                         */
52   /*    A structure modeling a custom encoding.                            */
53   /*                                                                       */
54   /* <Fields>                                                              */
55   /*    num_chars  :: The number of character codes in the encoding.       */
56   /*                  Usually 256.                                         */
57   /*                                                                       */
58   /*    code_first :: The lowest valid character code in the encoding.     */
59   /*                                                                       */
60   /*    code_last  :: The highest valid character code in the encoding.    */
61   /*                                                                       */
62   /*    char_index :: An array of corresponding glyph indices.             */
63   /*                                                                       */
64   /*    char_name  :: An array of corresponding glyph names.               */
65   /*                                                                       */
66   typedef struct  T1_EncodingRecRec_
67   {
68     FT_Int       num_chars;
69     FT_Int       code_first;
70     FT_Int       code_last;
71 
72     FT_UShort*   char_index;
73     FT_String**  char_name;
74 
75   } T1_EncodingRec, *T1_Encoding;
76 
77 
78   typedef enum  T1_EncodingType_
79   {
80     T1_ENCODING_TYPE_NONE = 0,
81     T1_ENCODING_TYPE_ARRAY,
82     T1_ENCODING_TYPE_STANDARD,
83     T1_ENCODING_TYPE_ISOLATIN1,
84     T1_ENCODING_TYPE_EXPERT
85 
86   } T1_EncodingType;
87 
88 
89   typedef struct  T1_FontRec_
90   {
91     PS_FontInfoRec   font_info;         /* font info dictionary */
92     PS_PrivateRec    private_dict;      /* private dictionary   */
93     FT_String*       font_name;         /* top-level dictionary */
94 
95     T1_EncodingType  encoding_type;
96     T1_EncodingRec   encoding;
97 
98     FT_Byte*         subrs_block;
99     FT_Byte*         charstrings_block;
100     FT_Byte*         glyph_names_block;
101 
102     FT_Int           num_subrs;
103     FT_Byte**        subrs;
104     FT_Int*          subrs_len;
105 
106     FT_Int           num_glyphs;
107     FT_String**      glyph_names;       /* array of glyph names       */
108     FT_Byte**        charstrings;       /* array of glyph charstrings */
109     FT_Int*          charstrings_len;
110 
111     FT_Byte          paint_type;
112     FT_Byte          font_type;
113     FT_Matrix        font_matrix;
114     FT_Vector        font_offset;
115     FT_BBox          font_bbox;
116     FT_Long          font_id;
117 
118     FT_Int           stroke_width;
119 
120   } T1_FontRec, *T1_Font;
121 
122 
123   typedef struct  CID_SubrsRec_
124   {
125     FT_UInt    num_subrs;
126     FT_Byte**  code;
127 
128   } CID_SubrsRec, *CID_Subrs;
129 
130 
131   /*************************************************************************/
132   /*************************************************************************/
133   /*************************************************************************/
134   /***                                                                   ***/
135   /***                                                                   ***/
136   /***                ORIGINAL T1_FACE CLASS DEFINITION                  ***/
137   /***                                                                   ***/
138   /***                                                                   ***/
139   /*************************************************************************/
140   /*************************************************************************/
141   /*************************************************************************/
142 
143 
144   /*************************************************************************/
145   /*                                                                       */
146   /* This structure/class is defined here because it is common to the      */
147   /* following formats: TTF, OpenType-TT, and OpenType-CFF.                */
148   /*                                                                       */
149   /* Note, however, that the classes TT_Size, TT_GlyphSlot, and TT_CharMap */
150   /* are not shared between font drivers, and are thus defined normally in */
151   /* `ttobjs.h'.                                                           */
152   /*                                                                       */
153   /*************************************************************************/
154 
155   typedef struct T1_FaceRec_*   T1_Face;
156   typedef struct CID_FaceRec_*  CID_Face;
157 
158 
159   typedef struct  T1_FaceRec_
160   {
161     FT_FaceRec     root;
162     T1_FontRec     type1;
163     const void*    psnames;
164     const void*    psaux;
165     const void*    afm_data;
166     FT_CharMapRec  charmaprecs[2];
167     FT_CharMap     charmaps[2];
168     PS_Unicodes    unicode_map;
169 
170     /* support for Multiple Masters fonts */
171     PS_Blend       blend;
172 
173     /* since FT 2.1 - interface to PostScript hinter */
174     const void*    pshinter;
175 
176   } T1_FaceRec;
177 
178 
179   typedef struct  CID_FaceRec_
180   {
181     FT_FaceRec       root;
182     void*            psnames;
183     void*            psaux;
184     CID_FaceInfoRec  cid;
185     void*            afm_data;
186     CID_Subrs        subrs;
187 
188     /* since FT 2.1 - interface to PostScript hinter */
189     void*            pshinter;
190 
191   } CID_FaceRec;
192 
193 
194 FT_END_HEADER
195 
196 #endif /* __T1TYPES_H__ */
197 
198 
199 /* END */
200