zenilib: zenilib/jni/external/freetype2/src/cff/cffparse.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
cffparse.c File Reference
`#include <ft2build.h>`
`#include "cffparse.h"`
`#include <FT_INTERNAL_STREAM_H>`
`#include <FT_INTERNAL_DEBUG_H>`
`#include "cfferrs.h"`
`#include "cffpic.h"`
`#include "cfftoken.h"`

Go to the source code of this file.

## Macros

#define | CFF_FIELD(code, name, id, kind)
#define | CFF_FIELD_BOOL(code, name, id) CFF_FIELD( code, name, id, cff_kind_bool )
#define | CFF_FIELD_CALLBACK(code, name, id)
#define | CFF_FIELD_DELTA(code, name, max, id)
#define | CFF_FIELD_FIXED(code, name, id) CFF_FIELD( code, name, id, cff_kind_fixed )
#define | CFF_FIELD_FIXED_1000(code, name, id) CFF_FIELD( code, name, id, cff_kind_fixed_thousand )
#define | CFF_FIELD_NUM(code, name, id) CFF_FIELD( code, name, id, cff_kind_num )
#define | CFF_FIELD_STRING(code, name, id) CFF_FIELD( code, name, id, cff_kind_string )
#define | CFFCODE_PRIVATE 0x2000
#define | CFFCODE_TOPDICT 0x1000
#define | FT_COMPONENT trace_cffparse

## Functions

static FT_Error | cff_parse_cid_ros (CFF_Parser parser)
static FT_Fixed | cff_parse_fixed (FT_Byte **d)
static FT_Fixed | cff_parse_fixed_dynamic (FT_Byte **d, FT_Long *scaling)
static FT_Fixed | cff_parse_fixed_scaled (FT_Byte **d, FT_Long scaling)
static FT_Error | cff_parse_font_bbox (CFF_Parser parser)
static FT_Error | cff_parse_font_matrix (CFF_Parser parser)
static FT_Long | cff_parse_integer (FT_Byte *start, FT_Byte *limit)
static FT_Long | cff_parse_num (FT_Byte **d)
static FT_Error | cff_parse_private_dict (CFF_Parser parser)
static FT_Fixed | cff_parse_real (FT_Byte *start, FT_Byte *limit, FT_Long power_ten, FT_Long *scaling)
| cff_parser_init (CFF_Parser parser, FT_UInt code, void *object, FT_Library library)
| cff_parser_run (CFF_Parser parser, FT_Byte *start, FT_Byte *limit)

## Variables

static const CFF_Field_Handler | cff_field_handlers []
static const FT_Long | power_tens []

## Macro Definition Documentation

#define CFF_FIELD | ( |  | code,
|  |  | name,
|  |  | id,
|  |  | kind
| ) |  |

Value:
{ \
kind, \
code | CFFCODE, \
FT_FIELD_OFFSET( name ), \
FT_FIELD_SIZE( name ), \
0, 0, 0 \
},
FT_FIELD_OFFSET
#define FT_FIELD_OFFSET(f)
Definition: ftstream.h:105
FT_FIELD_SIZE
#define FT_FIELD_SIZE(f)
Definition: ftstream.h:99
name
EGLImageKHR EGLint * name
Definition: eglext.h:284
CFFCODE
#define CFFCODE

Definition at line 637 of file cffparse.c.

#define CFF_FIELD_BOOL | ( |  | code,
|  |  | name,
|  |  | id
| ) |  | CFF_FIELD( code, name, id, cff_kind_bool )

Definition at line 611 of file cffparse.c.

#define CFF_FIELD_CALLBACK | ( |  | code,
|  |  | name,
|  |  | id
| ) |  |

Value:
{ \
cff_kind_callback, \
code | CFFCODE, \
0, 0, \
cff_parse_ ## name, \
0, 0 \
},
name
EGLImageKHR EGLint * name
Definition: eglext.h:284
CFFCODE
#define CFFCODE
cff_kind_callback
Definition: cffparse.h:74

