46#define FT_COMPONENT pcfread
49#ifdef FT_DEBUG_LEVEL_TRACE
50 static const char*
const tableNames[] =
69#define FT_STRUCTURE PCF_TocRec
82#define FT_STRUCTURE PCF_TableRec
109 return FT_THROW( Cannot_Open_Resource );
113 return FT_THROW( Invalid_File_Format );
116 return FT_THROW( Invalid_File_Format );
123 FT_TRACE0((
"pcf_read_TOC: adjusting number of tables"
124 " (from %ld to %ld)\n",
146 for (
n = 0;
n < toc->
count - 1;
n++ )
153 for (
i = 0;
i < toc->
count - 1 -
n;
i++ )
203 for (
n = 0;
n < toc->
count - 1;
n++ )
225#ifdef FT_DEBUG_LEVEL_TRACE
229 const char*
name =
"?";
239 for (
j = 0;
j <
sizeof ( tableNames ) /
sizeof ( tableNames[0] );
242 name = tableNames[
j];
244 FT_TRACE4((
" %d: type=%s, format=0x%lX,"
245 " size=%ld (0x%lX), offset=%ld (0x%lX)\n",
263#define PCF_METRIC_SIZE 12
269#define FT_STRUCTURE PCF_MetricRec
286#define FT_STRUCTURE PCF_MetricRec
299#define PCF_COMPRESSED_METRIC_SIZE 5
305#define FT_STRUCTURE PCF_Compressed_MetricRec
357 " ascent=%d, descent=%d,"
383 for (
i = 0;
i < ntables;
i++ )
418 for (
i = 0;
i < ntables;
i++ )
426#define PCF_PROPERTY_SIZE 9
432#define FT_STRUCTURE PCF_ParsePropertyRec
446#define FT_STRUCTURE PCF_ParsePropertyRec
465 for (
i = 0;
i <
face->nprops && !found;
i++ )
472 return properties +
i - 1;
505 " format: 0x%lX (%s)\n",
519 FT_TRACE4((
" number of properties: %ld\n", orig_nprops ));
532 if ( orig_nprops > 256 )
535 " only loading first 256 properties\n" ));
539 nprops = orig_nprops;
546 for (
i = 0;
i < nprops;
i++ )
574 if ( orig_nprops & 3 )
576 i = 4 - ( orig_nprops & 3 );
591 FT_TRACE4((
" string size: %ld\n", string_size ));
602 if ( string_size > 16777472 )
605 " loading only 16777472 bytes of strings array\n" ));
606 string_size = 16777472;
620 face->properties = properties;
623 for (
i = 0;
i < nprops;
i++ )
628 if ( ( name_offset < 0 ) ||
629 ( (
FT_ULong)name_offset > string_size ) )
647 if ( ( value_offset < 0 ) ||
648 ( (
FT_ULong)value_offset > string_size ) )
701 " format: 0x%lX (%s, %s)\n",
705 "compressed" :
"uncompressed" ));
709 return FT_THROW( Invalid_File_Format );
726 return FT_THROW( Invalid_File_Format );
728 FT_TRACE4((
" number of metrics: %ld\n", orig_nmetrics ));
742 if ( !orig_nmetrics )
759 if ( orig_nmetrics > 65534 )
762 " only loading first 65534 metrics\n" ));
766 nmetrics = orig_nmetrics;
768 face->nmetrics = nmetrics + 1;
800 " invalid metrics for glyph %ld\n",
i ));
819 FT_ULong nbitmaps, orig_nbitmaps,
i, sizebitmaps = 0;
846 " padding=%d bit%s, scanning=%d bit%s)\n",
849 ?
"most significant byte first"
850 :
"least significant byte first",
852 ?
"most significant bit first"
853 :
"least significant bit first",
860 return FT_THROW( Invalid_File_Format );
862 FT_TRACE4((
" number of bitmaps: %ld\n", orig_nbitmaps ));
865 if ( orig_nbitmaps > 65534 )
868 " only loading first 65534 bitmaps\n" ));
872 nbitmaps = orig_nbitmaps;
875 if ( nbitmaps !=
face->nmetrics - 1 )
876 return FT_THROW( Invalid_File_Format );
882 for (
i = 1;
i <= nbitmaps;
i++ )
892 FT_TRACE5((
" bitmap %lu: offset %lu (0x%lX)\n",
900 " invalid offset to bitmap data of glyph %lu\n",
i ));
920 FT_TRACE4((
" %d-bit padding implies a size of %lu\n",
921 8 <<
i, bitmapSizes[
i] ));
924 FT_TRACE4((
" %lu bitmaps, using %d-bit padding\n",
927 FT_TRACE4((
" bitmap size: %lu\n", sizebitmaps ));
942#define PCF_ENC_SIZE 10
948#define FT_STRUCTURE PCF_EncRec
964#define FT_STRUCTURE PCF_EncRec
986 FT_UShort defaultCharRow, defaultCharCol;
987 FT_UShort encodingOffset, defaultCharEncodingOffset;
1005 " format: 0x%lX (%s)\n",
1011 return FT_THROW( Invalid_File_Format );
1024 FT_TRACE4((
" firstCol 0x%X, lastCol 0x%X\n"
1025 " firstRow 0x%X, lastRow 0x%X\n"
1026 " defaultChar 0x%X\n",
1054 if ( defaultCharRow < enc->firstRow ||
1055 defaultCharRow > enc->
lastRow ||
1056 defaultCharCol < enc->firstCol ||
1057 defaultCharCol > enc->
lastCol )
1061 " Invalid default character set to %u\n",
1079 2 * ( ( defaultCharRow - enc->
firstRow ) *
1088 if ( defaultCharEncodingOffset == 0xFFFF )
1091 " No glyph for default character,\n"
1093 " setting it to the first glyph of the font\n" ));
1094 defaultCharEncodingOffset = 1;
1098 defaultCharEncodingOffset++;
1100 if ( defaultCharEncodingOffset >=
face->nmetrics )
1103 " Invalid glyph index for default character,\n"
1105 " setting it to the first glyph of the font\n" ));
1106 defaultCharEncodingOffset = 1;
1111 face->metrics[0] =
face->metrics[defaultCharEncodingOffset];
1115 for (
i = enc->
firstRow; i <= enc->lastRow;
i++ )
1117 for (
j = enc->
firstCol; j <= enc->lastCol;
j++ )
1129 *
offset++ = encodingOffset == 0xFFFF ? 0xFFFF
1130 : encodingOffset + 1;
1149#define FT_STRUCTURE PCF_AccelRec
1171#define FT_STRUCTURE PCF_AccelRec
1212 " format: 0x%lX (%s, %s)\n",
1218 "accelerated" :
"not accelerated" ));
1235 FT_TRACE5((
" noOverlap=%s, constantMetrics=%s,"
1236 " terminalFont=%s, constantWidth=%s\n"
1237 " inkInside=%s, inkMetrics=%s, drawDirection=%s\n"
1238 " fontAscent=%ld, fontDescent=%ld, maxOverlap=%ld\n",
1254 FT_TRACE0((
"pfc_get_accel: clamping font ascent to value %ld\n",
1260 FT_TRACE0((
"pfc_get_accel: clamping font descent to value %ld\n",
1318 face->style_flags = 0;
1327 *(prop->
value.
atom) ==
'o' ) ?
"Oblique"
1351 for (
len = 0, nn = 0; nn < 4; nn++ )
1375 s =
face->style_name;
1377 for ( nn = 0; nn < 4; nn++ )
1388 if (
s !=
face->style_name )
1395 if ( nn == 0 || nn == 3 )
1400 for ( mm = 0; mm <
len; mm++ )
1429 root->num_faces = 1;
1430 root->face_index = 0;
1433 if ( face_index < 0 )
1444 if ( !hasBDFAccelerators )
1467 if ( hasBDFAccelerators )
1484 if (
face->accel.constantWidth )
1494#ifdef PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
1499 if ( !
driver->no_long_family_names )
1512 PCF_Property foundry_prop, point_size_prop, average_width_prop;
1522 if ( point_size_prop && average_width_prop )
1524 if ( average_width_prop->
value.
l >= point_size_prop->
value.
l )
1532 if ( foundry_prop && foundry_prop->
isString )
1568 root->num_fixed_sizes = 1;
1574 FT_Short resolution_x = 0, resolution_y = 0;
1582 bsize->
height =
face->accel.maxbounds.ascent << 6;
1585#ifdef FT_DEBUG_LEVEL_TRACE
1586 if (
face->accel.fontAscent +
face->accel.fontDescent < 0 )
1587 FT_TRACE0((
"pcf_load_font: negative height\n" ));
1590 face->accel.fontDescent ) > 0x7FFF )
1593 FT_TRACE0((
"pcf_load_font: clamping height to value %d\n",
1598 face->accel.fontDescent ) );
1603#ifdef FT_DEBUG_LEVEL_TRACE
1605 FT_TRACE0((
"pcf_load_font: negative average width\n" ));
1609 bsize->
width = 0x7FFF;
1610 FT_TRACE0((
"pcf_load_font: clamping average width to value %d\n",
1625#ifdef FT_DEBUG_LEVEL_TRACE
1627 FT_TRACE0((
"pcf_load_font: negative point size\n" ));
1632 bsize->
size = 0x7FFF;
1633 FT_TRACE0((
"pcf_load_font: clamping point size to value %ld\n",
1645#ifdef FT_DEBUG_LEVEL_TRACE
1647 FT_TRACE0((
"pcf_load_font: negative pixel size\n" ));
1651 bsize->
y_ppem = 0x7FFF << 6;
1652 FT_TRACE0((
"pcf_load_font: clamping pixel size to value %ld\n",
1662#ifdef FT_DEBUG_LEVEL_TRACE
1664 FT_TRACE0((
"pcf_load_font: negative X resolution\n" ));
1668 resolution_x = 0x7FFF;
1669 FT_TRACE0((
"pcf_load_font: clamping X resolution to value %d\n",
1679#ifdef FT_DEBUG_LEVEL_TRACE
1681 FT_TRACE0((
"pcf_load_font: negative Y resolution\n" ));
1685 resolution_y = 0x7FFF;
1686 FT_TRACE0((
"pcf_load_font: clamping Y resolution to value %d\n",
1693 if ( bsize->
y_ppem == 0 )
1699 if ( resolution_x && resolution_y )
1715 if ( charset_registry && charset_registry->
isString &&
1716 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
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 @1789::@1790 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_::@4541 value
static int __cdecl compr(const void *a, const void *b)
static const WCHAR props[]