30#include FT_INTERNAL_DEBUG_H
31#include FT_INTERNAL_STREAM_H
32#include FT_INTERNAL_OBJECTS_H
47#define FT_COMPONENT trace_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 %ld: offset %ld (0x%lX)\n",
902 FT_TRACE4((
" %ld-bit padding implies a size of %ld\n",
903 8 <<
i, bitmapSizes[
i] ));
906 FT_TRACE4((
" %ld bitmaps, using %ld-bit padding\n",
909 FT_TRACE4((
" bitmap size: %ld\n", sizebitmaps ));
915 for (
i = 0;
i < nbitmaps;
i++ )
922 " invalid offset to bitmap data of glyph %ld\n",
i ));
943 int firstCol, lastCol;
944 int firstRow, lastRow;
987 " format: 0x%lX (%s)\n",
992 return FT_THROW( Invalid_File_Format );
994 FT_TRACE4((
" firstCol 0x%X, lastCol 0x%X\n"
995 " firstRow 0x%X, lastRow 0x%X\n",
997 firstRow, lastRow ));
1000 if ( firstCol < 0 ||
1001 firstCol > lastCol ||
1004 firstRow > lastRow ||
1008 nencoding = (
FT_ULong)( lastCol - firstCol + 1 ) *
1009 (
FT_ULong)( lastRow - firstRow + 1 );
1021 for (
i = firstRow;
i <= lastRow;
i++ )
1023 for (
j = firstCol;
j <= lastCol;
j++ )
1034 if ( encodingOffset != 0xFFFFU )
1039 FT_TRACE5((
" code %d (0x%04X): idx %d\n",
1051 face->nencodings =
k;
1066#define FT_STRUCTURE PCF_AccelRec
1088#define FT_STRUCTURE PCF_AccelRec
1129 " format: 0x%lX (%s, %s)\n",
1135 "accelerated" :
"not accelerated" ));
1152 FT_TRACE5((
" noOverlap=%s, constantMetrics=%s,"
1153 " terminalFont=%s, constantWidth=%s\n"
1154 " inkInside=%s, inkMetrics=%s, drawDirection=%s\n"
1155 " fontAscent=%ld, fontDescent=%ld, maxOverlap=%ld\n",
1171 FT_TRACE0((
"pfc_get_accel: clamping font ascent to value %d\n",
1177 FT_TRACE0((
"pfc_get_accel: clamping font descent to value %d\n",
1236 face->style_flags = 0;
1245 *(prop->
value.
atom) ==
'o' ) ? (
char *)
"Oblique"
1269 for (
len = 0, nn = 0; nn < 4; nn++ )
1281 strings[0] = (
char*)
"Regular";
1293 s =
face->style_name;
1295 for ( nn = 0; nn < 4; nn++ )
1306 if (
s !=
face->style_name )
1313 if ( nn == 0 || nn == 3 )
1318 for ( mm = 0; mm <
len; mm++ )
1347 root->num_faces = 1;
1348 root->face_index = 0;
1351 if ( face_index < 0 )
1362 if ( !hasBDFAccelerators )
1385 if ( hasBDFAccelerators )
1403 if (
face->accel.constantWidth )
1413#ifdef PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
1418 if ( !
driver->no_long_family_names )
1431 PCF_Property foundry_prop, point_size_prop, average_width_prop;
1441 if ( point_size_prop && average_width_prop )
1443 if ( average_width_prop->
value.
l >= point_size_prop->
value.
l )
1451 if ( foundry_prop && foundry_prop->
isString )
1494 root->num_fixed_sizes = 1;
1500 FT_Short resolution_x = 0, resolution_y = 0;
1508 bsize->
height =
face->accel.maxbounds.ascent << 6;
1511#ifdef FT_DEBUG_LEVEL_TRACE
1512 if (
face->accel.fontAscent +
face->accel.fontDescent < 0 )
1513 FT_TRACE0((
"pcf_load_font: negative height\n" ));
1516 face->accel.fontDescent ) > 0x7FFF )
1519 FT_TRACE0((
"pcf_load_font: clamping height to value %d\n",
1524 face->accel.fontDescent ) );
1529#ifdef FT_DEBUG_LEVEL_TRACE
1531 FT_TRACE0((
"pcf_load_font: negative average width\n" ));
1535 bsize->
width = 0x7FFF;
1536 FT_TRACE0((
"pcf_load_font: clamping average width to value %d\n",
1551#ifdef FT_DEBUG_LEVEL_TRACE
1553 FT_TRACE0((
"pcf_load_font: negative point size\n" ));
1558 bsize->
size = 0x7FFF;
1559 FT_TRACE0((
"pcf_load_font: clamping point size to value %d\n",
1571#ifdef FT_DEBUG_LEVEL_TRACE
1573 FT_TRACE0((
"pcf_load_font: negative pixel size\n" ));
1577 bsize->
y_ppem = 0x7FFF << 6;
1578 FT_TRACE0((
"pcf_load_font: clamping pixel size to value %d\n",
1588#ifdef FT_DEBUG_LEVEL_TRACE
1590 FT_TRACE0((
"pcf_load_font: negative X resolution\n" ));
1594 resolution_x = 0x7FFF;
1595 FT_TRACE0((
"pcf_load_font: clamping X resolution to value %d\n",
1605#ifdef FT_DEBUG_LEVEL_TRACE
1607 FT_TRACE0((
"pcf_load_font: negative Y resolution\n" ));
1611 resolution_y = 0x7FFF;
1612 FT_TRACE0((
"pcf_load_font: clamping Y resolution to value %d\n",
1619 if ( bsize->
y_ppem == 0 )
1625 if ( resolution_x && resolution_y )
1641 if ( charset_registry && charset_registry->
isString &&
1642 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_FACE_FLAG_FAST_GLYPHS
#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_RENEW_ARRAY(ptr, curcnt, newcnt)
#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_READ_LONG(var)
#define FT_GET_USHORT_LE()
FT_Stream_EnterFrame(FT_Stream stream, FT_ULong count)
FT_Stream_ExitFrame(FT_Stream stream)
#define FT_FRAME_SHORT_LE(f)
#define FT_FRAME_SKIP_BYTES(count)
#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_GET_SHORT_LE()
#define FT_READ_USHORT_LE(var)
#define FT_READ_ULONG_LE(var)
#define FT_FRAME_START(size)
#define FT_READ_LONG_LE(var)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_BEGIN_HEADER typedef unsigned char FT_Bool
static const FxOffsetAndName offsets[]
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
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 @1679::@1680 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_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_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_::@4249 value
static int __cdecl compr(const void *a, const void *b)
static const WCHAR props[]