Definition at line 628 of file cffparse.c.

#define CFF_FIELD_DELTA | ( |  | code,
|  |  | name,
|  |  | max,
|  |  | id
| ) |  |

Value:
{ \
cff_kind_delta, \
code | CFFCODE, \
FT_FIELD_OFFSET( name ), \
FT_FIELD_SIZE_DELTA( name ), \
0, \
max, \
FT_FIELD_OFFSET( num_ ## name ) \
},
FT_FIELD_SIZE_DELTA
#define FT_FIELD_SIZE_DELTA(f)
Definition: ftstream.h:102
FT_FIELD_OFFSET
#define FT_FIELD_OFFSET(f)
Definition: ftstream.h:105
cff_kind_delta
Definition: cffparse.h:73
name
EGLImageKHR EGLint * name
Definition: eglext.h:284
CFFCODE
#define CFFCODE
max
#define max(x, y)
Definition: os.h:79

Definition at line 646 of file cffparse.c.

#define CFF_FIELD_FIXED | ( |  | code,
|  |  | name,
|  |  | id
| ) |  | CFF_FIELD( code, name, id, cff_kind_fixed )

Definition at line 605 of file cffparse.c.

#define CFF_FIELD_FIXED_1000 | ( |  | code,
|  |  | name,
|  |  | id
| ) |  | CFF_FIELD( code, name, id, cff_kind_fixed_thousand )

Definition at line 607 of file cffparse.c.

#define CFF_FIELD_NUM | ( |  | code,
|  |  | name,
|  |  | id
| ) |  | CFF_FIELD( code, name, id, cff_kind_num )

Definition at line 603 of file cffparse.c.

#define CFF_FIELD_STRING | ( |  | code,
|  |  | name,
|  |  | id
| ) |  | CFF_FIELD( code, name, id, cff_kind_string )

Definition at line 609 of file cffparse.c.

#define CFFCODE_PRIVATE 0x2000

Definition at line 615 of file cffparse.c.

#define CFFCODE_TOPDICT 0x1000

Definition at line 614 of file cffparse.c.

#define FT_COMPONENT trace_cffparse

Definition at line 35 of file cffparse.c.

## Function Documentation

static FT_Error cff_parse_cid_ros | ( | CFF_Parser | parser | ) |

static

Definition at line 572 of file cffparse.c.

References cff_parse_num(), CFF_FontRecDictRec_::cid_ordering, CFF_FontRecDictRec_::cid_registry, CFF_FontRecDictRec_::cid_supplement, error, FT_TRACE1, FT_TRACE4, if(), CFF_ParserRec_::object, CFF_ParserRec_::stack, and CFF_ParserRec_::top.

static FT_Fixed cff_parse_fixed | ( | FT_Byte ** | d | ) |

static

Definition at line 381 of file cffparse.c.

References cff_parse_integer(), cff_parse_real(), and NULL.

Referenced by cff_parse_font_bbox(), and cff_parser_run().

static FT_Fixed cff_parse_fixed_dynamic | ( | FT_Byte ** | d,
|  | FT_Long * | scaling
| ) |  |

static

Definition at line 404 of file cffparse.c.

References cff_parse_integer(), cff_parse_real(), FT_ASSERT, FT_DivFix(), and power_tens.

Referenced by cff_parse_font_matrix().

static FT_Fixed cff_parse_fixed_scaled | ( | FT_Byte ** | d,
|  | FT_Long | scaling
| ) |  |

static

Definition at line 391 of file cffparse.c.

References cff_parse_integer(), cff_parse_real(), NULL, and power_tens.

Referenced by cff_parse_font_matrix(), and cff_parser_run().

static FT_Error cff_parse_font_bbox | ( | CFF_Parser | parser | ) |

static

Definition at line 518 of file cffparse.c.

References bbox, cff_parse_fixed(), error, CFF_FontRecDictRec_::font_bbox, FT_RoundFix(), FT_TRACE4, if(), CFF_ParserRec_::object, CFF_ParserRec_::stack, CFF_ParserRec_::top, FT_BBox_::xMax, FT_BBox_::xMin, FT_BBox_::yMax, and FT_BBox_::yMin.

