zenilib: zenilib/jni/external/freetype2/src/cff/cffload.c File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Functions | Variables
cffload.c File Reference
`#include <ft2build.h>`
`#include <FT_INTERNAL_DEBUG_H>`
`#include <FT_INTERNAL_OBJECTS_H>`
`#include <FT_INTERNAL_STREAM_H>`
`#include <FT_TRUETYPE_TAGS_H>`
`#include <FT_TYPE1_TABLES_H>`
`#include "cffload.h"`
`#include "cffparse.h"`
`#include "cfferrs.h"`

Go to the source code of this file.

## Macros

#define | FT_COMPONENT trace_cffload
#define | FT_STRUCTURE CFF_FontRec

## Functions

| cff_charset_cid_to_gindex (CFF_Charset charset, FT_UInt cid)
static FT_Error | cff_charset_compute_cids (CFF_Charset charset, FT_UInt num_glyphs, FT_Memory memory)
static void | cff_charset_done (CFF_Charset charset, FT_Stream stream)
static void | cff_charset_free_cids (CFF_Charset charset, FT_Memory memory)
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_Done_FD_Select (CFF_FDSelect fdselect, FT_Stream stream)
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)
| cff_fd_select_get (CFF_FDSelect fdselect, FT_UInt glyph_index)
| cff_font_done (CFF_Font font)
| cff_font_load (FT_Library library, FT_Stream stream, FT_Int face_index, CFF_Font font, FT_Bool pure_cff)
| cff_get_standard_encoding (FT_UInt charcode)
| cff_index_access_element (CFF_Index idx, FT_UInt element, FT_Byte **pbytes, FT_ULong *pbyte_len)
static void | cff_index_done (CFF_Index idx)
| cff_index_forget_element (CFF_Index idx, FT_Byte **pbytes)
| cff_index_get_name (CFF_Font font, FT_UInt element)
static FT_Error | cff_index_get_pointers (CFF_Index idx, FT_Byte ***table, FT_Byte **pool)
| cff_index_get_sid_string (CFF_Font font, FT_UInt sid)
| cff_index_get_string (CFF_Font font, FT_UInt element)
static FT_Error | cff_index_init (CFF_Index idx, FT_Stream stream, FT_Bool load)
static FT_Error | cff_index_load_offsets (CFF_Index idx)
static FT_ULong | cff_index_read_offset (CFF_Index idx, FT_Error *errorp)
static FT_Error | CFF_Load_FD_Select (CFF_FDSelect fdselect, FT_UInt num_glyphs, FT_Stream stream, FT_ULong offset)
static void | cff_subfont_done (FT_Memory memory, CFF_SubFont subfont)
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)

## Variables

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

## Macro Definition Documentation

#define FT_COMPONENT trace_cffload

Definition at line 197 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 816 of file cffload.c.

Referenced by cff_encoding_load(), and cff_slot_load().

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

static

Definition at line 779 of file cffload.c.

References CFF_CharsetRec_::cids, error, FT_NEW_ARRAY, i, j, CFF_CharsetRec_::max_cid, CFF_CharsetRec_::num_glyphs, and CFF_CharsetRec_::sids.

Referenced by cff_charset_load(), and cff_encoding_load().

static void cff_charset_done | ( | CFF_Charset | charset,
|  | FT_Stream | stream
| ) |  |

static

Definition at line 839 of file cffload.c.

References cff_charset_free_cids(), CFF_CharsetRec_::format, FT_FREE, FT_StreamRec_::memory, CFF_CharsetRec_::offset, and CFF_CharsetRec_::sids.

Referenced by cff_font_done().

static void cff_charset_free_cids | ( | CFF_Charset | charset,
|  | FT_Memory | memory
| ) |  |

static

Definition at line 830 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 854 of file cffload.c.

References cff_charset_compute_cids(), cff_expert_charset, cff_expertsubset_charset, cff_isoadobe_charset, CFF_CharsetRec_::cids, error, CFF_CharsetRec_::format, FT_ARRAY_COPY, FT_ERROR, FT_FRAME_ENTER, FT_FRAME_EXIT, FT_FREE, FT_GET_USHORT, FT_NEW_ARRAY, FT_READ_BYTE, FT_READ_USHORT, FT_STREAM_SEEK, i, j, FT_StreamRec_::memory, CFF_CharsetRec_::offset, and CFF_CharsetRec_::sids.

Referenced by cff_font_load().

static void CFF_Done_FD_Select | ( | CFF_FDSelect | fdselect,
|  | FT_Stream | stream
| ) |  |

static

Definition at line 651 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 1044 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 1053 of file cffload.c.

References cff_charset_cid_to_gindex(), cff_charset_compute_cids(), cff_expert_encoding, cff_standard_encoding, CFF_EncodingRec_::codes, CFF_EncodingRec_::count, FT_StreamRec_::cursor, error, for(), CFF_EncodingRec_::format, FT_ARRAY_COPY, FT_ERROR, FT_FRAME_ENTER, FT_FRAME_EXIT, FT_READ_BYTE, FT_READ_USHORT, FT_STREAM_SEEK, i, j, k, FT_StreamRec_::memory, CFF_EncodingRec_::offset, sid, CFF_EncodingRec_::sids, and CFF_CharsetRec_::sids.

