zenilib: zenilib/jni/external/freetype2/src/pcf/pcfread.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
pcfread.c File Reference
`#include <ft2build.h>`
`#include <FT_INTERNAL_DEBUG_H>`
`#include <FT_INTERNAL_STREAM_H>`
`#include <FT_INTERNAL_OBJECTS_H>`
`#include "pcf.h"`
`#include "pcfread.h"`
`#include "pcferror.h"`

Go to the source code of this file.

## Macros

#define | FT_COMPONENT trace_pcfread
#define | FT_STRUCTURE PCF_TocRec
#define | FT_STRUCTURE PCF_TableRec
#define | FT_STRUCTURE PCF_MetricRec
#define | FT_STRUCTURE PCF_MetricRec
#define | FT_STRUCTURE PCF_Compressed_MetricRec
#define | FT_STRUCTURE PCF_ParsePropertyRec
#define | FT_STRUCTURE PCF_ParsePropertyRec
#define | FT_STRUCTURE PCF_AccelRec
#define | FT_STRUCTURE PCF_AccelRec
#define | PCF_COMPRESSED_METRIC_SIZE 5
#define | PCF_METRIC_SIZE 12
#define | PCF_PROPERTY_SIZE 9

## Functions

| pcf_find_property (PCF_Face face, const FT_String *prop)
static FT_Error | pcf_get_accel (FT_Stream stream, PCF_Face face, FT_ULong type)
static FT_Error | pcf_get_bitmaps (FT_Stream stream, PCF_Face face)
static FT_Error | pcf_get_encodings (FT_Stream stream, PCF_Face face)
static FT_Error | pcf_get_metric (FT_Stream stream, FT_ULong format, PCF_Metric metric)
static FT_Error | pcf_get_metrics (FT_Stream stream, PCF_Face face)
static FT_Error | pcf_get_properties (FT_Stream stream, PCF_Face face)
static FT_Bool | pcf_has_table_type (PCF_Table tables, FT_ULong ntables, FT_ULong type)
static FT_Error | pcf_interpret_style (PCF_Face pcf)
| pcf_load_font (FT_Stream stream, PCF_Face face)
static FT_Error | pcf_read_TOC (FT_Stream stream, PCF_Face face)
static FT_Error | pcf_seek_to_table_type (FT_Stream stream, PCF_Table tables, FT_ULong ntables, FT_ULong type, FT_ULong *aformat, FT_ULong *asize)

## Variables

static const FT_Frame_Field | pcf_accel_header []
static const FT_Frame_Field | pcf_accel_msb_header []
static const FT_Frame_Field | pcf_compressed_metric_header []
static const FT_Frame_Field | pcf_metric_header []
static const FT_Frame_Field | pcf_metric_msb_header []
static const FT_Frame_Field | pcf_property_header []
static const FT_Frame_Field | pcf_property_msb_header []
static const FT_Frame_Field | pcf_table_header []
static const FT_Frame_Field | pcf_toc_header []

## Macro Definition Documentation

#define FT_COMPONENT trace_pcfread

Definition at line 47 of file pcfread.c.

#define FT_STRUCTURE PCF_TocRec

#define FT_STRUCTURE PCF_TableRec

#define FT_STRUCTURE PCF_MetricRec

#define FT_STRUCTURE PCF_MetricRec

#define FT_STRUCTURE PCF_Compressed_MetricRec

#define FT_STRUCTURE PCF_ParsePropertyRec

#define FT_STRUCTURE PCF_ParsePropertyRec

#define FT_STRUCTURE PCF_AccelRec

#define FT_STRUCTURE PCF_AccelRec

#define PCF_COMPRESSED_METRIC_SIZE 5

Definition at line 228 of file pcfread.c.

Referenced by pcf_get_metrics().

#define PCF_METRIC_SIZE 12

Definition at line 192 of file pcfread.c.

Referenced by pcf_get_metrics().

#define PCF_PROPERTY_SIZE 9

Definition at line 344 of file pcfread.c.

Referenced by pcf_get_properties().

