cffload.c File Reference

#include <ft2build.h>
#include "cffload.h"
#include "cffparse.h"
#include "cfferrs.h"

Go to the source code of this file.

Defines

#define FT_COMPONENT   trace_cffload
#define FT_STRUCTURE   CFF_FontRec

Functions

 cff_get_standard_encoding (FT_UInt charcode)
static FT_ULong cff_index_read_offset (CFF_Index idx, FT_Error *errorp)
static FT_Error cff_index_init (CFF_Index idx, FT_Stream stream, FT_Bool load)
static void cff_index_done (CFF_Index idx)
static FT_Error cff_index_load_offsets (CFF_Index idx)
static FT_Error cff_index_get_pointers (CFF_Index idx, FT_Byte ***table)
 cff_index_access_element (CFF_Index idx, FT_UInt element, FT_Byte **pbytes, FT_ULong *pbyte_len)
 cff_index_forget_element (CFF_Index idx, FT_Byte **pbytes)
 cff_index_get_name (CFF_Index idx, FT_UInt element)
 cff_index_get_sid_string (CFF_Index idx, FT_UInt sid, FT_Service_PsCMaps psnames)
static void CFF_Done_FD_Select (CFF_FDSelect fdselect, FT_Stream stream)
static FT_Error CFF_Load_FD_Select (CFF_FDSelect fdselect, FT_UInt num_glyphs, FT_Stream stream, FT_ULong offset)
 cff_fd_select_get (CFF_FDSelect fdselect, FT_UInt glyph_index)
static FT_Error cff_charset_compute_cids (CFF_Charset charset, FT_UInt num_glyphs, FT_Memory memory)
 cff_charset_cid_to_gindex (CFF_Charset charset, FT_UInt cid)
static void cff_charset_free_cids (CFF_Charset charset, FT_Memory memory)
static void cff_charset_done (CFF_Charset charset, FT_Stream stream)
static FT_Error cff_charset_load (CFF_Charset charset, FT_UInt num_glyphs, FT_Stream stream, FT_ULong base_offset, FT_ULong offset, FT_Bool invert)
static void cff_encoding_done (CFF_Encoding encoding)
static FT_Error cff_encoding_load (CFF_Encoding encoding, CFF_Charset charset, FT_UInt num_glyphs, FT_Stream stream, FT_ULong base_offset, FT_ULong offset)
static FT_Error cff_subfont_load (CFF_SubFont font, CFF_Index idx, FT_UInt font_index, FT_Stream stream, FT_ULong base_offset, FT_Library library)
static void cff_subfont_done (FT_Memory memory, CFF_SubFont subfont)
 cff_font_load (FT_Library library, FT_Stream stream, FT_Int face_index, CFF_Font font, FT_Bool pure_cff)
 cff_font_done (CFF_Font font)

Variables

static const FT_UShort cff_isoadobe_charset [229]
static const FT_UShort cff_expert_charset [166]
static const FT_UShort cff_expertsubset_charset [87]
static const FT_UShort cff_standard_encoding [256]
static const FT_UShort cff_expert_encoding [256]


Define Documentation

#define FT_COMPONENT   trace_cffload

Definition at line 198 of file cffload.c.

#define FT_STRUCTURE   CFF_FontRec


Function Documentation

cff_charset_cid_to_gindex ( CFF_Charset  charset,
FT_UInt  cid 
)

Definition at line 769 of file cffload.c.

References result().

Referenced by cff_slot_load().

static FT_Error cff_charset_compute_cids ( CFF_Charset  charset,
FT_UInt  num_glyphs,
FT_Memory  memory 
) [static]

Definition at line 733 of file cffload.c.

References CFF_CharsetRec_::cids, error, for(), FT_NEW_ARRAY, i, if(), j, CFF_CharsetRec_::max_cid, CFF_CharsetRec_::num_glyphs, and CFF_CharsetRec_::sids.

static void cff_charset_done ( CFF_Charset  charset,
FT_Stream  stream 
) [static]

Definition at line 792 of file cffload.c.

References cff_charset_free_cids(), CFF_CharsetRec_::format, FT_FREE, CFF_CharsetRec_::offset, CFF_CharsetRec_::sids, and PC3::stream().

