00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __CFFGLOAD_H__
00020 #define __CFFGLOAD_H__
00021
00022
00023 #include <ft2build.h>
00024 #include FT_FREETYPE_H
00025 #include "cffobjs.h"
00026
00027
00028 FT_BEGIN_HEADER
00029
00030
00031 #define CFF_MAX_OPERANDS 48
00032 #define CFF_MAX_SUBRS_CALLS 32
00033 #define CFF_MAX_TRANS_ELEMENTS 32
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081 typedef struct CFF_Builder_
00082 {
00083 FT_Memory memory;
00084 TT_Face face;
00085 CFF_GlyphSlot glyph;
00086 FT_GlyphLoader loader;
00087 FT_Outline* base;
00088 FT_Outline* current;
00089
00090 FT_Pos pos_x;
00091 FT_Pos pos_y;
00092
00093 FT_Vector left_bearing;
00094 FT_Vector advance;
00095
00096 FT_BBox bbox;
00097 FT_Bool path_begun;
00098 FT_Bool load_points;
00099 FT_Bool no_recurse;
00100
00101 FT_Bool metrics_only;
00102
00103 void* hints_funcs;
00104 void* hints_globals;
00105
00106 } CFF_Builder;
00107
00108
00109
00110
00111 typedef struct CFF_Decoder_Zone_
00112 {
00113 FT_Byte* base;
00114 FT_Byte* limit;
00115 FT_Byte* cursor;
00116
00117 } CFF_Decoder_Zone;
00118
00119
00120 typedef struct CFF_Decoder_
00121 {
00122 CFF_Builder builder;
00123 CFF_Font cff;
00124
00125 FT_Fixed stack[CFF_MAX_OPERANDS + 1];
00126 FT_Fixed* top;
00127
00128 CFF_Decoder_Zone zones[CFF_MAX_SUBRS_CALLS + 1];
00129 CFF_Decoder_Zone* zone;
00130
00131 FT_Int flex_state;
00132 FT_Int num_flex_vectors;
00133 FT_Vector flex_vectors[7];
00134
00135 FT_Pos glyph_width;
00136 FT_Pos nominal_width;
00137
00138 FT_Bool read_width;
00139 FT_Bool width_only;
00140 FT_Int num_hints;
00141 FT_Fixed buildchar[CFF_MAX_TRANS_ELEMENTS];
00142
00143 FT_UInt num_locals;
00144 FT_UInt num_globals;
00145
00146 FT_Int locals_bias;
00147 FT_Int globals_bias;
00148
00149 FT_Byte** locals;
00150 FT_Byte** globals;
00151
00152 FT_Byte** glyph_names;
00153 FT_UInt num_glyphs;
00154
00155 FT_Render_Mode hint_mode;
00156
00157 FT_Bool seac;
00158
00159 } CFF_Decoder;
00160
00161
00162 FT_LOCAL( void )
00163 cff_decoder_init( CFF_Decoder* decoder,
00164 TT_Face face,
00165 CFF_Size size,
00166 CFF_GlyphSlot slot,
00167 FT_Bool hinting,
00168 FT_Render_Mode hint_mode );
00169
00170 FT_LOCAL( FT_Error )
00171 cff_decoder_prepare( CFF_Decoder* decoder,
00172 CFF_Size size,
00173 FT_UInt glyph_index );
00174
00175 #if 0
00176
00177
00178 FT_LOCAL( FT_Error )
00179 cff_compute_max_advance( TT_Face face,
00180 FT_Int* max_advance );
00181
00182 #endif
00183
00184 FT_LOCAL( FT_Error )
00185 cff_decoder_parse_charstrings( CFF_Decoder* decoder,
00186 FT_Byte* charstring_base,
00187 FT_ULong charstring_len );
00188
00189 FT_LOCAL( FT_Error )
00190 cff_slot_load( CFF_GlyphSlot glyph,
00191 CFF_Size size,
00192 FT_UInt glyph_index,
00193 FT_Int32 load_flags );
00194
00195
00196 FT_END_HEADER
00197
00198 #endif
00199
00200
00201