cffgload.c File Reference

#include <ft2build.h>
#include "cffobjs.h"
#include "cffload.h"
#include "cffgload.h"
#include "cfferrs.h"

Go to the source code of this file.

Defines

#define FT_COMPONENT   trace_cffgload
#define CFF_COUNT_CHECK_WIDTH   0x80
#define CFF_COUNT_EXACT   0x40
#define CFF_COUNT_CLEAR_STACK   0x20

Typedefs

typedef enum CFF_Operator_ CFF_Operator

Enumerations

enum  CFF_Operator_

Functions

static void cff_builder_init (CFF_Builder *builder, TT_Face face, CFF_Size size, CFF_GlyphSlot glyph, FT_Bool hinting)
static void cff_builder_done (CFF_Builder *builder)
static FT_Int cff_compute_bias (FT_Int in_charstring_type, FT_UInt num_subrs)
 cff_decoder_init (CFF_Decoder *decoder, TT_Face face, CFF_Size size, CFF_GlyphSlot slot, FT_Bool hinting, FT_Render_Mode hint_mode)
 cff_decoder_prepare (CFF_Decoder *decoder, CFF_Size size, FT_UInt glyph_index)
static FT_Error check_points (CFF_Builder *builder, FT_Int count)
static void cff_builder_add_point (CFF_Builder *builder, FT_Pos x, FT_Pos y, FT_Byte flag)
static FT_Error cff_builder_add_point1 (CFF_Builder *builder, FT_Pos x, FT_Pos y)
static FT_Error cff_builder_add_contour (CFF_Builder *builder)
static FT_Error cff_builder_start_point (CFF_Builder *builder, FT_Pos x, FT_Pos y)
static void cff_builder_close_contour (CFF_Builder *builder)
static FT_Int cff_lookup_glyph_by_stdcharcode (CFF_Font cff, FT_Int charcode)
static FT_Error cff_get_glyph_data (TT_Face face, FT_UInt glyph_index, FT_Byte **pointer, FT_ULong *length)
static void cff_free_glyph_data (TT_Face face, FT_Byte **pointer, FT_ULong length)
static FT_Error cff_operator_seac (CFF_Decoder *decoder, FT_Pos asb, FT_Pos adx, FT_Pos ady, FT_Int bchar, FT_Int achar)
 cff_decoder_parse_charstrings (CFF_Decoder *decoder, FT_Byte *charstring_base, FT_ULong charstring_len)
 cff_slot_load (CFF_GlyphSlot glyph, CFF_Size size, FT_UInt glyph_index, FT_Int32 load_flags)

Variables

static const FT_Byte cff_argument_counts []


Define Documentation

#define CFF_COUNT_CHECK_WIDTH   0x80

Definition at line 127 of file cffgload.c.

Referenced by cff_decoder_parse_charstrings().

#define CFF_COUNT_CLEAR_STACK   0x20

Definition at line 129 of file cffgload.c.

#define CFF_COUNT_EXACT   0x40

Definition at line 128 of file cffgload.c.

#define FT_COMPONENT   trace_cffgload

Definition at line 41 of file cffgload.c.


Typedef Documentation

typedef enum CFF_Operator_ CFF_Operator


Enumeration Type Documentation

enum CFF_Operator_

Definition at line 44 of file cffgload.c.


Function Documentation

static FT_Error cff_builder_add_contour ( CFF_Builder builder  )  [static]

Definition at line 518 of file cffgload.c.

References FT_Outline_::contours, CFF_Builder_::current, error, FT_GLYPHLOADER_CHECK_POINTS, CFF_Builder_::load_points, CFF_Builder_::loader, FT_Outline_::n_contours, FT_Outline_::n_points, and short.

Referenced by cff_builder_start_point().

static void cff_builder_add_point ( CFF_Builder builder,
FT_Pos  x,
FT_Pos  y,
FT_Byte  flag 
) [static]

Definition at line 476 of file cffgload.c.

References CFF_Builder_::current, FT_CURVE_TAG_CUBIC, FT_CURVE_TAG_ON, CFF_Builder_::load_points, FT_Outline_::n_points, FT_Outline_::points, FT_Outline_::tags, POINT::x, and POINT::y.

Referenced by cff_builder_add_point1(), and cff_decoder_parse_charstrings().