Referenced by cff_font_load().

cff_fd_select_get | ( | CFF_FDSelect | fdselect,
|  | FT_UInt | glyph_index
| ) |  |

Definition at line 708 of file cffload.c.

References FT_NEXT_USHORT.

Referenced by cff_decoder_prepare(), and cff_slot_load().

cff_font_done | ( | CFF_Font | font | ) |

Definition at line 1628 of file cffload.c.

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

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 1418 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_TRACE4, FT_ZERO, idx, and NULL.

Referenced by cff_face_init().

cff_get_standard_encoding | ( | FT_UInt | charcode | ) |

Definition at line 183 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 469 of file cffload.c.

References cff_index_read_offset(), error, FT_ERROR, FT_FRAME_EXTRACT, FT_STREAM_SEEK, and FT_StreamRec_::size.

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 301 of file cffload.c.

References FT_FRAME_RELEASE, FT_FREE, FT_MEM_ZERO, and FT_StreamRec_::memory.

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 567 of file cffload.c.

References FT_FRAME_RELEASE.

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

cff_index_get_name | ( | CFF_Font | font,
|  | FT_UInt | element
| ) |  |

Definition at line 582 of file cffload.c.

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

Referenced by cff_face_init(), and cff_font_load().

static FT_Error cff_index_get_pointers | ( | CFF_Index | idx,
|  | FT_Byte *** | table,
|  | FT_Byte ** | pool
| ) |  |

static

Definition at line 383 of file cffload.c.

References cff_index_load_offsets(), error, FT_ALLOC, FT_MEM_COPY, FT_NEW_ARRAY, FT_TRACE0, and NULL.

Referenced by cff_font_load(), and cff_subfont_load().

cff_index_get_sid_string | ( | CFF_Font | font,
|  | FT_UInt | sid
| ) |  |

Definition at line 621 of file cffload.c.

References cff_index_get_string(), and NULL.

cff_index_get_string | ( | CFF_Font | font,
|  | FT_UInt | element
| ) |  |

Definition at line 611 of file cffload.c.

References NULL.

Referenced by cff_get_name_index(), and cff_index_get_sid_string().

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

static

Definition at line 226 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, and FT_StreamRec_::memory.

Referenced by cff_font_load(), and cff_subfont_load().

static FT_Error cff_index_load_offsets | ( | CFF_Index | idx | ) |

static

Definition at line 319 of file cffload.c.

References FT_StreamRec_::cursor, error, FT_FRAME_ENTER, FT_FRAME_EXIT, FT_FREE, FT_NEW_ARRAY, FT_PEEK_OFF3, FT_PEEK_ULONG, FT_PEEK_USHORT, FT_STREAM_SEEK, FT_StreamRec_::memory, NULL, and switch().

Referenced by cff_index_get_pointers().

static FT_ULong cff_index_read_offset | ( | CFF_Index | idx,
|  | FT_Error * | errorp
| ) |  |

static

Definition at line 202 of file cffload.c.

References error, and FT_STREAM_READ.

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 664 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 1406 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 1296 of file cffload.c.

References CFF_PrivateRec_::blue_fuzz, CFF_PrivateRec_::blue_scale, CFF_PrivateRec_::blue_shift, 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(), CFF_FontRecDictRec_::charstring_type, CFF_FontRecDictRec_::cid_count, CFF_FontRecDictRec_::cid_font_name, CFF_FontRecDictRec_::cid_ordering, CFF_FontRecDictRec_::cid_registry, CFF_FontRecDictRec_::copyright, FT_StreamRec_::cursor, CFF_FontRecDictRec_::embedded_postscript, error, CFF_PrivateRec_::expansion_factor, CFF_FontRecDictRec_::family_name, CFF_SubFontRec_::font_dict, CFF_FontRecDictRec_::font_matrix, FT_FRAME_ENTER, FT_FRAME_EXIT, FT_MEM_ZERO, FT_STREAM_SEEK, FT_TRACE4, CFF_FontRecDictRec_::full_name, CFF_PrivateRec_::lenIV, FT_StreamRec_::limit, CFF_SubFontRec_::local_subrs, CFF_SubFontRec_::local_subrs_index, CFF_PrivateRec_::local_subrs_offset, CFF_FontRecDictRec_::notice, NULL, CFF_PrivateRec_::num_blue_values, CFF_SubFontRec_::private_dict, CFF_FontRecDictRec_::private_offset, CFF_FontRecDictRec_::private_size, CFF_FontRecDictRec_::underline_position, CFF_FontRecDictRec_::underline_thickness, CFF_FontRecDictRec_::version, CFF_FontRecDictRec_::weight, FT_Matrix_::xx, and FT_Matrix_::yy.

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 67 of file cffload.c.

Referenced by cff_charset_load().

const FT_UShort cff_expert_encoding[256]

static

Definition at line 143 of file cffload.c.

Referenced by cff_encoding_load().

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 92 of file cffload.c.

Referenced by cff_charset_load().

const FT_UShort cff_isoadobe_charset[229]

static

Definition at line 34 of file cffload.c.

Referenced by cff_charset_load().

const FT_UShort cff_standard_encoding[256]

static

Definition at line 107 of file cffload.c.

Referenced by cff_encoding_load(), and cff_get_standard_encoding().