## Function Documentation

pcf_find_property | ( | PCF_Face | face,
|  | const FT_String * | prop
| ) |  |

Definition at line 375 of file pcfread.c.

References FT_Bool, ft_strcmp, i, and NULL.

Referenced by pcf_get_bdf_property(), pcf_interpret_style(), and pcf_load_font().

static FT_Error pcf_get_accel | ( | FT_Stream | stream,
|  | PCF_Face | face,
|  | FT_ULong | type
| ) |  |

static

Definition at line 921 of file pcfread.c.

References PCF_FaceRec_::accel, PCF_TocRec_::count, error, FT_READ_ULONG_LE, FT_STREAM_READ_FIELDS, PCF_AccelRec_::ink_maxbounds, PCF_AccelRec_::ink_minbounds, PCF_AccelRec_::maxbounds, PCF_AccelRec_::minbounds, MSBFirst, PCF_ACCEL_W_INKBOUNDS, PCF_BYTE_ORDER, PCF_DEFAULT_FORMAT, PCF_FORMAT_MASK, PCF_FORMAT_MATCH, pcf_get_metric(), pcf_seek_to_table_type(), PCF_TocRec_::tables, and PCF_FaceRec_::toc.

Referenced by pcf_load_font().

static FT_Error pcf_get_bitmaps | ( | FT_Stream | stream,
|  | PCF_Face | face
| ) |  |

static

Definition at line 663 of file pcfread.c.

References PCF_FaceRec_::bitmapsFormat, PCF_MetricRec_::bits, PCF_TocRec_::count, error, FT_FACE, FT_FREE, FT_GET_ULONG, FT_GET_ULONG_LE, FT_NEW_ARRAY, FT_READ_LONG, FT_READ_LONG_LE, FT_Stream_EnterFrame(), FT_Stream_ExitFrame(), FT_TRACE0, FT_TRACE4, FT_TRACE5, FT_UNUSED, GLYPHPADOPTIONS, i, PCF_FaceRec_::metrics, MSBFirst, PCF_FaceRec_::nmetrics, NULL, PCF_BITMAPS, PCF_BYTE_ORDER, PCF_DEFAULT_FORMAT, PCF_FORMAT_MATCH, PCF_GLYPH_PAD_INDEX, pcf_seek_to_table_type(), FT_StreamRec_::pos, PCF_TocRec_::tables, and PCF_FaceRec_::toc.

Referenced by pcf_load_font().

static FT_Error pcf_get_encodings | ( | FT_Stream | stream,
|  | PCF_Face | face
| ) |  |

static

Definition at line 765 of file pcfread.c.

References PCF_TocRec_::count, PCF_FaceRec_::defaultChar, PCF_EncodingRec_::enc, PCF_FaceRec_::encodings, error, FT_FACE, FT_FREE, FT_GET_SHORT, FT_GET_SHORT_LE, FT_GET_ULONG_LE, FT_NEW_ARRAY, FT_Stream_EnterFrame(), FT_Stream_ExitFrame(), FT_TRACE4, FT_TRACE5, PCF_EncodingRec_::glyph, i, j, MSBFirst, PCF_FaceRec_::nencodings, NULL, PCF_BDF_ENCODINGS, PCF_BYTE_ORDER, PCF_DEFAULT_FORMAT, PCF_FORMAT_MATCH, pcf_seek_to_table_type(), PCF_TocRec_::tables, and PCF_FaceRec_::toc.

Referenced by pcf_load_font().

static FT_Error pcf_get_metric | ( | FT_Stream | stream,
|  | FT_ULong | format,
|  | PCF_Metric | metric
| ) |  |

static

Definition at line 247 of file pcfread.c.

