20#include FT_INTERNAL_DEBUG_H
21#include FT_INTERNAL_STREAM_H
22#include FT_INTERNAL_SFNT_H
23#include FT_INTERNAL_CALC_H
24#include FT_INTERNAL_POSTSCRIPT_AUX_H
41#define FT_COMPONENT trace_cffgload
50#ifdef FT_CONFIG_OPTION_INCREMENTAL
53 if (
face->root.internal->incremental_interface )
57 face->root.internal->incremental_interface->funcs->get_glyph_data(
58 face->root.internal->incremental_interface->object,
85#ifndef FT_CONFIG_OPTION_INCREMENTAL
89#ifdef FT_CONFIG_OPTION_INCREMENTAL
92 if (
face->root.internal->incremental_interface )
100 face->root.internal->incremental_interface->funcs->free_glyph_data(
101 face->root.internal->incremental_interface->object, &
data );
154 decoder.builder.metrics_only = 1;
155 decoder.builder.load_points = 0;
159 for ( glyph_index = 0; glyph_index <
face->root.num_glyphs;
168 &charstring, &charstring_len );
185 *max_advance =
decoder.builder.advance.x;
198 FT_Int32 load_flags )
204 FT_Bool hinting, scaled, force_scaling;
214 force_scaling =
FALSE;
223 if ( glyph_index != 0 )
227 if ( glyph_index == 0 )
228 return FT_THROW( Invalid_Argument );
232 return FT_THROW( Invalid_Argument );
237 glyph->x_scale = 0x10000L;
238 glyph->y_scale = 0x10000L;
241 glyph->x_scale =
size->root.metrics.x_scale;
242 glyph->y_scale =
size->root.metrics.y_scale;
245#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
258 if (
size->strike_index != 0xFFFFFFFFUL &&
280 glyph->root.outline.n_points = 0;
281 glyph->root.outline.n_contours = 0;
286 glyph->root.metrics.horiBearingX = (
FT_Pos)
metrics.horiBearingX << 6;
287 glyph->root.metrics.horiBearingY = (
FT_Pos)
metrics.horiBearingY << 6;
288 glyph->root.metrics.horiAdvance = (
FT_Pos)
metrics.horiAdvance << 6;
290 glyph->root.metrics.vertBearingX = (
FT_Pos)
metrics.vertBearingX << 6;
291 glyph->root.metrics.vertBearingY = (
FT_Pos)
metrics.vertBearingY << 6;
292 glyph->root.metrics.vertAdvance = (
FT_Pos)
metrics.vertAdvance << 6;
294 glyph->root.format = FT_GLYPH_FORMAT_BITMAP;
298 glyph->root.bitmap_left =
metrics.vertBearingX;
299 glyph->root.bitmap_top =
metrics.vertBearingY;
303 glyph->root.bitmap_left =
metrics.horiBearingX;
304 glyph->root.bitmap_top =
metrics.horiBearingY;
313 glyph->root.linearHoriAdvance =
advance;
316 face->vertical_info &&
317 face->vertical.number_Of_VMetrics > 0 );
320 if ( has_vertical_info )
326 glyph->root.linearVertAdvance =
advance;
331 if (
face->os2.version != 0xFFFFU )
332 glyph->root.linearVertAdvance = (
FT_Pos)
333 (
face->os2.sTypoAscender -
face->os2.sTypoDescender );
335 glyph->root.linearVertAdvance = (
FT_Pos)
336 (
face->horizontal.Ascender -
face->horizontal.Descender );
348 return FT_THROW( Invalid_Argument );
371 if ( top_upm != sub_upm )
373 glyph->x_scale =
FT_MulDiv( glyph->x_scale, top_upm, sub_upm );
374 glyph->y_scale =
FT_MulDiv( glyph->y_scale, top_upm, sub_upm );
376 force_scaling =
TRUE;
385 glyph->root.outline.n_points = 0;
386 glyph->root.outline.n_contours = 0;
393 glyph->hint = hinting;
394 glyph->scaled = scaled;
398#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
421 &charstring, &charstring_len );
423 goto Glyph_Build_Finished;
427 goto Glyph_Build_Finished;
429#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
453 force_scaling =
TRUE;
454 glyph->hint = hinting;
465 goto Glyph_Build_Finished;
467#ifdef FT_CONFIG_OPTION_INCREMENTAL
470 if (
face->root.internal->incremental_interface )
472 glyph->root.control_data =
NULL;
473 glyph->root.control_len = 0;
485 if ( csindex->offsets )
487 glyph->root.control_data = csindex->bytes +
488 csindex->offsets[glyph_index] - 1;
489 glyph->root.control_len = (
FT_Long)charstring_len;
493 Glyph_Build_Finished:
500#ifdef FT_CONFIG_OPTION_INCREMENTAL
504 face->root.internal->incremental_interface &&
505 face->root.internal->incremental_interface->funcs->get_glyph_metrics )
515 error =
face->root.internal->incremental_interface->funcs->get_glyph_metrics(
516 face->root.internal->incremental_interface->object,
539 glyph->root.metrics.horiBearingX =
decoder.builder.left_bearing.x;
540 glyph->root.metrics.horiAdvance =
decoder.glyph_width;
541 internal->glyph_matrix = font_matrix;
542 internal->glyph_delta = font_offset;
552 if (
face->horizontal.number_Of_HMetrics )
562 metrics->horiAdvance = horiAdvance;
563 metrics->horiBearingX = horiBearingX;
564 glyph->root.linearHoriAdvance = horiAdvance;
570 glyph->root.linearHoriAdvance =
decoder.glyph_width;
573 glyph->root.internal->glyph_transformed = 0;
575 has_vertical_info =
FT_BOOL(
face->vertical_info &&
576 face->vertical.number_Of_VMetrics > 0 );
579 if ( has_vertical_info )
589 metrics->vertBearingY = vertBearingY;
590 metrics->vertAdvance = vertAdvance;
595 if (
face->os2.version != 0xFFFFU )
597 face->os2.sTypoDescender );
600 face->horizontal.Descender );
603 glyph->root.linearVertAdvance =
metrics->vertAdvance;
607 glyph->root.outline.flags = 0;
608 if (
size &&
size->root.metrics.y_ppem < 24 )
614 if ( font_matrix.xx != 0x10000L || font_matrix.yy != 0x10000L ||
615 font_matrix.xy != 0 || font_matrix.yx != 0 )
625 if ( font_offset.x || font_offset.y )
631 metrics->horiAdvance += font_offset.x;
632 metrics->vertAdvance += font_offset.y;
646 if ( !hinting || !
decoder.builder.hints_funcs )
647 for (
n =
cur->n_points;
n > 0;
n--,
vec++ )
667 if ( has_vertical_info )
ios_base &_STLP_CALL internal(ios_base &__s)
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
cff_slot_load(CFF_GlyphSlot glyph, CFF_Size size, FT_UInt glyph_index, FT_Int32 load_flags)
cff_get_glyph_data(TT_Face face, FT_UInt glyph_index, FT_Byte **pointer, FT_ULong *length)
cff_free_glyph_data(TT_Face face, FT_Byte **pointer, FT_ULong length)
cff_charset_cid_to_gindex(CFF_Charset charset, FT_UInt cid)
cff_index_forget_element(CFF_Index idx, FT_Byte **pbytes)
cff_fd_select_get(CFF_FDSelect fdselect, FT_UInt glyph_index)
cff_index_access_element(CFF_Index idx, FT_UInt element, FT_Byte **pbytes, FT_ULong *pbyte_len)
FT_BEGIN_HEADER typedef TT_Face CFF_Face
struct CFF_FontRec_ * CFF_Font
FT_BEGIN_HEADER struct CFF_IndexRec_ * CFF_Index
#define FT_LOAD_VERTICAL_LAYOUT
#define FT_LOAD_TARGET_MODE(x)
FT_BEGIN_HEADER struct FT_Glyph_Metrics_ FT_Glyph_Metrics
#define FT_LOAD_SBITS_ONLY
#define FT_LOAD_NO_BITMAP
#define FT_LOAD_NO_RECURSE
#define FT_LOAD_ADVANCE_ONLY
#define FT_LOAD_NO_HINTING
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
FT_MulFix(FT_Long a, FT_Long b)
#define FT_HINTING_FREETYPE
#define FT_OUTLINE_HIGH_PRECISION
#define FT_OUTLINE_REVERSE_FILL
FT_BEGIN_HEADER typedef signed long FT_Pos
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
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLsizei const GLvoid * pointer
GLenum GLuint GLint GLenum face
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
GLuint GLsizei GLsizei * length
struct @1687::@1688 driver
FT_BEGIN_HEADER struct PS_DriverRec_ * PS_Driver
struct PSAux_ServiceRec_ * PSAux_Service
SFNT_Interface * SFNT_Service
CFF_SubFont subfonts[CFF_MAX_CID_FONTS]
CFF_IndexRec charstrings_index
CFF_FDSelectRec fd_select
CFF_FontRecDictRec font_dict
void(* ps_decoder_init)(PS_Decoder *ps_decoder, void *decoder, FT_Bool is_t1)
const CFF_Decoder_FuncsRec * cff_decoder_funcs
TT_Load_Table_Func load_eblc
TT_Load_SBit_Image_Func load_sbit_image
struct TT_FaceRec_ * TT_Face