Referenced by cff_font_done().

static void cff_charset_free_cids ( CFF_Charset  charset,
FT_Memory  memory 
) [static]

Definition at line 783 of file cffload.c.

References CFF_CharsetRec_::cids, FT_FREE, and CFF_CharsetRec_::max_cid.

Referenced by cff_charset_done().

static FT_Error cff_charset_load ( CFF_Charset  charset,
FT_UInt  num_glyphs,
FT_Stream  stream,
FT_ULong  base_offset,
FT_ULong  offset,
FT_Bool  invert 
) [static]

Definition at line 807 of file cffload.c.

References error, CFF_CharsetRec_::format, FT_ERROR, FT_FRAME_ENTER, FT_FRAME_EXIT, FT_GET_USHORT, FT_NEW_ARRAY, FT_READ_BYTE, FT_READ_USHORT, FT_STREAM_SEEK, FT_TRACE0, i, j, RooFitShortHand::L(), CFF_CharsetRec_::offset, CFF_CharsetRec_::sids, and PC3::stream().

Referenced by cff_font_load().

static void CFF_Done_FD_Select ( CFF_FDSelect  fdselect,
FT_Stream  stream 
) [static]

Definition at line 605 of file cffload.c.

References CFF_FDSelectRec_::data, CFF_FDSelectRec_::data_size, CFF_FDSelectRec_::format, FT_FRAME_RELEASE, and CFF_FDSelectRec_::range_count.

Referenced by cff_font_done().

static void cff_encoding_done ( CFF_Encoding  encoding  )  [static]

Definition at line 1016 of file cffload.c.

References CFF_EncodingRec_::count, CFF_EncodingRec_::format, and CFF_EncodingRec_::offset.

Referenced by cff_font_done().

static FT_Error cff_encoding_load ( CFF_Encoding  encoding,
CFF_Charset  charset,
FT_UInt  num_glyphs,
FT_Stream  stream,
FT_ULong  base_offset,
FT_ULong  offset 
) [static]

Definition at line 1025 of file cffload.c.

References CFF_EncodingRec_::codes, CFF_EncodingRec_::count, error, for(), CFF_EncodingRec_::format, FT_ERROR, FT_FRAME_ENTER, FT_FRAME_EXIT, FT_READ_BYTE, FT_STREAM_SEEK, i, if(), j, k, CFF_EncodingRec_::offset, p, CFF_EncodingRec_::sids, CFF_CharsetRec_::sids, and PC3::stream().

Referenced by cff_font_load().

cff_fd_select_get ( CFF_FDSelect  fdselect,
FT_UInt  glyph_index 
)

Definition at line 662 of file cffload.c.

References FT_NEXT_USHORT, and p.

Referenced by cff_decoder_prepare(), and cff_slot_load().

cff_font_done ( CFF_Font  font  ) 

Definition at line 1590 of file cffload.c.

References cff_charset_done(), CFF_Done_FD_Select(), cff_encoding_done(), cff_index_done(), cff_subfont_done(), FT_FREE, and NULL.

Referenced by cff_face_done().

cff_font_load ( FT_Library  library,
FT_Stream  stream,
FT_Int  face_index,
CFF_Font  font,
FT_Bool  pure_cff 
)

Definition at line 1389 of file cffload.c.

References cff_charset_load(), cff_encoding_load(), cff_index_done(), cff_index_get_name(), cff_index_get_pointers(), cff_index_init(), CFF_Load_FD_Select(), CFF_MAX_CID_FONTS, cff_subfont_load(), CFF_FontRecDictRec_::charset_offset, CFF_FontRecDictRec_::charstrings_offset, CFF_FontRecDictRec_::cid_fd_array_offset, CFF_FontRecDictRec_::cid_fd_select_offset, CFF_FontRecDictRec_::cid_registry, CFF_FontRecDictRec_::encoding_offset, error, for(), FT_Bool, FT_BOOL, FT_ERROR, FT_FRAME_BYTE, FT_FRAME_END, FT_FRAME_START, FT_NEW_ARRAY, FT_SET_ERROR, FT_STREAM_POS, FT_STREAM_READ_FIELDS, FT_STREAM_SEEK, FT_STREAM_SKIP, FT_TRACE0, FT_TRACE2, FT_ZERO, and invert.