References PCF_Compressed_MetricRec_::ascent, PCF_MetricRec_::ascent, PCF_MetricRec_::attributes, PCF_Compressed_MetricRec_::characterWidth, PCF_MetricRec_::characterWidth, PCF_Compressed_MetricRec_::descent, PCF_MetricRec_::descent, error, FT_STREAM_READ_FIELDS, PCF_Compressed_MetricRec_::leftSideBearing, PCF_MetricRec_::leftSideBearing, MSBFirst, PCF_BYTE_ORDER, PCF_DEFAULT_FORMAT, PCF_FORMAT_MATCH, pcf_metric_header, PCF_Compressed_MetricRec_::rightSideBearing, and PCF_MetricRec_::rightSideBearing.

Referenced by pcf_get_accel(), and pcf_get_metrics().

static FT_Error pcf_get_metrics | ( | FT_Stream | stream,
|  | PCF_Face | face
| ) |  |

static

Definition at line 566 of file pcfread.c.

References PCF_MetricRec_::bits, PCF_TocRec_::count, error, FT_FACE, FT_FREE, FT_NEW_ARRAY, FT_READ_ULONG, FT_READ_ULONG_LE, FT_READ_USHORT, FT_READ_USHORT_LE, FT_TRACE4, FT_TRACE5, i, PCF_FaceRec_::metrics, MSBFirst, PCF_FaceRec_::nmetrics, PCF_BYTE_ORDER, PCF_COMPRESSED_METRIC_SIZE, PCF_COMPRESSED_METRICS, PCF_DEFAULT_FORMAT, PCF_FORMAT_MATCH, pcf_get_metric(), PCF_METRIC_SIZE, PCF_METRICS, pcf_seek_to_table_type(), PCF_TocRec_::tables, and PCF_FaceRec_::toc.

Referenced by pcf_load_font().

static FT_Error pcf_get_properties | ( | FT_Stream | stream,
|  | PCF_Face | face
| ) |  |

static

Definition at line 397 of file pcfread.c.

References PCF_PropertyRec_::atom, PCF_TocRec_::count, error, FT_FACE, FT_FREE, FT_NEW_ARRAY, FT_READ_ULONG, FT_READ_ULONG_LE, FT_STRDUP, FT_Stream_Read(), FT_STREAM_READ_FIELDS, FT_STREAM_SKIP, FT_TRACE4, i, int, PCF_ParsePropertyRec_::isString, PCF_PropertyRec_::isString, PCF_PropertyRec_::l, MSBFirst, PCF_ParsePropertyRec_::name, PCF_FaceRec_::nprops, NULL, PCF_BYTE_ORDER, PCF_DEFAULT_FORMAT, PCF_FORMAT_MATCH, PCF_PROPERTIES, PCF_PROPERTY_SIZE, pcf_seek_to_table_type(), PCF_FaceRec_::properties, PCF_TocRec_::tables, PCF_FaceRec_::toc, PCF_ParsePropertyRec_::value, and PCF_PropertyRec_::value.

Referenced by pcf_load_font().

static FT_Bool pcf_has_table_type | ( | PCF_Table | tables,
|  | FT_ULong | ntables,
|  | FT_ULong | type
| ) |  |

static

Definition at line 329 of file pcfread.c.

References FALSE, i, and TRUE.

Referenced by pcf_load_font().

static FT_Error pcf_interpret_style | ( | PCF_Face | pcf | ) |

static

Definition at line 995 of file pcfread.c.

References PCF_PropertyRec_::atom, error, FT_ALLOC, FT_FACE, ft_memcpy, ft_strlen, FT_STYLE_FLAG_BOLD, FT_STYLE_FLAG_ITALIC, PCF_PropertyRec_::isString, FT_FaceRec_::memory, NULL, pcf_find_property(), FT_FaceRec_::style_flags, FT_FaceRec_::style_name, and PCF_PropertyRec_::value.

Referenced by pcf_load_font().

pcf_load_font | ( | FT_Stream | stream,
|  | PCF_Face | face
| ) |  |

Definition at line 1105 of file pcfread.c.

