22#include FT_INTERNAL_DEBUG_H
23#include FT_INTERNAL_STREAM_H
25#include FT_INTERNAL_CALC_H
27#include FT_INTERNAL_POSTSCRIPT_AUX_H
28#include FT_INTERNAL_CFF_TYPES_H
41#define FT_COMPONENT trace_cidgload
61#ifdef FT_CONFIG_OPTION_INCREMENTAL
63 face->root.internal->incremental_interface;
67 FT_TRACE1((
"cid_load_glyph: glyph index %d\n", glyph_index ));
69#ifdef FT_CONFIG_OPTION_INCREMENTAL
79 glyph_index, &glyph_data );
86 if ( glyph_data.
length != 0 )
113 glyph_index * entry_len ) ||
128 FT_TRACE0((
"cid_load_glyph: invalid glyph stream offsets\n" ));
133 glyph_length = off2 - off1;
134 if ( glyph_length == 0 )
136 if (
FT_ALLOC( charstring, glyph_length ) )
139 charstring, glyph_length ) )
152 decoder->subrs = cid_subrs->
code;
153 decoder->subrs_len = 0;
154 decoder->subrs_hash =
NULL;
157 dict =
cid->font_dicts + fd_select;
166 cs_offset = decoder->lenIV >= 0 ? (
FT_UInt)decoder->lenIV : 0;
167 if ( cs_offset > glyph_length )
169 FT_TRACE0((
"cid_load_glyph: invalid glyph stream offsets\n" ));
175 if ( decoder->lenIV >= 0 )
176 psaux->t1_decrypt( charstring, glyph_length, 4330 );
179#ifdef T1_CONFIG_OPTION_OLD_ENGINE
182 decoder->builder.metrics_only )
183 error = psaux->t1_decoder_funcs->parse_charstrings_old(
185 charstring + cs_offset,
186 glyph_length - cs_offset );
188 if ( decoder->builder.metrics_only )
189 error = psaux->t1_decoder_funcs->parse_metrics(
191 charstring + cs_offset,
192 glyph_length - cs_offset );
200 psaux->ps_decoder_init( &psdecoder, decoder,
TRUE );
207 error = psaux->t1_decoder_funcs->parse_charstrings(
209 charstring + cs_offset,
210 glyph_length - cs_offset );
221 force_scaling =
TRUE;
223 error = psaux->t1_decoder_funcs->parse_charstrings(
225 charstring + cs_offset,
226 glyph_length - cs_offset );
231#ifdef FT_CONFIG_OPTION_INCREMENTAL
257 ((
CID_GlyphSlot)decoder->builder.glyph)->scaled = force_scaling;
317 for ( glyph_index = 0; glyph_index <
face->root.num_glyphs;
340 FT_Int32 load_flags )
346 if (!decoder)
return FT_Err_Out_Of_Memory;
348#define decoder (*decoder)
363 if ( glyph_index >= (
FT_UInt)
face->root.num_glyphs )
372 glyph->
x_scale = cidsize->metrics.x_scale;
373 glyph->
y_scale = cidsize->metrics.y_scale;
375 cidglyph->outline.n_points = 0;
376 cidglyph->outline.n_contours = 0;
382 glyph->
hint = hinting;
401 must_finish_decoder =
TRUE;
412 hinting = glyph->
hint;
421 must_finish_decoder =
FALSE;
436 cidglyph->metrics.horiBearingX =
438 cidglyph->metrics.horiAdvance =
441 internal->glyph_matrix = font_matrix;
442 internal->glyph_delta = font_offset;
454 cidglyph->linearHoriAdvance =
456 cidglyph->internal->glyph_transformed = 0;
459 metrics->vertAdvance = (
face->cid.font_bbox.yMax -
460 face->cid.font_bbox.yMin ) >> 16;
461 cidglyph->linearVertAdvance =
metrics->vertAdvance;
465 if ( cidsize->metrics.y_ppem < 24 )
469 if ( font_matrix.
xx != 0x10000L || font_matrix.
yy != 0x10000L ||
470 font_matrix.
xy != 0 || font_matrix.
yx != 0 )
480 if ( font_offset.
x || font_offset.
y )
486 metrics->horiAdvance += font_offset.
x;
487 metrics->vertAdvance += font_offset.
y;
502 for (
n =
cur->n_points;
n > 0;
n--,
vec++ )
532 if ( must_finish_decoder )
ios_base &_STLP_CALL internal(ios_base &__s)
cid_slot_load_glyph(FT_GlyphSlot cidglyph, FT_Size cidsize, FT_UInt glyph_index, FT_Int32 load_flags)
cid_load_glyph(T1_Decoder decoder, FT_UInt glyph_index)
cid_get_offset(FT_Byte **start, FT_Byte offsize)
struct CID_GlyphSlotRec_ * CID_GlyphSlot
#define FT_LOAD_VERTICAL_LAYOUT
#define FT_LOAD_TARGET_MODE(x)
FT_BEGIN_HEADER struct FT_Glyph_Metrics_ FT_Glyph_Metrics
#define FT_LOAD_NO_RECURSE
#define FT_LOAD_NO_HINTING
FT_MulFix(FT_Long a, FT_Long b)
#define FT_CALLBACK_DEF(x)
#define FT_TRACE0(varformat)
#define FT_TRACE1(varformat)
#define FT_HINTING_FREETYPE
#define FT_OUTLINE_HIGH_PRECISION
#define FT_OUTLINE_REVERSE_FILL
#define FT_ALLOC(ptr, size)
ft_synthesize_vertical_metrics(FT_Glyph_Metrics *metrics, FT_Pos advance)
#define FT_FACE_DRIVER(x)
FT_Outline_Translate(const FT_Outline *outline, FT_Pos xOffset, FT_Pos yOffset)
FT_Outline_Transform(const FT_Outline *outline, const FT_Matrix *matrix)
FT_Outline_Get_CBox(const FT_Outline *outline, FT_BBox *acbox)
smooth FT_Module_Constructor FT_Module_Destructor FT_Module_Requester FT_GLYPH_FORMAT_OUTLINE
#define FT_FRAME_ENTER(size)
#define FT_STREAM_SEEK(position)
#define FT_STREAM_READ_AT(position, buffer, count)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLenum GLuint GLint GLenum face
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
static char memory[1024 *256]
FT_BEGIN_HEADER struct PS_DriverRec_ * PS_Driver
struct PSAux_ServiceRec_ * PSAux_Service
PS_PrivateRec private_dict
FT_Incremental_FreeGlyphDataFunc free_glyph_data
FT_Incremental_GetGlyphDataFunc get_glyph_data
FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics
const FT_Incremental_FuncsRec * funcs
const T1_Decoder_FuncsRec * t1_decoder_funcs
CFF_SubFont current_subfont
void(* done)(T1_Decoder decoder)
FT_Error(* init)(T1_Decoder decoder, FT_Face face, FT_Size size, FT_GlyphSlot slot, FT_Byte **glyph_names, PS_Blend blend, FT_Bool hinting, FT_Render_Mode hint_mode, T1_Decoder_Callback callback)
struct CID_FaceRec_ * CID_Face