Referenced by cff_face_init().

cff_get_standard_encoding ( FT_UInt  charcode  ) 

Definition at line 184 of file cffload.c.

References cff_standard_encoding.

Referenced by cff_lookup_glyph_by_stdcharcode().

cff_index_access_element ( CFF_Index  idx,
FT_UInt  element,
FT_Byte **  pbytes,
FT_ULong pbyte_len 
)

Definition at line 430 of file cffload.c.

References cff_index_read_offset(), error, FT_FRAME_EXTRACT, FT_STREAM_SEEK, and PC3::stream().

Referenced by cff_get_glyph_data(), cff_index_get_name(), and cff_subfont_load().

static void cff_index_done ( CFF_Index  idx  )  [static]

Definition at line 302 of file cffload.c.

References FT_FRAME_RELEASE, FT_FREE, FT_MEM_ZERO, and PC3::stream().

Referenced by cff_font_done(), cff_font_load(), and cff_subfont_done().

cff_index_forget_element ( CFF_Index  idx,
FT_Byte **  pbytes 
)

Definition at line 516 of file cffload.c.

References FT_FRAME_RELEASE, and PC3::stream().

Referenced by cff_free_glyph_data(), cff_index_get_name(), and cff_subfont_load().

cff_index_get_name ( CFF_Index  idx,
FT_UInt  element 
)

Definition at line 530 of file cffload.c.

References cff_index_access_element(), cff_index_forget_element(), error, FT_ALLOC, FT_MEM_COPY, and name.

Referenced by cff_face_init(), cff_font_load(), cff_get_name_index(), and cff_index_get_sid_string().

static FT_Error cff_index_get_pointers ( CFF_Index  idx,
FT_Byte ***  table 
) [static]

Definition at line 382 of file cffload.c.

References cff_index_load_offsets(), error, FT_NEW_ARRAY, if(), n, NULL, and t.

Referenced by cff_font_load(), and cff_subfont_load().

cff_index_get_sid_string ( CFF_Index  idx,
FT_UInt  sid,
FT_Service_PsCMaps  psnames 
)

Definition at line 557 of file cffload.c.

References cff_index_get_name(), error, FT_STRDUP, FT_UNUSED, name, and void.

Referenced by cff_face_init(), cff_get_glyph_name(), and cff_ps_get_font_info().

static FT_Error cff_index_init ( CFF_Index  idx,
FT_Stream  stream,
FT_Bool  load 
) [static]

Definition at line 227 of file cffload.c.

References cff_index_read_offset(), error, FT_FRAME_EXTRACT, FT_FREE, FT_MEM_ZERO, FT_READ_BYTE, FT_READ_USHORT, FT_STREAM_POS, FT_STREAM_SKIP, size, and PC3::stream().

Referenced by cff_font_load(), and cff_subfont_load().

static FT_Error cff_index_load_offsets ( CFF_Index  idx  )  [static]

Definition at line 320 of file cffload.c.

References error, FT_FRAME_ENTER, FT_FRAME_EXIT, FT_FREE, FT_NEW_ARRAY, FT_PEEK_OFF3, FT_PEEK_ULONG, FT_PEEK_USHORT, FT_STREAM_SEEK, NULL, p, and PC3::stream().

Referenced by cff_index_get_pointers().

static FT_ULong cff_index_read_offset ( CFF_Index  idx,
FT_Error errorp 
) [static]

Definition at line 203 of file cffload.c.

References error, FT_STREAM_READ, result(), and PC3::stream().

Referenced by cff_index_access_element(), and cff_index_init().

static FT_Error CFF_Load_FD_Select ( CFF_FDSelect  fdselect,
FT_UInt  num_glyphs,
FT_Stream  stream,
FT_ULong  offset 
) [static]

Definition at line 618 of file cffload.c.

References CFF_FDSelectRec_::cache_count, CFF_FDSelectRec_::data, CFF_FDSelectRec_::data_size, error, CFF_FDSelectRec_::format, FT_FRAME_EXTRACT, FT_READ_BYTE, FT_READ_USHORT, and FT_STREAM_SEEK.

