30#include FT_INTERNAL_DEBUG_H
31#include FT_INTERNAL_STREAM_H
32#include FT_INTERNAL_OBJECTS_H
47#define FT_COMPONENT pcfread
50#ifdef FT_DEBUG_LEVEL_TRACE
51 static const char*
const tableNames[] =
70#define FT_STRUCTURE PCF_TocRec
83#define FT_STRUCTURE PCF_TableRec
110 return FT_THROW( Cannot_Open_Resource );
114 return FT_THROW( Invalid_File_Format );
117 return FT_THROW( Invalid_File_Format );
124 FT_TRACE0((
"pcf_read_TOC: adjusting number of tables"
125 " (from %d to %d)\n",
147 for (
n = 0;
n < toc->
count - 1;
n++ )
154 for (
i = 0;
i < toc->
count - 1 -
n;
i++ )
204 for (
n = 0;
n < toc->
count - 1;
n++ )
226#ifdef FT_DEBUG_LEVEL_TRACE
230 const char*
name =
"?";
240 for (
j = 0;
j <
sizeof ( tableNames ) /
sizeof ( tableNames[0] );
243 name = tableNames[
j];
246 " size=%ld (0x%lX), offset=%ld (0x%lX)\n",
264#define PCF_METRIC_SIZE 12
270#define FT_STRUCTURE PCF_MetricRec
287#define FT_STRUCTURE PCF_MetricRec
300#define PCF_COMPRESSED_METRIC_SIZE 5
306#define FT_STRUCTURE PCF_Compressed_MetricRec
358 " ascent=%d, descent=%d,"
384 for (
i = 0;
i < ntables;
i++ )
419 for (
i = 0;
i < ntables;
i++ )
427#define PCF_PROPERTY_SIZE 9
433#define FT_STRUCTURE PCF_ParsePropertyRec
447#define FT_STRUCTURE PCF_ParsePropertyRec
466 for (
i = 0;
i <
face->nprops && !found;
i++ )
473 return properties +
i - 1;
506 " format: 0x%lX (%s)\n",
520 FT_TRACE4((
" number of properties: %ld\n", orig_nprops ));
533 if ( orig_nprops > 256 )
536 " only loading first 256 properties\n" ));
540 nprops = orig_nprops;
547 for (
i = 0;
i < nprops;
i++ )
575 if ( orig_nprops & 3 )
577 i = 4 - ( orig_nprops & 3 );
592 FT_TRACE4((
" string size: %ld\n", string_size ));
603 if ( string_size > 16777472 )
606 " loading only 16777472 bytes of strings array\n" ));
607 string_size = 16777472;
621 face->properties = properties;
624 for (
i = 0;
i < nprops;
i++ )
629 if ( ( name_offset < 0 ) ||
630 ( (
FT_ULong)name_offset > string_size ) )
648 if ( ( value_offset < 0 ) ||
649 ( (
FT_ULong)value_offset > string_size ) )
702 " format: 0x%lX (%s, %s)\n",
706 "compressed" :
"uncompressed" ));
710 return FT_THROW( Invalid_File_Format );
727 return FT_THROW( Invalid_File_Format );
729 FT_TRACE4((
" number of metrics: %ld\n", orig_nmetrics ));
743 if ( !orig_nmetrics )
755 if ( orig_nmetrics > 65536 )
758 " only loading first 65536 metrics\n" ));
762 nmetrics = orig_nmetrics;
764 face->nmetrics = nmetrics;
795 " invalid metrics for glyph %d\n",
i ));
816 FT_ULong nbitmaps, orig_nbitmaps,
i, sizebitmaps = 0;
843 " padding=%d bit%s, scanning=%d bit%s)\n",
846 ?
"most significant byte first"
847 :
"least significant byte first",
849 ?
"most significant bit first"
850 :
"least significant bit first",
857 return FT_THROW( Invalid_File_Format );
859 FT_TRACE4((
" number of bitmaps: %ld\n", orig_nbitmaps ));
862 if ( orig_nbitmaps > 65536 )
865 " only loading first 65536 bitmaps\n" ));
869 nbitmaps = orig_nbitmaps;
871 if ( nbitmaps !=
face->nmetrics )
872 return FT_THROW( Invalid_File_Format );
878 for (
i = 0;
i < nbitmaps;
i++ )
885 FT_TRACE5((
" bitmap %lu: offset %lu (0x%lX)\n",
902 FT_TRACE4((
" %ld-bit padding implies a size of %lu\n",
903 8 <<
i, bitmapSizes[
i] ));
906 FT_TRACE4((
" %lu bitmaps, using %ld-bit padding\n",
909 FT_TRACE4((
" bitmap size: %lu\n", sizebitmaps ));
915 for (
i = 0;
i < nbitmaps;
i++ )
921 " invalid offset to bitmap data of glyph %lu\n",
i ));
939#define PCF_ENC_SIZE 10
945#define FT_STRUCTURE PCF_EncRec
961#define FT_STRUCTURE PCF_EncRec
983 FT_UShort defaultCharRow, defaultCharCol;
984 FT_UShort encodingOffset, defaultCharEncodingOffset;
1002 " format: 0x%lX (%s)\n",
1008 return FT_THROW( Invalid_File_Format );
1021 FT_TRACE4((
" firstCol 0x%X, lastCol 0x%X\n"
1022 " firstRow 0x%X, lastRow 0x%X\n"
1023 " defaultChar 0x%X\n",
1051 if ( defaultCharRow < enc->firstRow ||
1052 defaultCharRow > enc->
lastRow ||
1053 defaultCharCol < enc->firstCol ||
1054 defaultCharCol > enc->
lastCol )
1058 " Invalid default character set to %u\n",
1073 2 * ( ( defaultCharRow - enc->
firstRow ) *
1082 if ( defaultCharEncodingOffset >=
face->nmetrics )
1085 " Invalid glyph index for default character,"
1086 " setting to zero\n" ));
1087 defaultCharEncodingOffset = 0;
1090 if ( defaultCharEncodingOffset )
1096 face->metrics[defaultCharEncodingOffset] =
face->metrics[0];
1097 face->metrics[0] = tmp;
1101 for (
i = enc->
firstRow; i <= enc->lastRow;
i++ )
1103 for (
j = enc->
firstCol; j <= enc->lastCol;
j++ )
1114 if ( encodingOffset != 0xFFFFU )
1116 if ( encodingOffset == defaultCharEncodingOffset )
1118 else if ( encodingOffset == 0 )
1119 encodingOffset = defaultCharEncodingOffset;
1122 *
offset++ = encodingOffset;
1141#define FT_STRUCTURE PCF_AccelRec
1163#define FT_STRUCTURE PCF_AccelRec
1204 " format: 0x%lX (%s, %s)\n",
1210 "accelerated" :
"not accelerated" ));
1227 FT_TRACE5((
" noOverlap=%s, constantMetrics=%s,"
1228 " terminalFont=%s, constantWidth=%s\n"
1229 " inkInside=%s, inkMetrics=%s, drawDirection=%s\n"
1230 " fontAscent=%ld, fontDescent=%ld, maxOverlap=%ld\n",
1246 FT_TRACE0((
"pfc_get_accel: clamping font ascent to value %d\n",
1252 FT_TRACE0((
"pfc_get_accel: clamping font descent to value %d\n",
1311 face->style_flags = 0;
1320 *(prop->
value.
atom) ==
'o' ) ? (
char *)
"Oblique"
1344 for (
len = 0, nn = 0; nn < 4; nn++ )
1356 strings[0] = (
char*)
"Regular";
1368 s =
face->style_name;
1370 for ( nn = 0; nn < 4; nn++ )
1381 if (
s !=
face->style_name )
1388 if ( nn == 0 || nn == 3 )
1393 for ( mm = 0; mm <
len; mm++ )
1422 root->num_faces = 1;
1423 root->face_index = 0;
1426 if ( face_index < 0 )
1437 if ( !hasBDFAccelerators )
1460 if ( hasBDFAccelerators )
1477 if (
face->accel.constantWidth )
1487#ifdef PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
1492 if ( !
driver->no_long_family_names )
1505 PCF_Property foundry_prop, point_size_prop, average_width_prop;
1515 if ( point_size_prop && average_width_prop )
1517 if ( average_width_prop->
value.
l >= point_size_prop->
value.
l )
1525 if ( foundry_prop && foundry_prop->
isString )
1561 root->num_fixed_sizes = 1;
1567 FT_Short resolution_x = 0, resolution_y = 0;
1575 bsize->
height =
face->accel.maxbounds.ascent << 6;
1578#ifdef FT_DEBUG_LEVEL_TRACE
1579 if (
face->accel.fontAscent +
face->accel.fontDescent < 0 )
1580 FT_TRACE0((
"pcf_load_font: negative height\n" ));
1583 face->accel.fontDescent ) > 0x7FFF )
1586 FT_TRACE0((
"pcf_load_font: clamping height to value %d\n",
1591 face->accel.fontDescent ) );
1596#ifdef FT_DEBUG_LEVEL_TRACE
1598 FT_TRACE0((
"pcf_load_font: negative average width\n" ));
1602 bsize->
width = 0x7FFF;
1603 FT_TRACE0((
"pcf_load_font: clamping average width to value %d\n",
1618#ifdef FT_DEBUG_LEVEL_TRACE
1620 FT_TRACE0((
"pcf_load_font: negative point size\n" ));
1625 bsize->
size = 0x7FFF;
1626 FT_TRACE0((
"pcf_load_font: clamping point size to value %d\n",
1638#ifdef FT_DEBUG_LEVEL_TRACE
1640 FT_TRACE0((
"pcf_load_font: negative pixel size\n" ));
1644 bsize->
y_ppem = 0x7FFF << 6;
1645 FT_TRACE0((
"pcf_load_font: clamping pixel size to value %d\n",
1655#ifdef FT_DEBUG_LEVEL_TRACE
1657 FT_TRACE0((
"pcf_load_font: negative X resolution\n" ));
1661 resolution_x = 0x7FFF;
1662 FT_TRACE0((
"pcf_load_font: clamping X resolution to value %d\n",
1672#ifdef FT_DEBUG_LEVEL_TRACE
1674 FT_TRACE0((
"pcf_load_font: negative Y resolution\n" ));
1678 resolution_y = 0x7FFF;
1679 FT_TRACE0((
"pcf_load_font: clamping Y resolution to value %d\n",
1686 if ( bsize->
y_ppem == 0 )
1692 if ( resolution_x && resolution_y )
1708 if ( charset_registry && charset_registry->
isString &&
1709 charset_encoding && charset_encoding->
isString )
static const WCHAR version[]
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
struct nls_table * tables
#define FT_STYLE_FLAG_ITALIC
#define FT_FACE_FLAG_FIXED_SIZES
#define FT_FACE_FLAG_FIXED_WIDTH
#define FT_STYLE_FLAG_BOLD
#define FT_FACE_FLAG_HORIZONTAL
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
#define FT_TRACE0(varformat)
#define FT_TRACE5(varformat)
#define FT_TRACE4(varformat)
#define FT_NEW_ARRAY(ptr, count)
#define FT_STRDUP(dst, str)
#define FT_SET_ERROR(expression)
#define FT_ALLOC(ptr, size)
#define FT_FACE_DRIVER(x)
#define FT_GET_ULONG_LE()
#define FT_READ_USHORT(var)
#define FT_STREAM_SEEK(position)
#define FT_READ_ULONG(var)
#define FT_FRAME_SHORT(f)
#define FT_GET_USHORT_LE()
FT_Stream_EnterFrame(FT_Stream stream, FT_ULong count)
#define FT_PEEK_USHORT(p)
FT_Stream_ExitFrame(FT_Stream stream)
#define FT_FRAME_SHORT_LE(f)
#define FT_PEEK_USHORT_LE(p)
#define FT_FRAME_SKIP_BYTES(count)
#define FT_FRAME_USHORT_LE(f)
#define FT_FRAME_ULONG_LE(f)
#define FT_STREAM_READ_FIELDS(fields, object)
#define FT_STREAM_SKIP(distance)
FT_Stream_Read(FT_Stream stream, FT_Byte *buffer, FT_ULong count)
#define FT_FRAME_LONG_LE(f)
#define FT_READ_USHORT_LE(var)
#define FT_READ_ULONG_LE(var)
#define FT_FRAME_START(size)
#define FT_FRAME_USHORT(f)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_BEGIN_HEADER typedef unsigned char FT_Bool
static const FxOffsetAndName offsets[]
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLsizei const GLchar *const * strings
GLenum GLuint GLint GLenum face
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
GLsizei GLenum GLenum GLuint GLenum GLsizei * lengths
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
static char memory[1024 *256]
struct @1709::@1710 driver
#define PCF_ACCEL_W_INKBOUNDS
FT_BEGIN_HEADER struct PCF_TableRec_ PCF_TableRec
struct PCF_DriverRec_ * PCF_Driver
#define PCF_FORMAT_MATCH(a, b)
FT_BEGIN_HEADER struct PCF_TableRec_ * PCF_Table
#define PCF_GLYPH_PAD_INDEX(f)
#define PCF_DEFAULT_FORMAT
#define PCF_BYTE_ORDER(f)
#define PCF_COMPRESSED_METRICS
#define PCF_BDF_ACCELERATORS
#define PCF_SCAN_UNIT_INDEX(f)
#define PCF_BDF_ENCODINGS
pcf_load_font(FT_Stream stream, PCF_Face face, FT_Long face_index)
static FT_Error pcf_get_properties(FT_Stream stream, PCF_Face face)
static const FT_Frame_Field pcf_property_header[]
static FT_Error pcf_get_encodings(FT_Stream stream, PCF_Face face)
static const FT_Frame_Field pcf_enc_msb_header[]
static const FT_Frame_Field pcf_accel_msb_header[]
static const FT_Frame_Field pcf_table_header[]
static const FT_Frame_Field pcf_property_msb_header[]
#define PCF_COMPRESSED_METRIC_SIZE
static FT_Bool pcf_has_table_type(PCF_Table tables, FT_ULong ntables, FT_ULong type)
static FT_Error pcf_get_bitmaps(FT_Stream stream, PCF_Face face)
static FT_Error pcf_get_metric(FT_Stream stream, FT_ULong format, PCF_Metric metric)
static const FT_Frame_Field pcf_toc_header[]
pcf_find_property(PCF_Face face, const FT_String *prop)
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 FT_Error pcf_get_accel(FT_Stream stream, PCF_Face face, FT_ULong type)
static FT_Error pcf_interpret_style(PCF_Face pcf)
static FT_Error pcf_read_TOC(FT_Stream stream, PCF_Face face)
#define PCF_PROPERTY_SIZE
static const FT_Frame_Field pcf_metric_msb_header[]
static const FT_Frame_Field pcf_accel_header[]
static const FT_Frame_Field pcf_enc_header[]
static const FT_Frame_Field pcf_metric_header[]
static const FT_Frame_Field pcf_compressed_metric_header[]
static FT_Error pcf_get_metrics(FT_Stream stream, PCF_Face face)
PCF_MetricRec ink_minbounds
PCF_MetricRec ink_maxbounds
FT_Short rightSideBearing
union PCF_PropertyRec_::@4377 value
static int __cdecl compr(const void *a, const void *b)
static const WCHAR props[]