1 /***************************************************************************/
2 /*                                                                         */
3 /*  cffobjs.h                                                              */
4 /*                                                                         */
5 /*    OpenType objects manager (specification).                            */
6 /*                                                                         */
7 /*  Copyright 1996-2004, 2006-2008, 2013 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 __CFFOBJS_H__
20 #define __CFFOBJS_H__
21 
22 
23 #include <ft2build.h>
24 #include FT_INTERNAL_OBJECTS_H
25 #include "cfftypes.h"
26 #include FT_INTERNAL_TRUETYPE_TYPES_H
27 #include FT_SERVICE_POSTSCRIPT_CMAPS_H
28 #include FT_INTERNAL_POSTSCRIPT_HINTS_H
29 
30 
31 FT_BEGIN_HEADER
32 
33 
34   /*************************************************************************/
35   /*                                                                       */
36   /* <Type>                                                                */
37   /*    CFF_Driver                                                         */
38   /*                                                                       */
39   /* <Description>                                                         */
40   /*    A handle to an OpenType driver object.                             */
41   /*                                                                       */
42   typedef struct CFF_DriverRec_*  CFF_Driver;
43 
44   typedef TT_Face  CFF_Face;
45 
46 
47   /*************************************************************************/
48   /*                                                                       */
49   /* <Type>                                                                */
50   /*    CFF_Size                                                           */
51   /*                                                                       */
52   /* <Description>                                                         */
53   /*    A handle to an OpenType size object.                               */
54   /*                                                                       */
55   typedef struct  CFF_SizeRec_
56   {
57     FT_SizeRec  root;
58     FT_ULong    strike_index;    /* 0xFFFFFFFF to indicate invalid */
59 
60   } CFF_SizeRec, *CFF_Size;
61 
62 
63   /*************************************************************************/
64   /*                                                                       */
65   /* <Type>                                                                */
66   /*    CFF_GlyphSlot                                                      */
67   /*                                                                       */
68   /* <Description>                                                         */
69   /*    A handle to an OpenType glyph slot object.                         */
70   /*                                                                       */
71   typedef struct  CFF_GlyphSlotRec_
72   {
73     FT_GlyphSlotRec  root;
74 
75     FT_Bool          hint;
76     FT_Bool          scaled;
77 
78     FT_Fixed         x_scale;
79     FT_Fixed         y_scale;
80 
81   } CFF_GlyphSlotRec, *CFF_GlyphSlot;
82 
83 
84   /*************************************************************************/
85   /*                                                                       */
86   /* <Type>                                                                */
87   /*    CFF_Internal                                                       */
88   /*                                                                       */
89   /* <Description>                                                         */
90   /*    The interface to the `internal' field of `FT_Size'.                */
91   /*                                                                       */
92   typedef struct  CFF_InternalRec_
93   {
94     PSH_Globals  topfont;
95     PSH_Globals  subfonts[CFF_MAX_CID_FONTS];
96 
97   } CFF_InternalRec, *CFF_Internal;
98 
99 
100   /*************************************************************************/
101   /*                                                                       */
102   /* Subglyph transformation record.                                       */
103   /*                                                                       */
104   typedef struct  CFF_Transform_
105   {
106     FT_Fixed    xx, xy;     /* transformation matrix coefficients */
107     FT_Fixed    yx, yy;
108     FT_F26Dot6  ox, oy;     /* offsets        */
109 
110   } CFF_Transform;
111 
112 
113   /***********************************************************************/
114   /*                                                                     */
115   /* CFF driver class.                                                   */
116   /*                                                                     */
117   typedef struct  CFF_DriverRec_
118   {
119     FT_DriverRec  root;
120 
121     FT_UInt  hinting_engine;
122     FT_Bool  no_stem_darkening;
123 
124     FT_Int  darken_params[8];
125 
126   } CFF_DriverRec;
127 
128 
129   FT_LOCAL( FT_Error )
130   cff_size_init( FT_Size  size );           /* CFF_Size */
131 
132   FT_LOCAL( void )
133   cff_size_done( FT_Size  size );           /* CFF_Size */
134 
135   FT_LOCAL( FT_Error )
136   cff_size_request( FT_Size          size,
137                     FT_Size_Request  req );
138 
139 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
140 
141   FT_LOCAL( FT_Error )
142   cff_size_select( FT_Size   size,
143                    FT_ULong  strike_index );
144 
145 #endif
146 
147   FT_LOCAL( void )
148   cff_slot_done( FT_GlyphSlot  slot );
149 
150   FT_LOCAL( FT_Error )
151   cff_slot_init( FT_GlyphSlot  slot );
152 
153 
154   /*************************************************************************/
155   /*                                                                       */
156   /* Face functions                                                        */
157   /*                                                                       */
158   FT_LOCAL( FT_Error )
159   cff_face_init( FT_Stream      stream,
160                  FT_Face        face,           /* CFF_Face */
161                  FT_Int         face_index,
162                  FT_Int         num_params,
163                  FT_Parameter*  params );
164 
165   FT_LOCAL( void )
166   cff_face_done( FT_Face  face );               /* CFF_Face */
167 
168 
169   /*************************************************************************/
170   /*                                                                       */
171   /* Driver functions                                                      */
172   /*                                                                       */
173   FT_LOCAL( FT_Error )
174   cff_driver_init( FT_Module  module );         /* CFF_Driver */
175 
176   FT_LOCAL( void )
177   cff_driver_done( FT_Module  module );         /* CFF_Driver */
178 
179 
180 FT_END_HEADER
181 
182 #endif /* __CFFOBJS_H__ */
183 
184 
185 /* END */
186