Referenced by cff_font_load().

static void cff_subfont_done ( FT_Memory  memory,
CFF_SubFont  subfont 
) [static]

Definition at line 1377 of file cffload.c.

References cff_index_done(), FT_FREE, CFF_SubFontRec_::local_subrs, and CFF_SubFontRec_::local_subrs_index.

Referenced by cff_font_done().

static FT_Error cff_subfont_load ( CFF_SubFont  font,
CFF_Index  idx,
FT_UInt  font_index,
FT_Stream  stream,
FT_ULong  base_offset,
FT_Library  library 
) [static]

Definition at line 1270 of file cffload.c.

References CFF_CODE_PRIVATE, CFF_CODE_TOPDICT, cff_index_access_element(), cff_index_forget_element(), cff_index_get_pointers(), cff_index_init(), cff_parser_init(), cff_parser_run(), error, CFF_SubFontRec_::font_dict, FT_FRAME_ENTER, FT_FRAME_EXIT, FT_MEM_ZERO, FT_STREAM_SEEK, RooFitShortHand::L(), CFF_SubFontRec_::local_subrs, CFF_SubFontRec_::local_subrs_index, CFF_PrivateRec_::local_subrs_offset, NULL, CFF_SubFontRec_::num_local_subrs, CFF_SubFontRec_::private_dict, CFF_FontRecDictRec_::private_offset, CFF_FontRecDictRec_::private_size, PC3::stream(), top(), and x10000L.

Referenced by cff_font_load().


Variable Documentation

const FT_UShort cff_expert_charset[166] [static]

Initial value:

  {
      0,   1, 229, 230, 231, 232, 233, 234,
    235, 236, 237, 238,  13,  14,  15,  99,
    239, 240, 241, 242, 243, 244, 245, 246,
    247, 248,  27,  28, 249, 250, 251, 252,
    253, 254, 255, 256, 257, 258, 259, 260,
    261, 262, 263, 264, 265, 266, 109, 110,
    267, 268, 269, 270, 271, 272, 273, 274,
    275, 276, 277, 278, 279, 280, 281, 282,
    283, 284, 285, 286, 287, 288, 289, 290,
    291, 292, 293, 294, 295, 296, 297, 298,
    299, 300, 301, 302, 303, 304, 305, 306,
    307, 308, 309, 310, 311, 312, 313, 314,
    315, 316, 317, 318, 158, 155, 163, 319,
    320, 321, 322, 323, 324, 325, 326, 150,
    164, 169, 327, 328, 329, 330, 331, 332,
    333, 334, 335, 336, 337, 338, 339, 340,
    341, 342, 343, 344, 345, 346, 347, 348,
    349, 350, 351, 352, 353, 354, 355, 356,
    357, 358, 359, 360, 361, 362, 363, 364,
    365, 366, 367, 368, 369, 370, 371, 372,
    373, 374, 375, 376, 377, 378
  }

Definition at line 68 of file cffload.c.

const FT_UShort cff_expert_encoding[256] [static]

Definition at line 144 of file cffload.c.

const FT_UShort cff_expertsubset_charset[87] [static]

Initial value:

  {
      0,   1, 231, 232, 235, 236, 237, 238,
     13,  14,  15,  99, 239, 240, 241, 242,
    243, 244, 245, 246, 247, 248,  27,  28,
    249, 250, 251, 253, 254, 255, 256, 257,
    258, 259, 260, 261, 262, 263, 264, 265,
    266, 109, 110, 267, 268, 269, 270, 272,
    300, 301, 302, 305, 314, 315, 158, 155,
    163, 320, 321, 322, 323, 324, 325, 326,
    150, 164, 169, 327, 328, 329, 330, 331,
    332, 333, 334, 335, 336, 337, 338, 339,
    340, 341, 342, 343, 344, 345, 346
  }

Definition at line 93 of file cffload.c.

const FT_UShort cff_isoadobe_charset[229] [static]

Definition at line 35 of file cffload.c.

const FT_UShort cff_standard_encoding[256] [static]

Definition at line 108 of file cffload.c.

Referenced by cff_get_standard_encoding().


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