static FT_Error cff_parse_font_matrix | ( | CFF_Parser | parser | ) |

static

Definition at line 446 of file cffparse.c.

References cff_parse_fixed_dynamic(), cff_parse_fixed_scaled(), error, CFF_FontRecDictRec_::font_matrix, CFF_FontRecDictRec_::font_offset, FT_TRACE1, FT_TRACE4, CFF_FontRecDictRec_::has_font_matrix, if(), CFF_ParserRec_::object, power_tens, CFF_ParserRec_::stack, CFF_ParserRec_::top, TRUE, and CFF_FontRecDictRec_::units_per_em.

static FT_Long cff_parse_integer | ( | FT_Byte * | start,
|  | FT_Byte * | limit
| ) |  |

static

Definition at line 55 of file cffparse.c.

Referenced by cff_parse_fixed(), cff_parse_fixed_dynamic(), cff_parse_fixed_scaled(), and cff_parse_num().

static FT_Long cff_parse_num | ( | FT_Byte ** | d | ) |

static

Definition at line 372 of file cffparse.c.

References cff_parse_integer(), cff_parse_real(), and NULL.

Referenced by cff_parse_cid_ros(), cff_parse_private_dict(), and cff_parser_run().

static FT_Error cff_parse_private_dict | ( | CFF_Parser | parser | ) |

static

Definition at line 548 of file cffparse.c.

References cff_parse_num(), error, FT_TRACE4, if(), CFF_ParserRec_::object, CFF_FontRecDictRec_::private_offset, CFF_FontRecDictRec_::private_size, CFF_ParserRec_::stack, and CFF_ParserRec_::top.

static FT_Fixed cff_parse_real | ( | FT_Byte * | start,
|  | FT_Byte * | limit,
|  | FT_Long | power_ten,
|  | FT_Long * | scaling
| ) |  |

static

Definition at line 129 of file cffparse.c.

References FT_ABS, FT_DivFix(), FT_MIN, power_tens, and sign.

Referenced by cff_parse_fixed(), cff_parse_fixed_dynamic(), cff_parse_fixed_scaled(), and cff_parse_num().

cff_parser_init | ( | CFF_Parser | parser,
|  | FT_UInt | code,
|  | void * | object,
|  | FT_Library | library
| ) |  |

Definition at line 39 of file cffparse.c.

References FT_MEM_ZERO, and library.

Referenced by cff_subfont_load().

cff_parser_run | ( | CFF_Parser | parser,
|  | FT_Byte * | start,
|  | FT_Byte * | limit
| ) |  |

Definition at line 868 of file cffparse.c.

References CFF_Field_Handler_::array_max, cff_kind_bool, cff_kind_delta, cff_kind_fixed, cff_kind_fixed_thousand, cff_kind_num, cff_kind_string, CFF_MAX_STACK_DEPTH, cff_parse_fixed(), cff_parse_fixed_scaled(), cff_parse_num(), CFF_Field_Handler_::code, CFF_Field_Handler_::count_offset, error, FT_CFF_FIELD_HANDLERS_GET, FT_CHAR_BIT, FT_TRACE4, FT_UNUSED, if(), CFF_Field_Handler_::kind, CFF_Field_Handler_::offset, CFF_Field_Handler_::reader, and CFF_Field_Handler_::size.

Referenced by cff_subfont_load().

## Variable Documentation

const CFF_Field_Handler cff_field_handlers[]

static

Definition at line 657 of file cffparse.c.

const FT_Long power_tens[]

static

Initial value:
=
{
1L,
10L,
100L,
1000L,
10000L,
100000L,
1000000L,
10000000L,
100000000L,
1000000000L
}

Definition at line 112 of file cffparse.c.

Referenced by cff_parse_fixed_dynamic(), cff_parse_fixed_scaled(), cff_parse_font_matrix(), and cff_parse_real().