static FT_Error cff_builder_add_point1 ( CFF_Builder builder,
FT_Pos  x,
FT_Pos  y 
) [static]

Definition at line 501 of file cffgload.c.

References cff_builder_add_point(), check_points, and error.

Referenced by cff_builder_start_point(), and cff_decoder_parse_charstrings().

static void cff_builder_close_contour ( CFF_Builder builder  )  [static]

Definition at line 568 of file cffgload.c.

References FT_Outline_::contours, CFF_Builder_::current, FT_CURVE_TAG_ON, if(), FT_Outline_::n_contours, FT_Outline_::n_points, p1(), p2(), FT_Outline_::points, short, and FT_Outline_::tags.

Referenced by cff_decoder_parse_charstrings().

static void cff_builder_done ( CFF_Builder builder  )  [static]

Definition at line 309 of file cffgload.c.

References CFF_Builder_::base, CFF_Builder_::glyph, FT_GlyphSlotRec_::outline, and CFF_GlyphSlotRec_::root.

Referenced by cff_slot_load().

static void cff_builder_init ( CFF_Builder builder,
TT_Face  face,
CFF_Size  size,
CFF_GlyphSlot  glyph,
FT_Bool  hinting 
) [static]

Definition at line 249 of file cffgload.c.

References CFF_Builder_::advance, CFF_Builder_::base, CFF_Builder_::current, CFF_Builder_::face, FT_GlyphLoader_Rewind(), CFF_Builder_::glyph, FT_Slot_InternalRec_::glyph_hints, CFF_Builder_::hints_funcs, CFF_Builder_::hints_globals, FT_GlyphSlotRec_::internal, CFF_Builder_::left_bearing, CFF_Builder_::load_points, CFF_Builder_::loader, FT_Slot_InternalRec_::loader, CFF_Builder_::memory, CFF_Builder_::path_begun, CFF_Builder_::pos_x, CFF_Builder_::pos_y, CFF_GlyphSlotRec_::root, size, CFF_InternalRec_::topfont, FT_Vector_::x, and FT_Vector_::y.

Referenced by cff_decoder_init().

static FT_Error cff_builder_start_point ( CFF_Builder builder,
FT_Pos  x,
FT_Pos  y 
) [static]

Definition at line 546 of file cffgload.c.

References cff_builder_add_contour(), cff_builder_add_point1(), error, and CFF_Builder_::path_begun.

Referenced by cff_decoder_parse_charstrings().

static FT_Int cff_compute_bias ( FT_Int  in_charstring_type,
FT_UInt  num_subrs 
) [static]

Definition at line 337 of file cffgload.c.

References result().

Referenced by cff_decoder_init(), and cff_decoder_prepare().

cff_decoder_init ( CFF_Decoder decoder,
TT_Face  face,
CFF_Size  size,
CFF_GlyphSlot  slot,
FT_Bool  hinting,
FT_Render_Mode  hint_mode 
)

Definition at line 379 of file cffgload.c.

References cff_builder_init(), cff_compute_bias(), CFF_FontRecDictRec_::charstring_type, CFF_SubFontRec_::font_dict, FT_MEM_ZERO, CFF_FontRec_::global_subrs, CFF_FontRec_::num_global_subrs, and CFF_FontRec_::top_font.

Referenced by cff_slot_load().

cff_decoder_parse_charstrings ( CFF_Decoder decoder,
FT_Byte charstring_base,
FT_ULong  charstring_len 
)

Definition at line 885 of file cffgload.c.