References PCF_PropertyRec_::atom, FT_FaceRec_::available_sizes, error, FT_FaceRec_::face_flags, FT_FaceRec_::face_index, FT_FaceRec_::family_name, FT_Bool, FT_FACE, FT_FACE_FLAG_FAST_GLYPHS, FT_FACE_FLAG_FIXED_SIZES, FT_FACE_FLAG_FIXED_WIDTH, FT_FACE_FLAG_HORIZONTAL, FT_MEM_ZERO, FT_NEW_ARRAY, FT_Pos, FT_STRDUP, FT_Bitmap_Size_::height, if(), PCF_PropertyRec_::isString, PCF_PropertyRec_::l, NULL, FT_FaceRec_::num_faces, FT_FaceRec_::num_fixed_sizes, FT_FaceRec_::num_glyphs, PCF_ACCELERATORS, PCF_BDF_ACCELERATORS, pcf_find_property(), pcf_get_accel(), pcf_get_bitmaps(), pcf_get_encodings(), pcf_get_metrics(), pcf_get_properties(), pcf_has_table_type(), pcf_interpret_style(), pcf_read_TOC(), FT_Bitmap_Size_::size, PCF_PropertyRec_::value, FT_Bitmap_Size_::width, FT_Bitmap_Size_::x_ppem, and FT_Bitmap_Size_::y_ppem.

Referenced by PCF_Face_Init().

static FT_Error pcf_read_TOC | ( | FT_Stream | stream,
|  | PCF_Face | face
| ) |  |

static

Definition at line 88 of file pcfread.c.

References PCF_TocRec_::count, error, FT_ARRAY_MAX, FT_FACE, FT_FREE, FT_NEW_ARRAY, FT_STREAM_READ_FIELDS, FT_STREAM_SEEK, FT_TRACE4, i, j, PCF_FILE_VERSION, PCF_TocRec_::tables, PCF_FaceRec_::toc, and PCF_TocRec_::version.

Referenced by pcf_load_font().

static FT_Error pcf_seek_to_table_type | ( | FT_Stream | stream,
|  | PCF_Table | tables,
|  | FT_ULong | ntables,
|  | FT_ULong | type,
|  | FT_ULong * | aformat,
|  | FT_ULong * | asize
| ) |  |

static

Definition at line 290 of file pcfread.c.

References error, FT_STREAM_SKIP, i, and FT_StreamRec_::pos.

Referenced by pcf_get_accel(), pcf_get_bitmaps(), pcf_get_encodings(), pcf_get_metrics(), and pcf_get_properties().

## Variable Documentation

const FT_Frame_Field pcf_accel_header[]

static

Initial value:
=
{
#define FT_STRUCTURE
FT_FRAME_START( 20 ),
FT_FRAME_BYTE ( noOverlap ),
FT_FRAME_BYTE ( constantMetrics ),
FT_FRAME_BYTE ( terminalFont ),
FT_FRAME_BYTE ( constantWidth ),
FT_FRAME_BYTE ( inkInside ),
FT_FRAME_BYTE ( inkMetrics ),
FT_FRAME_BYTE ( drawDirection ),
FT_FRAME_SKIP_BYTES( 1 ),
FT_FRAME_LONG_LE ( fontAscent ),
FT_FRAME_LONG_LE ( fontDescent ),
FT_FRAME_LONG_LE ( maxOverlap ),
FT_FRAME_END
}
FT_FRAME_SKIP_BYTES
#define FT_FRAME_SKIP_BYTES(count)
Definition: ftstream.h:147
FT_FRAME_END
#define FT_FRAME_END
Definition: ftstream.h:118
FT_FRAME_BYTE
#define FT_FRAME_BYTE(f)
Definition: ftstream.h:126
FT_FRAME_LONG_LE
#define FT_FRAME_LONG_LE(f)
Definition: ftstream.h:129
FT_FRAME_START
#define FT_FRAME_START(size)
Definition: ftstream.h:117

Definition at line 877 of file pcfread.c.

const FT_Frame_Field pcf_accel_msb_header[]

static