References T2_Hints_FuncsRec_::apply, CFF_Decoder_Zone_::base, cff_argument_counts, cff_builder_add_point(), cff_builder_add_point1(), cff_builder_close_contour(), cff_builder_start_point(), CFF_COUNT_CHECK_WIDTH, CFF_MAX_OPERANDS, CFF_MAX_SUBRS_CALLS, CFF_MAX_TRANS_ELEMENTS, cff_op_abs, cff_op_add, cff_op_and, cff_op_blend, cff_op_callgsubr, cff_op_callothersubr, cff_op_callsubr, cff_op_closepath, cff_op_cntrmask, cff_op_div, cff_op_dotsection, cff_op_drop, cff_op_dup, cff_op_endchar, cff_op_eq, cff_op_exch, cff_op_flex, cff_op_flex1, cff_op_get, cff_op_hflex, cff_op_hflex1, cff_op_hhcurveto, cff_op_hintmask, cff_op_hlineto, cff_op_hmoveto, cff_op_hsbw, cff_op_hstem, cff_op_hstemhm, cff_op_hvcurveto, cff_op_ifelse, cff_op_index, cff_op_load, cff_op_mul, cff_op_neg, cff_op_not, cff_op_or, cff_op_pop, cff_op_put, cff_op_random, cff_op_rcurveline, cff_op_return, cff_op_rlinecurve, cff_op_rlineto, cff_op_rmoveto, cff_op_roll, cff_op_rrcurveto, cff_op_sbw, cff_op_seac, cff_op_setcurrentpoint, cff_op_sqrt, cff_op_store, cff_op_sub, cff_op_unknown, cff_op_vhcurveto, cff_op_vlineto, cff_op_vmoveto, cff_op_vstem, cff_op_vstemhm, cff_op_vvcurveto, cff_operator_seac(), check_points, T2_Hints_FuncsRec_::close, T2_Hints_FuncsRec_::counter, CFF_Builder_::current, CFF_Decoder_Zone_::cursor, error, FT_Bool, FT_DivFix(), FT_ERROR, FT_GlyphLoader_Add(), FT_MulFix(), FT_Pos, FT_TRACE4, FT_ULONG_MAX, T2_Hints_FuncsRec_::hintmask, T2_Hints_FuncsRec_::hints, CFF_Builder_::hints_funcs, i, if(), RooFitShortHand::L(), CFF_Decoder_Zone_::limit, FT_Outline_::n_points, num_lines, T2_Hints_FuncsRec_::open, CFF_Builder_::path_begun, CFF_Builder_::pos_x, CFF_Builder_::pos_y, root, seed, T2_Hints_FuncsRec_::stems, top(), val, x, x10000L, and y.

Referenced by cff_operator_seac(), and cff_slot_load().

cff_decoder_prepare ( CFF_Decoder decoder,
CFF_Size  size,
FT_UInt  glyph_index 
)

Definition at line 410 of file cffgload.c.

References cff_compute_bias(), cff_fd_select_get(), FT_Generic_::data, error, TT_FaceRec_::extra, CFF_Builder_::face, CFF_FontRec_::fd_select, FT_TRACE4, CFF_Builder_::hints_funcs, CFF_Builder_::hints_globals, if(), CFF_FontRec_::num_subfonts, CFF_InternalRec_::subfonts, CFF_FontRec_::subfonts, and CFF_FontRec_::top_font.

Referenced by cff_slot_load().

static void cff_free_glyph_data ( TT_Face  face,
FT_Byte **  pointer,
FT_ULong  length 
) [static]

Definition at line 678 of file cffgload.c.

References cff_index_forget_element(), CFF_FontRec_::charstrings_index, data, and FT_UNUSED.

Referenced by cff_operator_seac(), and cff_slot_load().

static FT_Error cff_get_glyph_data ( TT_Face  face,
FT_UInt  glyph_index,
FT_Byte **  pointer,
FT_ULong length 
) [static]

Definition at line 642 of file cffgload.c.

References cff_index_access_element(), CFF_FontRec_::charstrings_index, data, and error.

Referenced by cff_operator_seac(), and cff_slot_load().

static FT_Int cff_lookup_glyph_by_stdcharcode ( CFF_Font  cff,
FT_Int  charcode 
) [static]

Definition at line 613 of file cffgload.c.

References cff_get_standard_encoding(), CFF_FontRec_::charset, n, CFF_FontRec_::num_glyphs, and CFF_CharsetRec_::sids.

Referenced by cff_operator_seac().

static FT_Error cff_operator_seac ( CFF_Decoder decoder,
FT_Pos  asb,
FT_Pos  adx,
FT_Pos  ady,
FT_Int  bchar,
FT_Int  achar 
) [static]

Definition at line 713 of file cffgload.c.