Initial value:
=
{
#define FT_STRUCTURE
FT_FRAME_START( 20 ),
FT_FRAME_BYTE ( noOverlap ),
FT_FRAME_BYTE ( constantMetrics ),
FT_FRAME_BYTE ( terminalFont ),
FT_FRAME_BYTE ( constantWidth ),
FT_FRAME_BYTE ( inkInside ),
FT_FRAME_BYTE ( inkMetrics ),
FT_FRAME_BYTE ( drawDirection ),
FT_FRAME_SKIP_BYTES( 1 ),
FT_FRAME_LONG ( fontAscent ),
FT_FRAME_LONG ( fontDescent ),
FT_FRAME_LONG ( maxOverlap ),
FT_FRAME_END
}
FT_FRAME_LONG
#define FT_FRAME_LONG(f)
Definition: ftstream.h:120
FT_FRAME_SKIP_BYTES
#define FT_FRAME_SKIP_BYTES(count)
Definition: ftstream.h:147
FT_FRAME_END
#define FT_FRAME_END
Definition: ftstream.h:118
FT_FRAME_BYTE
#define FT_FRAME_BYTE(f)
Definition: ftstream.h:126
FT_FRAME_START
#define FT_FRAME_START(size)
Definition: ftstream.h:117

Definition at line 899 of file pcfread.c.

const FT_Frame_Field pcf_compressed_metric_header[]

static

Initial value:
=
{
#define FT_STRUCTURE
FT_FRAME_START( PCF_COMPRESSED_METRIC_SIZE ),
FT_FRAME_BYTE( leftSideBearing ),
FT_FRAME_BYTE( rightSideBearing ),
FT_FRAME_BYTE( characterWidth ),
FT_FRAME_BYTE( ascent ),
FT_FRAME_BYTE( descent ),
FT_FRAME_END
}
FT_FRAME_END
#define FT_FRAME_END
Definition: ftstream.h:118
FT_FRAME_BYTE
#define FT_FRAME_BYTE(f)
Definition: ftstream.h:126
PCF_COMPRESSED_METRIC_SIZE
#define PCF_COMPRESSED_METRIC_SIZE
Definition: pcfread.c:228
FT_FRAME_START
#define FT_FRAME_START(size)
Definition: ftstream.h:117

Definition at line 231 of file pcfread.c.

const FT_Frame_Field pcf_metric_header[]

static

Initial value:
=
{
#define FT_STRUCTURE
FT_FRAME_START( PCF_METRIC_SIZE ),
FT_FRAME_SHORT_LE( leftSideBearing ),
FT_FRAME_SHORT_LE( rightSideBearing ),
FT_FRAME_SHORT_LE( characterWidth ),
FT_FRAME_SHORT_LE( ascent ),
FT_FRAME_SHORT_LE( descent ),
FT_FRAME_SHORT_LE( attributes ),
FT_FRAME_END
}
FT_FRAME_SHORT_LE
#define FT_FRAME_SHORT_LE(f)
Definition: ftstream.h:131
FT_FRAME_END
#define FT_FRAME_END
Definition: ftstream.h:118
PCF_METRIC_SIZE
#define PCF_METRIC_SIZE
Definition: pcfread.c:192
FT_FRAME_START
#define FT_FRAME_START(size)
Definition: ftstream.h:117

Definition at line 195 of file pcfread.c.

Referenced by pcf_get_metric().

const FT_Frame_Field pcf_metric_msb_header[]

static

Initial value:
=
{
#define FT_STRUCTURE
FT_FRAME_START( PCF_METRIC_SIZE ),
FT_FRAME_SHORT( leftSideBearing ),
FT_FRAME_SHORT( rightSideBearing ),
FT_FRAME_SHORT( characterWidth ),
FT_FRAME_SHORT( ascent ),
FT_FRAME_SHORT( descent ),
FT_FRAME_SHORT( attributes ),
FT_FRAME_END
}
FT_FRAME_END
#define FT_FRAME_END
Definition: ftstream.h:118
PCF_METRIC_SIZE
#define PCF_METRIC_SIZE
Definition: pcfread.c:192
FT_FRAME_SHORT
#define FT_FRAME_SHORT(f)
Definition: ftstream.h:122
FT_FRAME_START
#define FT_FRAME_START(size)
Definition: ftstream.h:117