References CFF_Builder_::advance, CFF_Decoder_::builder, cff_decoder_parse_charstrings(), cff_free_glyph_data(), cff_get_glyph_data(), cff_lookup_glyph_by_stdcharcode(), error, CFF_Builder_::face, FALSE, FT_GlyphSlotRec_::format, FT_ERROR, FT_GLYPH_FORMAT_COMPOSITE, FT_GlyphLoader_CheckSubGlyphs(), FT_GlyphLoader_Prepare(), FT_Pos, FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES, FT_SUBGLYPH_FLAG_USE_MY_METRICS, CFF_Builder_::glyph, CFF_Decoder_::glyph_width, FT_GlyphSlotRec_::internal, CFF_Builder_::left_bearing, CFF_Builder_::loader, FT_Slot_InternalRec_::loader, CFF_Builder_::no_recurse, FT_GlyphSlotRec_::num_subglyphs, CFF_Builder_::pos_x, CFF_Builder_::pos_y, CFF_Decoder_::seac, FT_GlyphSlotRec_::subglyphs, TRUE, FT_Vector_::x, and FT_Vector_::y.

Referenced by cff_decoder_parse_charstrings().

cff_slot_load ( CFF_GlyphSlot  glyph,
CFF_Size  size,
FT_UInt  glyph_index,
FT_Int32  load_flags 
)

Definition at line 2552 of file cffgload.c.

References CFF_Builder_::advance, CFF_Decoder_::builder, cff_builder_done(), cff_charset_cid_to_gindex(), cff_decoder_init(), cff_decoder_parse_charstrings(), cff_decoder_prepare(), cff_fd_select_get(), cff_free_glyph_data(), cff_get_glyph_data(), CFF_FontRec_::charset, CFF_FontRec_::charstrings_index, CFF_FontRecDictRec_::cid_registry, CFF_CharsetRec_::cids, FALSE, CFF_FontRec_::fd_select, CFF_SubFontRec_::font_dict, CFF_FontRecDictRec_::font_matrix, CFF_FontRecDictRec_::font_offset, FT_Bool, FT_BOOL, FT_GLYPH_FORMAT_BITMAP, FT_GLYPH_FORMAT_OUTLINE, FT_LOAD_ADVANCE_ONLY, FT_LOAD_NO_BITMAP, FT_LOAD_NO_HINTING, FT_LOAD_NO_RECURSE, FT_LOAD_NO_SCALE, FT_LOAD_SBITS_ONLY, FT_LOAD_TARGET_MODE, FT_LOAD_VERTICAL_LAYOUT, FT_MulDiv(), FT_MulFix(), FT_Outline_Get_CBox(), FT_OUTLINE_HIGH_PRECISION, FT_OUTLINE_REVERSE_FILL, FT_Outline_Transform(), FT_Outline_Translate(), FT_Pos, ft_synthesize_vertical_metrics(), FT_Vector_Transform(), FT_Slot_InternalRec_::glyph_delta, FT_Slot_InternalRec_::glyph_matrix, FT_Slot_InternalRec_::glyph_transformed, CFF_Decoder_::glyph_width, CFF_Builder_::hints_funcs, RooFitShortHand::L(), CFF_Builder_::left_bearing, metrics(), n, FT_Outline_::n_points, CFF_Builder_::no_recurse, CFF_FontRec_::num_glyphs, CFF_FontRec_::num_subfonts, FT_Outline_::points, TT_FaceRec_::root, TT_FaceRec_::sfnt, PC3::stream(), FT_FaceRec_::stream, CFF_FontRec_::subfonts, CFF_FontRec_::top_font, TRUE, CFF_FontRecDictRec_::units_per_em, CFF_Decoder_::width_only, FT_Vector_::x, x10000L, FT_BBox_::xMax, FT_BBox_::xMin, FT_Matrix_::xx, FT_Matrix_::xy, FT_Vector_::y, FT_BBox_::yMax, FT_BBox_::yMin, FT_Matrix_::yx, and FT_Matrix_::yy.

Referenced by Load_Glyph().

static FT_Error check_points ( CFF_Builder builder,
FT_Int  count 
) [static]

Definition at line 467 of file cffgload.c.

References check_points, FT_GLYPHLOADER_CHECK_POINTS, and CFF_Builder_::loader.


Variable Documentation

const FT_Byte cff_argument_counts[] [static]

Definition at line 137 of file cffgload.c.

Referenced by cff_decoder_parse_charstrings().


Generated on Tue Jul 5 15:58:23 2011 for ROOT_528-00b_version by  doxygen 1.5.1