Definition at line 212 of file pcfread.c.

const FT_Frame_Field pcf_property_header[]

static

Initial value:
=
{
#define FT_STRUCTURE
FT_FRAME_START( PCF_PROPERTY_SIZE ),
FT_FRAME_LONG_LE( name ),
FT_FRAME_BYTE ( isString ),
FT_FRAME_LONG_LE( value ),
FT_FRAME_END
}
name
EGLImageKHR EGLint * name
Definition: eglext.h:284
FT_FRAME_END
#define FT_FRAME_END
Definition: ftstream.h:118
PCF_PROPERTY_SIZE
#define PCF_PROPERTY_SIZE
Definition: pcfread.c:344
value
EGLSurface EGLint void ** value
Definition: eglext.h:301
FT_FRAME_BYTE
#define FT_FRAME_BYTE(f)
Definition: ftstream.h:126
FT_FRAME_LONG_LE
#define FT_FRAME_LONG_LE(f)
Definition: ftstream.h:129
FT_FRAME_START
#define FT_FRAME_START(size)
Definition: ftstream.h:117

Definition at line 347 of file pcfread.c.

const FT_Frame_Field pcf_property_msb_header[]

static

Initial value:
=
{
#define FT_STRUCTURE
FT_FRAME_START( PCF_PROPERTY_SIZE ),
FT_FRAME_LONG( name ),
FT_FRAME_BYTE( isString ),
FT_FRAME_LONG( value ),
FT_FRAME_END
}
FT_FRAME_LONG
#define FT_FRAME_LONG(f)
Definition: ftstream.h:120
name
EGLImageKHR EGLint * name
Definition: eglext.h:284
FT_FRAME_END
#define FT_FRAME_END
Definition: ftstream.h:118
PCF_PROPERTY_SIZE
#define PCF_PROPERTY_SIZE
Definition: pcfread.c:344
value
EGLSurface EGLint void ** value
Definition: eglext.h:301
FT_FRAME_BYTE
#define FT_FRAME_BYTE(f)
Definition: ftstream.h:126
FT_FRAME_START
#define FT_FRAME_START(size)
Definition: ftstream.h:117

Definition at line 361 of file pcfread.c.

const FT_Frame_Field pcf_table_header[]

static

Initial value:
=
{
#define FT_STRUCTURE
FT_FRAME_START( 16 ),
FT_FRAME_ULONG_LE( type ),
FT_FRAME_ULONG_LE( format ),
FT_FRAME_ULONG_LE( size ),
FT_FRAME_ULONG_LE( offset ),
FT_FRAME_END
}
type
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum type
Definition: gl2ext.h:845
FT_FRAME_ULONG_LE
#define FT_FRAME_ULONG_LE(f)
Definition: ftstream.h:130
FT_FRAME_END
#define FT_FRAME_END
Definition: ftstream.h:118
format
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl2ext.h:845
offset
GLintptr offset
Definition: glew.h:1668
FT_FRAME_START
#define FT_FRAME_START(size)
Definition: ftstream.h:117
size
GLsizei size
Definition: gl2ext.h:1467

Definition at line 73 of file pcfread.c.

const FT_Frame_Field pcf_toc_header[]

static

Initial value:
=
{
#define FT_STRUCTURE
FT_FRAME_START( 8 ),
FT_FRAME_ULONG_LE( version ),
FT_FRAME_ULONG_LE( count ),
FT_FRAME_END
}
version
int const char * version
Definition: zlib.h:813
FT_FRAME_ULONG_LE
#define FT_FRAME_ULONG_LE(f)
Definition: ftstream.h:130
FT_FRAME_END
#define FT_FRAME_END
Definition: ftstream.h:118
count
GLint GLsizei count
Definition: gl2ext.h:1011
FT_FRAME_START
#define FT_FRAME_START(size)
Definition: ftstream.h:117

Definition at line 60 of file pcfread.c.