ReactOS 0.4.16-dev-959-g2ec3a19
pcfread.c File Reference
#include <ft2build.h>
#include "pcf.h"
#include "pcfread.h"
#include "pcferror.h"
Include dependency graph for pcfread.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FT_COMPONENT   pcfread
 
#define FT_STRUCTURE   PCF_TocRec
 
#define FT_STRUCTURE   PCF_TableRec
 
#define PCF_METRIC_SIZE   12
 
#define FT_STRUCTURE   PCF_MetricRec
 
#define FT_STRUCTURE   PCF_MetricRec
 
#define PCF_COMPRESSED_METRIC_SIZE   5
 
#define FT_STRUCTURE   PCF_Compressed_MetricRec
 
#define PCF_PROPERTY_SIZE   9
 
#define FT_STRUCTURE   PCF_ParsePropertyRec
 
#define FT_STRUCTURE   PCF_ParsePropertyRec
 
#define PCF_ENC_SIZE   10
 
#define FT_STRUCTURE   PCF_EncRec
 
#define FT_STRUCTURE   PCF_EncRec
 
#define FT_STRUCTURE   PCF_AccelRec
 
#define FT_STRUCTURE   PCF_AccelRec
 

Functions

static FT_Error pcf_read_TOC (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_seek_to_table_type (FT_Stream stream, PCF_Table tables, FT_ULong ntables, FT_ULong type, FT_ULong *aformat, FT_ULong *asize)
 
static FT_Bool pcf_has_table_type (PCF_Table tables, FT_ULong ntables, FT_ULong type)
 
 pcf_find_property (PCF_Face face, const FT_String *prop)
 
static FT_Error pcf_get_properties (FT_Stream stream, PCF_Face face)
 
static FT_Error pcf_get_metrics (FT_Stream stream, PCF_Face face)
 
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_accel (FT_Stream stream, PCF_Face face, FT_ULong type)
 
static FT_Error pcf_interpret_style (PCF_Face pcf)
 
 pcf_load_font (FT_Stream stream, PCF_Face face, FT_Long face_index)
 

Variables

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

Macro Definition Documentation

◆ FT_COMPONENT

#define FT_COMPONENT   pcfread

Definition at line 47 of file pcfread.c.

◆ FT_STRUCTURE [1/11]

#define FT_STRUCTURE   PCF_TocRec

◆ FT_STRUCTURE [2/11]

#define FT_STRUCTURE   PCF_TableRec

◆ FT_STRUCTURE [3/11]

#define FT_STRUCTURE   PCF_MetricRec

◆ FT_STRUCTURE [4/11]

#define FT_STRUCTURE   PCF_MetricRec

◆ FT_STRUCTURE [5/11]

#define FT_STRUCTURE   PCF_Compressed_MetricRec

◆ FT_STRUCTURE [6/11]

#define FT_STRUCTURE   PCF_ParsePropertyRec

◆ FT_STRUCTURE [7/11]

#define FT_STRUCTURE   PCF_ParsePropertyRec

◆ FT_STRUCTURE [8/11]

#define FT_STRUCTURE   PCF_EncRec

◆ FT_STRUCTURE [9/11]

#define FT_STRUCTURE   PCF_EncRec

◆ FT_STRUCTURE [10/11]

#define FT_STRUCTURE   PCF_AccelRec

◆ FT_STRUCTURE [11/11]

#define FT_STRUCTURE   PCF_AccelRec

◆ PCF_COMPRESSED_METRIC_SIZE

#define PCF_COMPRESSED_METRIC_SIZE   5

Definition at line 300 of file pcfread.c.

◆ PCF_ENC_SIZE

#define PCF_ENC_SIZE   10

Definition at line 939 of file pcfread.c.

◆ PCF_METRIC_SIZE

#define PCF_METRIC_SIZE   12

Definition at line 264 of file pcfread.c.

◆ PCF_PROPERTY_SIZE

#define PCF_PROPERTY_SIZE   9

Definition at line 427 of file pcfread.c.

Function Documentation

◆ pcf_find_property()

pcf_find_property ( PCF_Face  face,
const FT_String prop 
)

Definition at line 458 of file pcfread.c.

460 {
461 PCF_Property properties = face->properties;
462 FT_Bool found = 0;
463 int i;
464
465
466 for ( i = 0; i < face->nprops && !found; i++ )
467 {
468 if ( !ft_strcmp( properties[i].name, prop ) )
469 found = 1;
470 }
471
472 if ( found )
473 return properties + i - 1;
474 else
475 return NULL;
476 }
#define NULL
Definition: types.h:112
#define ft_strcmp
Definition: ftstdlib.h:86
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
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
Definition: glfuncs.h:248
Definition: name.c:39

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

◆ pcf_get_accel()

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

Definition at line 1182 of file pcfread.c.

1185 {
1188 PCF_Accel accel = &face->accel;
1189
1190
1192 face->toc.tables,
1193 face->toc.count,
1194 type,
1195 &format,
1196 &size );
1197 if ( error )
1198 goto Bail;
1199
1200 if ( FT_READ_ULONG_LE( format ) )
1201 goto Bail;
1202
1203 FT_TRACE4(( "pcf_get_accel%s:\n"
1204 " format: 0x%lX (%s, %s)\n",
1205 type == PCF_BDF_ACCELERATORS ? " (getting BDF accelerators)"
1206 : "",
1207 format,
1208 PCF_BYTE_ORDER( format ) == MSBFirst ? "MSB" : "LSB",
1210 "accelerated" : "not accelerated" ));
1211
1214 goto Bail;
1215
1216 if ( PCF_BYTE_ORDER( format ) == MSBFirst )
1217 {
1219 goto Bail;
1220 }
1221 else
1222 {
1224 goto Bail;
1225 }
1226
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",
1231 accel->noOverlap ? "yes" : "no",
1232 accel->constantMetrics ? "yes" : "no",
1233 accel->terminalFont ? "yes" : "no",
1234 accel->constantWidth ? "yes" : "no",
1235 accel->inkInside ? "yes" : "no",
1236 accel->inkMetrics ? "yes" : "no",
1237 accel->drawDirection ? "RTL" : "LTR",
1238 accel->fontAscent,
1239 accel->fontDescent,
1240 accel->maxOverlap ));
1241
1242 /* sanity checks */
1243 if ( FT_ABS( accel->fontAscent ) > 0x7FFF )
1244 {
1245 accel->fontAscent = accel->fontAscent < 0 ? -0x7FFF : 0x7FFF;
1246 FT_TRACE0(( "pfc_get_accel: clamping font ascent to value %d\n",
1247 accel->fontAscent ));
1248 }
1249 if ( FT_ABS( accel->fontDescent ) > 0x7FFF )
1250 {
1251 accel->fontDescent = accel->fontDescent < 0 ? -0x7FFF : 0x7FFF;
1252 FT_TRACE0(( "pfc_get_accel: clamping font descent to value %d\n",
1253 accel->fontDescent ));
1254 }
1255
1256 FT_TRACE5(( " minbounds:" ));
1258 format & ( ~PCF_FORMAT_MASK ),
1259 &(accel->minbounds) );
1260 if ( error )
1261 goto Bail;
1262
1263 FT_TRACE5(( " maxbounds:" ));
1265 format & ( ~PCF_FORMAT_MASK ),
1266 &(accel->maxbounds) );
1267 if ( error )
1268 goto Bail;
1269
1271 {
1272 FT_TRACE5(( " ink minbounds:" ));
1274 format & ( ~PCF_FORMAT_MASK ),
1275 &(accel->ink_minbounds) );
1276 if ( error )
1277 goto Bail;
1278
1279 FT_TRACE5(( " ink maxbounds:" ));
1281 format & ( ~PCF_FORMAT_MASK ),
1282 &(accel->ink_maxbounds) );
1283 if ( error )
1284 goto Bail;
1285 }
1286 else
1287 {
1288 accel->ink_minbounds = accel->minbounds;
1289 accel->ink_maxbounds = accel->maxbounds;
1290 }
1291
1292 Bail:
1293 return error;
1294 }
#define FT_TRACE0(varformat)
Definition: ftdebug.h:185
#define FT_TRACE5(varformat)
Definition: ftdebug.h:190
#define FT_TRACE4(varformat)
Definition: ftdebug.h:189
#define FT_ABS(a)
Definition: ftobjs.h:73
#define FT_STREAM_READ_FIELDS(fields, object)
Definition: ftstream.h:533
#define FT_READ_ULONG_LE(var)
Definition: ftstream.h:337
unsigned long FT_ULong
Definition: fttypes.h:253
int FT_Error
Definition: fttypes.h:299
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
#define error(str)
Definition: mkdosfs.c:1605
#define PCF_ACCEL_W_INKBOUNDS
Definition: pcf.h:191
#define PCF_FORMAT_MATCH(a, b)
Definition: pcf.h:194
#define PCF_DEFAULT_FORMAT
Definition: pcf.h:189
#define PCF_BYTE_ORDER(f)
Definition: pcf.h:202
#define PCF_FORMAT_MASK
Definition: pcf.h:187
#define PCF_BDF_ACCELERATORS
Definition: pcf.h:237
#define MSBFirst
Definition: pcf.h:182
static const FT_Frame_Field pcf_accel_msb_header[]
Definition: pcfread.c:1160
static FT_Error pcf_get_metric(FT_Stream stream, FT_ULong format, PCF_Metric metric)
Definition: pcfread.c:319
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)
Definition: pcfread.c:373
static const FT_Frame_Field pcf_accel_header[]
Definition: pcfread.c:1138
FT_Byte constantMetrics
Definition: pcf.h:123
FT_Byte drawDirection
Definition: pcf.h:128
FT_Long fontDescent
Definition: pcf.h:130
FT_Long fontAscent
Definition: pcf.h:129
PCF_MetricRec minbounds
Definition: pcf.h:132
FT_Byte constantWidth
Definition: pcf.h:125
PCF_MetricRec ink_minbounds
Definition: pcf.h:134
FT_Byte inkMetrics
Definition: pcf.h:127
PCF_MetricRec ink_maxbounds
Definition: pcf.h:135
FT_Byte noOverlap
Definition: pcf.h:122
PCF_MetricRec maxbounds
Definition: pcf.h:133
FT_Byte inkInside
Definition: pcf.h:126
FT_Byte terminalFont
Definition: pcf.h:124
FT_Long maxOverlap
Definition: pcf.h:131
Definition: format.c:58
Definition: parse.h:23

Referenced by pcf_load_font().

◆ pcf_get_bitmaps()

static FT_Error pcf_get_bitmaps ( FT_Stream  stream,
PCF_Face  face 
)
static

Definition at line 808 of file pcfread.c.

810 {
812 FT_Memory memory = FT_FACE( face )->memory;
814 FT_ULong bitmapSizes[GLYPHPADOPTIONS];
816 FT_ULong nbitmaps, orig_nbitmaps, i, sizebitmaps = 0;
817
818
820 face->toc.tables,
821 face->toc.count,
823 &format,
824 &size );
825 if ( error )
826 return error;
827
829 if ( error )
830 return error;
831
833 if ( PCF_BYTE_ORDER( format ) == MSBFirst )
834 orig_nbitmaps = FT_GET_ULONG();
835 else
836 orig_nbitmaps = FT_GET_ULONG_LE();
837
839
840 FT_TRACE4(( "pcf_get_bitmaps:\n"
841 " format: 0x%lX\n"
842 " (%s, %s,\n"
843 " padding=%d bit%s, scanning=%d bit%s)\n",
844 format,
846 ? "most significant byte first"
847 : "least significant byte first",
849 ? "most significant bit first"
850 : "least significant bit first",
852 ( 8 << PCF_GLYPH_PAD_INDEX( format ) ) == 1 ? "" : "s",
854 ( 8 << PCF_SCAN_UNIT_INDEX( format ) ) == 1 ? "" : "s" ));
855
857 return FT_THROW( Invalid_File_Format );
858
859 FT_TRACE4(( " number of bitmaps: %ld\n", orig_nbitmaps ));
860
861 /* see comment in `pcf_get_metrics' */
862 if ( orig_nbitmaps > 65536 )
863 {
864 FT_TRACE0(( "pcf_get_bitmaps:"
865 " only loading first 65536 bitmaps\n" ));
866 nbitmaps = 65536;
867 }
868 else
869 nbitmaps = orig_nbitmaps;
870
871 if ( nbitmaps != face->nmetrics )
872 return FT_THROW( Invalid_File_Format );
873
874 if ( FT_NEW_ARRAY( offsets, nbitmaps ) )
875 return error;
876
877 FT_TRACE5(( "\n" ));
878 for ( i = 0; i < nbitmaps; i++ )
879 {
880 if ( PCF_BYTE_ORDER( format ) == MSBFirst )
882 else
883 (void)FT_READ_ULONG_LE( offsets[i] );
884
885 FT_TRACE5(( " bitmap %lu: offset %lu (0x%lX)\n",
886 i, offsets[i], offsets[i] ));
887 }
888 if ( error )
889 goto Bail;
890
891 for ( i = 0; i < GLYPHPADOPTIONS; i++ )
892 {
893 if ( PCF_BYTE_ORDER( format ) == MSBFirst )
894 (void)FT_READ_ULONG( bitmapSizes[i] );
895 else
896 (void)FT_READ_ULONG_LE( bitmapSizes[i] );
897 if ( error )
898 goto Bail;
899
900 sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX( format )];
901
902 FT_TRACE4(( " %ld-bit padding implies a size of %lu\n",
903 8 << i, bitmapSizes[i] ));
904 }
905
906 FT_TRACE4(( " %lu bitmaps, using %ld-bit padding\n",
907 nbitmaps,
908 8 << PCF_GLYPH_PAD_INDEX( format ) ));
909 FT_TRACE4(( " bitmap size: %lu\n", sizebitmaps ));
910
911 FT_UNUSED( sizebitmaps ); /* only used for debugging */
912
913 /* right now, we only check the bitmap offsets; */
914 /* actual bitmaps are only loaded on demand */
915 for ( i = 0; i < nbitmaps; i++ )
916 {
917 /* rough estimate */
918 if ( offsets[i] > size )
919 {
920 FT_TRACE0(( "pcf_get_bitmaps:"
921 " invalid offset to bitmap data of glyph %lu\n", i ));
922 }
923 else
924 face->metrics[i].bits = stream->pos + offsets[i];
925 }
926
927 face->bitmapsFormat = format;
928
929 Bail:
930 FT_FREE( offsets );
931 return error;
932 }
#define FT_UNUSED(arg)
Definition: ftconfig.h:100
#define FT_THROW(e)
Definition: ftdebug.h:241
#define FT_NEW_ARRAY(ptr, count)
Definition: ftmemory.h:332
#define FT_FREE(ptr)
Definition: ftmemory.h:328
#define FT_FACE(x)
Definition: ftobjs.h:599
#define FT_GET_ULONG_LE()
Definition: ftstream.h:310
#define FT_GET_ULONG()
Definition: ftstream.h:304
#define FT_READ_ULONG(var)
Definition: ftstream.h:332
FT_Stream_EnterFrame(FT_Stream stream, FT_ULong count)
Definition: ftstream.c:235
FT_Stream_ExitFrame(FT_Stream stream)
Definition: ftstream.c:318
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:65
static const FxOffsetAndName offsets[]
static char memory[1024 *256]
Definition: process.c:116
#define GLYPHPADOPTIONS
Definition: pcf.h:239
#define PCF_BITMAPS
Definition: pcf.h:232
#define PCF_GLYPH_PAD_INDEX(f)
Definition: pcf.h:206
#define PCF_SCAN_UNIT_INDEX(f)
Definition: pcf.h:210
#define PCF_BIT_ORDER(f)
Definition: pcf.h:204
ULARGE_INTEGER pos
Definition: request.c:4380

Referenced by pcf_load_font().

◆ pcf_get_encodings()

static FT_Error pcf_get_encodings ( FT_Stream  stream,
PCF_Face  face 
)
static

Definition at line 974 of file pcfread.c.

976 {
978 FT_Memory memory = FT_FACE( face )->memory;
980 PCF_Enc enc = &face->enc;
981 FT_ULong nencoding;
983 FT_UShort defaultCharRow, defaultCharCol;
984 FT_UShort encodingOffset, defaultCharEncodingOffset;
985 FT_UShort i, j;
986 FT_Byte* pos;
987
988
990 face->toc.tables,
991 face->toc.count,
993 &format,
994 &size );
995 if ( error )
996 goto Bail;
997
998 if ( FT_READ_ULONG_LE( format ) )
999 goto Bail;
1000
1001 FT_TRACE4(( "pcf_get_encodings:\n"
1002 " format: 0x%lX (%s)\n",
1003 format,
1004 PCF_BYTE_ORDER( format ) == MSBFirst ? "MSB" : "LSB" ));
1005
1008 return FT_THROW( Invalid_File_Format );
1009
1010 if ( PCF_BYTE_ORDER( format ) == MSBFirst )
1011 {
1013 goto Bail;
1014 }
1015 else
1016 {
1018 goto Bail;
1019 }
1020
1021 FT_TRACE4(( " firstCol 0x%X, lastCol 0x%X\n"
1022 " firstRow 0x%X, lastRow 0x%X\n"
1023 " defaultChar 0x%X\n",
1024 enc->firstCol, enc->lastCol,
1025 enc->firstRow, enc->lastRow,
1026 enc->defaultChar ));
1027
1028 /* sanity checks; we limit numbers of rows and columns to 256 */
1029 if ( enc->firstCol > enc->lastCol ||
1030 enc->lastCol > 0xFF ||
1031 enc->firstRow > enc->lastRow ||
1032 enc->lastRow > 0xFF )
1033 return FT_THROW( Invalid_Table );
1034
1035 nencoding = (FT_ULong)( enc->lastCol - enc->firstCol + 1 ) *
1036 (FT_ULong)( enc->lastRow - enc->firstRow + 1 );
1037
1038 if ( FT_NEW_ARRAY( enc->offset, nencoding ) )
1039 goto Bail;
1040
1041 error = FT_Stream_EnterFrame( stream, 2 * nencoding );
1042 if ( error )
1043 goto Exit;
1044
1045 FT_TRACE5(( "\n" ));
1046
1047 defaultCharRow = enc->defaultChar >> 8;
1048 defaultCharCol = enc->defaultChar & 0xFF;
1049
1050 /* validate default character */
1051 if ( defaultCharRow < enc->firstRow ||
1052 defaultCharRow > enc->lastRow ||
1053 defaultCharCol < enc->firstCol ||
1054 defaultCharCol > enc->lastCol )
1055 {
1056 enc->defaultChar = enc->firstRow * 256U + enc->firstCol;
1057 FT_TRACE0(( "pcf_get_encodings:"
1058 " Invalid default character set to %u\n",
1059 enc->defaultChar ));
1060
1061 defaultCharRow = enc->firstRow;
1062 defaultCharCol = enc->firstCol;
1063 }
1064
1065 /* FreeType mandates that glyph index 0 is the `undefined glyph', */
1066 /* which PCF calls the `default character'. For this reason, we */
1067 /* swap the positions of glyph index 0 and the index corresponding */
1068 /* to `defaultChar' in case they are different. */
1069
1070 /* `stream->cursor' still points at the beginning of the frame; */
1071 /* we can thus easily get the offset to the default character */
1072 pos = stream->cursor +
1073 2 * ( ( defaultCharRow - enc->firstRow ) *
1074 ( enc->lastCol - enc->firstCol + 1 ) +
1075 defaultCharCol - enc->firstCol );
1076
1077 if ( PCF_BYTE_ORDER( format ) == MSBFirst )
1078 defaultCharEncodingOffset = FT_PEEK_USHORT( pos );
1079 else
1080 defaultCharEncodingOffset = FT_PEEK_USHORT_LE( pos );
1081
1082 if ( defaultCharEncodingOffset >= face->nmetrics )
1083 {
1084 FT_TRACE0(( "pcf_get_encodings:"
1085 " Invalid glyph index for default character,"
1086 " setting to zero\n" ));
1087 defaultCharEncodingOffset = 0;
1088 }
1089
1090 if ( defaultCharEncodingOffset )
1091 {
1092 /* do the swapping */
1093 PCF_MetricRec tmp = face->metrics[defaultCharEncodingOffset];
1094
1095
1096 face->metrics[defaultCharEncodingOffset] = face->metrics[0];
1097 face->metrics[0] = tmp;
1098 }
1099
1100 offset = enc->offset;
1101 for ( i = enc->firstRow; i <= enc->lastRow; i++ )
1102 {
1103 for ( j = enc->firstCol; j <= enc->lastCol; j++ )
1104 {
1105 /* X11's reference implementation uses the equivalent to */
1106 /* `FT_GET_SHORT', however PCF fonts with more than 32768 */
1107 /* characters (e.g., `unifont.pcf') clearly show that an */
1108 /* unsigned value is needed. */
1109 if ( PCF_BYTE_ORDER( format ) == MSBFirst )
1110 encodingOffset = FT_GET_USHORT();
1111 else
1112 encodingOffset = FT_GET_USHORT_LE();
1113
1114 if ( encodingOffset != 0xFFFFU )
1115 {
1116 if ( encodingOffset == defaultCharEncodingOffset )
1117 encodingOffset = 0;
1118 else if ( encodingOffset == 0 )
1119 encodingOffset = defaultCharEncodingOffset;
1120 }
1121
1122 *offset++ = encodingOffset;
1123 }
1124 }
1126
1127 return error;
1128
1129 Exit:
1130 FT_FREE( enc->offset );
1131
1132 Bail:
1133 return error;
1134 }
#define FT_GET_USHORT_LE()
Definition: ftstream.h:308
#define FT_PEEK_USHORT(p)
Definition: ftstream.h:175
#define FT_PEEK_USHORT_LE(p)
Definition: ftstream.h:199
#define FT_GET_USHORT()
Definition: ftstream.h:300
unsigned char FT_Byte
Definition: fttypes.h:154
unsigned short FT_UShort
Definition: fttypes.h:209
GLintptr offset
Definition: glext.h:5920
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
Definition: glfuncs.h:250
#define PCF_BDF_ENCODINGS
Definition: pcf.h:234
static const FT_Frame_Field pcf_enc_msb_header[]
Definition: pcfread.c:958
static const FT_Frame_Field pcf_enc_header[]
Definition: pcfread.c:942
static void Exit(void)
Definition: sock.c:1330
FT_UShort * offset
Definition: pcf.h:115
FT_UShort firstCol
Definition: pcf.h:109
FT_UShort firstRow
Definition: pcf.h:111
FT_UShort lastRow
Definition: pcf.h:112
FT_UShort lastCol
Definition: pcf.h:110
FT_UShort defaultChar
Definition: pcf.h:113

Referenced by pcf_load_font().

◆ pcf_get_metric()

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

Definition at line 319 of file pcfread.c.

322 {
324
325
327 {
328 const FT_Frame_Field* fields;
329
330
331 /* parsing normal metrics */
335
336 /* the following sets `error' but doesn't return in case of failure */
338 }
339 else
340 {
342
343
344 /* parsing compressed metrics */
346 goto Exit;
347
348 metric->leftSideBearing = (FT_Short)( compr.leftSideBearing - 0x80 );
349 metric->rightSideBearing = (FT_Short)( compr.rightSideBearing - 0x80 );
350 metric->characterWidth = (FT_Short)( compr.characterWidth - 0x80 );
351 metric->ascent = (FT_Short)( compr.ascent - 0x80 );
352 metric->descent = (FT_Short)( compr.descent - 0x80 );
353 metric->attributes = 0;
354 }
355
356 FT_TRACE5(( " width=%d,"
357 " lsb=%d, rsb=%d,"
358 " ascent=%d, descent=%d,"
359 " attributes=%d\n",
360 metric->characterWidth,
361 metric->leftSideBearing,
362 metric->rightSideBearing,
363 metric->ascent,
364 metric->descent,
365 metric->attributes ));
366
367 Exit:
368 return error;
369 }
return FT_Err_Ok
Definition: ftbbox.c:527
signed short FT_Short
Definition: fttypes.h:198
const char * fields[10]
Definition: parser.c:313
static const FT_Frame_Field pcf_metric_msb_header[]
Definition: pcfread.c:284
static const FT_Frame_Field pcf_metric_header[]
Definition: pcfread.c:267
static const FT_Frame_Field pcf_compressed_metric_header[]
Definition: pcfread.c:303
FT_Short attributes
Definition: pcf.h:101
FT_Short characterWidth
Definition: pcf.h:98
FT_Short leftSideBearing
Definition: pcf.h:96
FT_Short ascent
Definition: pcf.h:99
FT_Short rightSideBearing
Definition: pcf.h:97
FT_Short descent
Definition: pcf.h:100
static int __cdecl compr(const void *a, const void *b)
Definition: bidi.c:641

Referenced by pcf_get_accel(), and pcf_get_metrics().

◆ pcf_get_metrics()

static FT_Error pcf_get_metrics ( FT_Stream  stream,
PCF_Face  face 
)
static

Definition at line 679 of file pcfread.c.

681 {
683 FT_Memory memory = FT_FACE( face )->memory;
686 FT_ULong nmetrics, orig_nmetrics, i;
687
688
690 face->toc.tables,
691 face->toc.count,
693 &format,
694 &size );
695 if ( error )
696 return error;
697
698 if ( FT_READ_ULONG_LE( format ) )
699 goto Bail;
700
701 FT_TRACE4(( "pcf_get_metrics:\n"
702 " format: 0x%lX (%s, %s)\n",
703 format,
704 PCF_BYTE_ORDER( format ) == MSBFirst ? "MSB" : "LSB",
706 "compressed" : "uncompressed" ));
707
710 return FT_THROW( Invalid_File_Format );
711
713 {
714 if ( PCF_BYTE_ORDER( format ) == MSBFirst )
715 (void)FT_READ_ULONG( orig_nmetrics );
716 else
717 (void)FT_READ_ULONG_LE( orig_nmetrics );
718 }
719 else
720 {
721 if ( PCF_BYTE_ORDER( format ) == MSBFirst )
722 (void)FT_READ_USHORT( orig_nmetrics );
723 else
724 (void)FT_READ_USHORT_LE( orig_nmetrics );
725 }
726 if ( error )
727 return FT_THROW( Invalid_File_Format );
728
729 FT_TRACE4(( " number of metrics: %ld\n", orig_nmetrics ));
730
731 /* rough estimate */
733 {
734 if ( orig_nmetrics > size / PCF_METRIC_SIZE )
735 return FT_THROW( Invalid_Table );
736 }
737 else
738 {
739 if ( orig_nmetrics > size / PCF_COMPRESSED_METRIC_SIZE )
740 return FT_THROW( Invalid_Table );
741 }
742
743 if ( !orig_nmetrics )
744 return FT_THROW( Invalid_Table );
745
746 /* PCF is a format from ancient times; Unicode was in its */
747 /* infancy, and widely used two-byte character sets for CJK */
748 /* scripts (Big 5, GB 2312, JIS X 0208, etc.) did have at most */
749 /* 15000 characters. Even the more exotic CNS 11643 and CCCII */
750 /* standards, which were essentially three-byte character sets, */
751 /* provided less then 65536 assigned characters. */
752 /* */
753 /* While technically possible to have a larger number of glyphs */
754 /* in PCF files, we thus limit the number to 65536. */
755 if ( orig_nmetrics > 65536 )
756 {
757 FT_TRACE0(( "pcf_get_metrics:"
758 " only loading first 65536 metrics\n" ));
759 nmetrics = 65536;
760 }
761 else
762 nmetrics = orig_nmetrics;
763
764 face->nmetrics = nmetrics;
765
766 if ( FT_NEW_ARRAY( face->metrics, nmetrics ) )
767 return error;
768
769 metrics = face->metrics;
770
771 FT_TRACE4(( "\n" ));
772 for ( i = 0; i < nmetrics; i++, metrics++ )
773 {
774 FT_TRACE5(( " idx %ld:", i ));
776
777 metrics->bits = 0;
778
779 if ( error )
780 break;
781
782 /* sanity checks -- those values are used in `PCF_Glyph_Load' to */
783 /* compute a glyph's bitmap dimensions, thus setting them to zero in */
784 /* case of an error disables this particular glyph only */
785 if ( metrics->rightSideBearing < metrics->leftSideBearing ||
786 metrics->ascent < -metrics->descent )
787 {
788 metrics->characterWidth = 0;
789 metrics->leftSideBearing = 0;
790 metrics->rightSideBearing = 0;
791 metrics->ascent = 0;
792 metrics->descent = 0;
793
794 FT_TRACE0(( "pcf_get_metrics:"
795 " invalid metrics for glyph %d\n", i ));
796 }
797 }
798
799 if ( error )
800 FT_FREE( face->metrics );
801
802 Bail:
803 return error;
804 }
#define FT_READ_USHORT(var)
Definition: ftstream.h:328
#define FT_READ_USHORT_LE(var)
Definition: ftstream.h:335
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
Definition: glext.h:11745
#define PCF_COMPRESSED_METRICS
Definition: pcf.h:192
#define PCF_METRICS
Definition: pcf.h:231
#define PCF_METRIC_SIZE
Definition: pcfread.c:264
#define PCF_COMPRESSED_METRIC_SIZE
Definition: pcfread.c:300

Referenced by pcf_load_font().

◆ pcf_get_properties()

static FT_Error pcf_get_properties ( FT_Stream  stream,
PCF_Face  face 
)
static

Definition at line 480 of file pcfread.c.

482 {
484 PCF_Property properties = NULL;
485 FT_ULong nprops, orig_nprops, i;
488 FT_Memory memory = FT_FACE( face )->memory;
489 FT_ULong string_size;
491
492
494 face->toc.tables,
495 face->toc.count,
497 &format,
498 &size );
499 if ( error )
500 goto Bail;
501
502 if ( FT_READ_ULONG_LE( format ) )
503 goto Bail;
504
505 FT_TRACE4(( "pcf_get_properties:\n"
506 " format: 0x%lX (%s)\n",
507 format,
508 PCF_BYTE_ORDER( format ) == MSBFirst ? "MSB" : "LSB" ));
509
511 goto Bail;
512
513 if ( PCF_BYTE_ORDER( format ) == MSBFirst )
514 (void)FT_READ_ULONG( orig_nprops );
515 else
516 (void)FT_READ_ULONG_LE( orig_nprops );
517 if ( error )
518 goto Bail;
519
520 FT_TRACE4(( " number of properties: %ld\n", orig_nprops ));
521
522 /* rough estimate */
523 if ( orig_nprops > size / PCF_PROPERTY_SIZE )
524 {
525 error = FT_THROW( Invalid_Table );
526 goto Bail;
527 }
528
529 /* as a heuristic limit to avoid excessive allocation in */
530 /* gzip bombs (i.e., very small, invalid input data that */
531 /* pretends to expand to an insanely large file) we only */
532 /* load the first 256 properties */
533 if ( orig_nprops > 256 )
534 {
535 FT_TRACE0(( "pcf_get_properties:"
536 " only loading first 256 properties\n" ));
537 nprops = 256;
538 }
539 else
540 nprops = orig_nprops;
541
542 face->nprops = (int)nprops;
543
544 if ( FT_NEW_ARRAY( props, nprops ) )
545 goto Bail;
546
547 for ( i = 0; i < nprops; i++ )
548 {
549 if ( PCF_BYTE_ORDER( format ) == MSBFirst )
550 {
552 goto Bail;
553 }
554 else
555 {
557 goto Bail;
558 }
559 }
560
561 /* this skip will only work if we really have an extremely large */
562 /* number of properties; it will fail for fake data, avoiding an */
563 /* unnecessarily large allocation later on */
564 if ( FT_STREAM_SKIP( ( orig_nprops - nprops ) * PCF_PROPERTY_SIZE ) )
565 {
566 error = FT_THROW( Invalid_Stream_Skip );
567 goto Bail;
568 }
569
570 /* pad the property array */
571 /* */
572 /* clever here - nprops is the same as the number of odd-units read, */
573 /* as only isStringProp are odd length (Keith Packard) */
574 /* */
575 if ( orig_nprops & 3 )
576 {
577 i = 4 - ( orig_nprops & 3 );
578 if ( FT_STREAM_SKIP( i ) )
579 {
580 error = FT_THROW( Invalid_Stream_Skip );
581 goto Bail;
582 }
583 }
584
585 if ( PCF_BYTE_ORDER( format ) == MSBFirst )
586 (void)FT_READ_ULONG( string_size );
587 else
588 (void)FT_READ_ULONG_LE( string_size );
589 if ( error )
590 goto Bail;
591
592 FT_TRACE4(( " string size: %ld\n", string_size ));
593
594 /* rough estimate */
595 if ( string_size > size - orig_nprops * PCF_PROPERTY_SIZE )
596 {
597 error = FT_THROW( Invalid_Table );
598 goto Bail;
599 }
600
601 /* the strings in the `strings' array are PostScript strings, */
602 /* which can have a maximum length of 65536 characters each */
603 if ( string_size > 16777472 ) /* 256 * (65536 + 1) */
604 {
605 FT_TRACE0(( "pcf_get_properties:"
606 " loading only 16777472 bytes of strings array\n" ));
607 string_size = 16777472;
608 }
609
610 /* allocate one more byte so that we have a final null byte */
611 if ( FT_NEW_ARRAY( strings, string_size + 1 ) )
612 goto Bail;
613
614 error = FT_Stream_Read( stream, (FT_Byte*)strings, string_size );
615 if ( error )
616 goto Bail;
617
618 if ( FT_NEW_ARRAY( properties, nprops ) )
619 goto Bail;
620
621 face->properties = properties;
622
623 FT_TRACE4(( "\n" ));
624 for ( i = 0; i < nprops; i++ )
625 {
626 FT_Long name_offset = props[i].name;
627
628
629 if ( ( name_offset < 0 ) ||
630 ( (FT_ULong)name_offset > string_size ) )
631 {
632 error = FT_THROW( Invalid_Offset );
633 goto Bail;
634 }
635
636 if ( FT_STRDUP( properties[i].name, strings + name_offset ) )
637 goto Bail;
638
639 FT_TRACE4(( " %s:", properties[i].name ));
640
641 properties[i].isString = props[i].isString;
642
643 if ( props[i].isString )
644 {
645 FT_Long value_offset = props[i].value;
646
647
648 if ( ( value_offset < 0 ) ||
649 ( (FT_ULong)value_offset > string_size ) )
650 {
651 error = FT_THROW( Invalid_Offset );
652 goto Bail;
653 }
654
655 if ( FT_STRDUP( properties[i].value.atom, strings + value_offset ) )
656 goto Bail;
657
658 FT_TRACE4(( " `%s'\n", properties[i].value.atom ));
659 }
660 else
661 {
662 properties[i].value.l = props[i].value;
663
664 FT_TRACE4(( " %d\n", properties[i].value.l ));
665 }
666 }
667
669
670 Bail:
671 FT_FREE( props );
672 FT_FREE( strings );
673
674 return error;
675 }
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define FT_STRDUP(dst, str)
Definition: ftmemory.h:363
#define FT_STREAM_SKIP(distance)
Definition: ftstream.h:518
FT_Stream_Read(FT_Stream stream, FT_Byte *buffer, FT_ULong count)
Definition: ftstream.c:110
signed long FT_Long
Definition: fttypes.h:242
char FT_String
Definition: fttypes.h:187
GLsizei const GLchar *const * strings
Definition: glext.h:7622
#define PCF_PROPERTIES
Definition: pcf.h:229
static const FT_Frame_Field pcf_property_header[]
Definition: pcfread.c:430
static const FT_Frame_Field pcf_property_msb_header[]
Definition: pcfread.c:444
#define PCF_PROPERTY_SIZE
Definition: pcfread.c:427
FT_Long l
Definition: pcf.h:75
union PCF_PropertyRec_::@4376 value
FT_Byte isString
Definition: pcf.h:70
Definition: pdh_main.c:96
static const WCHAR props[]
Definition: wbemdisp.c:288

Referenced by pcf_load_font().

◆ pcf_has_table_type()

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

Definition at line 412 of file pcfread.c.

415 {
416 FT_ULong i;
417
418
419 for ( i = 0; i < ntables; i++ )
420 if ( tables[i].type == type )
421 return TRUE;
422
423 return FALSE;
424 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
struct nls_table * tables
Definition: nls_base.c:22

Referenced by pcf_load_font().

◆ pcf_interpret_style()

static FT_Error pcf_interpret_style ( PCF_Face  pcf)
static

Definition at line 1298 of file pcfread.c.

1299 {
1301 FT_Face face = FT_FACE( pcf );
1302 FT_Memory memory = face->memory;
1303
1304 PCF_Property prop;
1305
1306 size_t nn, len;
1307 char* strings[4] = { NULL, NULL, NULL, NULL };
1308 size_t lengths[4];
1309
1310
1311 face->style_flags = 0;
1312
1313 prop = pcf_find_property( pcf, "SLANT" );
1314 if ( prop && prop->isString &&
1315 ( *(prop->value.atom) == 'O' || *(prop->value.atom) == 'o' ||
1316 *(prop->value.atom) == 'I' || *(prop->value.atom) == 'i' ) )
1317 {
1318 face->style_flags |= FT_STYLE_FLAG_ITALIC;
1319 strings[2] = ( *(prop->value.atom) == 'O' ||
1320 *(prop->value.atom) == 'o' ) ? (char *)"Oblique"
1321 : (char *)"Italic";
1322 }
1323
1324 prop = pcf_find_property( pcf, "WEIGHT_NAME" );
1325 if ( prop && prop->isString &&
1326 ( *(prop->value.atom) == 'B' || *(prop->value.atom) == 'b' ) )
1327 {
1328 face->style_flags |= FT_STYLE_FLAG_BOLD;
1329 strings[1] = (char*)"Bold";
1330 }
1331
1332 prop = pcf_find_property( pcf, "SETWIDTH_NAME" );
1333 if ( prop && prop->isString &&
1334 *(prop->value.atom) &&
1335 !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) )
1336 strings[3] = (char*)( prop->value.atom );
1337
1338 prop = pcf_find_property( pcf, "ADD_STYLE_NAME" );
1339 if ( prop && prop->isString &&
1340 *(prop->value.atom) &&
1341 !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) )
1342 strings[0] = (char*)( prop->value.atom );
1343
1344 for ( len = 0, nn = 0; nn < 4; nn++ )
1345 {
1346 lengths[nn] = 0;
1347 if ( strings[nn] )
1348 {
1349 lengths[nn] = ft_strlen( strings[nn] );
1350 len += lengths[nn] + 1;
1351 }
1352 }
1353
1354 if ( len == 0 )
1355 {
1356 strings[0] = (char*)"Regular";
1357 lengths[0] = ft_strlen( strings[0] );
1358 len = lengths[0] + 1;
1359 }
1360
1361 {
1362 char* s;
1363
1364
1365 if ( FT_ALLOC( face->style_name, len ) )
1366 return error;
1367
1368 s = face->style_name;
1369
1370 for ( nn = 0; nn < 4; nn++ )
1371 {
1372 char* src = strings[nn];
1373
1374
1375 len = lengths[nn];
1376
1377 if ( !src )
1378 continue;
1379
1380 /* separate elements with a space */
1381 if ( s != face->style_name )
1382 *s++ = ' ';
1383
1384 ft_memcpy( s, src, len );
1385
1386 /* need to convert spaces to dashes for */
1387 /* add_style_name and setwidth_name */
1388 if ( nn == 0 || nn == 3 )
1389 {
1390 size_t mm;
1391
1392
1393 for ( mm = 0; mm < len; mm++ )
1394 if ( s[mm] == ' ' )
1395 s[mm] = '-';
1396 }
1397
1398 s += len;
1399 }
1400 *s = 0;
1401 }
1402
1403 return error;
1404 }
#define FT_STYLE_FLAG_ITALIC
Definition: freetype.h:1488
#define FT_STYLE_FLAG_BOLD
Definition: freetype.h:1489
#define FT_ALLOC(ptr, size)
Definition: ftmemory.h:302
#define ft_memcpy
Definition: ftstdlib.h:82
#define ft_strlen
Definition: ftstdlib.h:88
GLdouble s
Definition: gl.h:2039
GLenum src
Definition: glext.h:6340
GLsizei GLenum GLenum GLuint GLenum GLsizei * lengths
Definition: glext.h:7753
GLenum GLsizei len
Definition: glext.h:6722
pcf_find_property(PCF_Face face, const FT_String *prop)
Definition: pcfread.c:458
FT_String * atom
Definition: pcf.h:74

Referenced by pcf_load_font().

◆ pcf_load_font()

pcf_load_font ( FT_Stream  stream,
PCF_Face  face,
FT_Long  face_index 
)

Definition at line 1408 of file pcfread.c.

1411 {
1412 FT_Face root = FT_FACE( face );
1414 FT_Memory memory = FT_FACE( face )->memory;
1415 FT_Bool hasBDFAccelerators;
1416
1417
1419 if ( error )
1420 goto Exit;
1421
1422 root->num_faces = 1;
1423 root->face_index = 0;
1424
1425 /* If we are performing a simple font format check, exit immediately. */
1426 if ( face_index < 0 )
1427 return FT_Err_Ok;
1428
1430 if ( error )
1431 goto Exit;
1432
1433 /* Use the old accelerators if no BDF accelerators are in the file. */
1434 hasBDFAccelerators = pcf_has_table_type( face->toc.tables,
1435 face->toc.count,
1437 if ( !hasBDFAccelerators )
1438 {
1440 if ( error )
1441 goto Exit;
1442 }
1443
1444 /* metrics */
1446 if ( error )
1447 goto Exit;
1448
1449 /* bitmaps */
1451 if ( error )
1452 goto Exit;
1453
1454 /* encodings */
1456 if ( error )
1457 goto Exit;
1458
1459 /* BDF style accelerators (i.e. bounds based on encoded glyphs) */
1460 if ( hasBDFAccelerators )
1461 {
1463 if ( error )
1464 goto Exit;
1465 }
1466
1467 /* XXX: TO DO: inkmetrics and glyph_names are missing */
1468
1469 /* now construct the face object */
1470 {
1471 PCF_Property prop;
1472
1473
1474 root->face_flags |= FT_FACE_FLAG_FIXED_SIZES |
1476
1477 if ( face->accel.constantWidth )
1478 root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
1479
1481 goto Exit;
1482
1483 prop = pcf_find_property( face, "FAMILY_NAME" );
1484 if ( prop && prop->isString )
1485 {
1486
1487#ifdef PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
1488
1490
1491
1492 if ( !driver->no_long_family_names )
1493 {
1494 /* Prepend the foundry name plus a space to the family name. */
1495 /* There are many fonts just called `Fixed' which look */
1496 /* completely different, and which have nothing to do with each */
1497 /* other. When selecting `Fixed' in KDE or Gnome one gets */
1498 /* results that appear rather random, the style changes often if */
1499 /* one changes the size and one cannot select some fonts at all. */
1500 /* */
1501 /* We also check whether we have `wide' characters; all put */
1502 /* together, we get family names like `Sony Fixed' or `Misc */
1503 /* Fixed Wide'. */
1504
1505 PCF_Property foundry_prop, point_size_prop, average_width_prop;
1506
1507 int l = ft_strlen( prop->value.atom ) + 1;
1508 int wide = 0;
1509
1510
1511 foundry_prop = pcf_find_property( face, "FOUNDRY" );
1512 point_size_prop = pcf_find_property( face, "POINT_SIZE" );
1513 average_width_prop = pcf_find_property( face, "AVERAGE_WIDTH" );
1514
1515 if ( point_size_prop && average_width_prop )
1516 {
1517 if ( average_width_prop->value.l >= point_size_prop->value.l )
1518 {
1519 /* This font is at least square shaped or even wider */
1520 wide = 1;
1521 l += ft_strlen( " Wide" );
1522 }
1523 }
1524
1525 if ( foundry_prop && foundry_prop->isString )
1526 {
1527 l += ft_strlen( foundry_prop->value.atom ) + 1;
1528
1529 if ( FT_NEW_ARRAY( root->family_name, l ) )
1530 goto Exit;
1531
1532 ft_strcpy( root->family_name, foundry_prop->value.atom );
1533 ft_strcat( root->family_name, " " );
1534 ft_strcat( root->family_name, prop->value.atom );
1535 }
1536 else
1537 {
1538 if ( FT_NEW_ARRAY( root->family_name, l ) )
1539 goto Exit;
1540
1541 ft_strcpy( root->family_name, prop->value.atom );
1542 }
1543
1544 if ( wide )
1545 ft_strcat( root->family_name, " Wide" );
1546 }
1547 else
1548
1549#endif /* PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
1550
1551 {
1552 if ( FT_STRDUP( root->family_name, prop->value.atom ) )
1553 goto Exit;
1554 }
1555 }
1556 else
1557 root->family_name = NULL;
1558
1559 root->num_glyphs = (FT_Long)face->nmetrics;
1560
1561 root->num_fixed_sizes = 1;
1562 if ( FT_NEW_ARRAY( root->available_sizes, 1 ) )
1563 goto Exit;
1564
1565 {
1566 FT_Bitmap_Size* bsize = root->available_sizes;
1567 FT_Short resolution_x = 0, resolution_y = 0;
1568
1569
1570 FT_ZERO( bsize );
1571
1572 /* for simplicity, we take absolute values of integer properties */
1573
1574#if 0
1575 bsize->height = face->accel.maxbounds.ascent << 6;
1576#endif
1577
1578#ifdef FT_DEBUG_LEVEL_TRACE
1579 if ( face->accel.fontAscent + face->accel.fontDescent < 0 )
1580 FT_TRACE0(( "pcf_load_font: negative height\n" ));
1581#endif
1582 if ( FT_ABS( face->accel.fontAscent +
1583 face->accel.fontDescent ) > 0x7FFF )
1584 {
1585 bsize->height = 0x7FFF;
1586 FT_TRACE0(( "pcf_load_font: clamping height to value %d\n",
1587 bsize->height ));
1588 }
1589 else
1590 bsize->height = FT_ABS( (FT_Short)( face->accel.fontAscent +
1591 face->accel.fontDescent ) );
1592
1593 prop = pcf_find_property( face, "AVERAGE_WIDTH" );
1594 if ( prop )
1595 {
1596#ifdef FT_DEBUG_LEVEL_TRACE
1597 if ( prop->value.l < 0 )
1598 FT_TRACE0(( "pcf_load_font: negative average width\n" ));
1599#endif
1600 if ( ( FT_ABS( prop->value.l ) > 0x7FFFL * 10 - 5 ) )
1601 {
1602 bsize->width = 0x7FFF;
1603 FT_TRACE0(( "pcf_load_font: clamping average width to value %d\n",
1604 bsize->width ));
1605 }
1606 else
1607 bsize->width = FT_ABS( (FT_Short)( ( prop->value.l + 5 ) / 10 ) );
1608 }
1609 else
1610 {
1611 /* this is a heuristical value */
1612 bsize->width = (FT_Short)FT_MulDiv( bsize->height, 2, 3 );
1613 }
1614
1615 prop = pcf_find_property( face, "POINT_SIZE" );
1616 if ( prop )
1617 {
1618#ifdef FT_DEBUG_LEVEL_TRACE
1619 if ( prop->value.l < 0 )
1620 FT_TRACE0(( "pcf_load_font: negative point size\n" ));
1621#endif
1622 /* convert from 722.7 decipoints to 72 points per inch */
1623 if ( FT_ABS( prop->value.l ) > 0x504C2L ) /* 0x7FFF * 72270/7200 */
1624 {
1625 bsize->size = 0x7FFF;
1626 FT_TRACE0(( "pcf_load_font: clamping point size to value %d\n",
1627 bsize->size ));
1628 }
1629 else
1630 bsize->size = FT_MulDiv( FT_ABS( prop->value.l ),
1631 64 * 7200,
1632 72270L );
1633 }
1634
1635 prop = pcf_find_property( face, "PIXEL_SIZE" );
1636 if ( prop )
1637 {
1638#ifdef FT_DEBUG_LEVEL_TRACE
1639 if ( prop->value.l < 0 )
1640 FT_TRACE0(( "pcf_load_font: negative pixel size\n" ));
1641#endif
1642 if ( FT_ABS( prop->value.l ) > 0x7FFF )
1643 {
1644 bsize->y_ppem = 0x7FFF << 6;
1645 FT_TRACE0(( "pcf_load_font: clamping pixel size to value %d\n",
1646 bsize->y_ppem ));
1647 }
1648 else
1649 bsize->y_ppem = FT_ABS( (FT_Short)prop->value.l ) << 6;
1650 }
1651
1652 prop = pcf_find_property( face, "RESOLUTION_X" );
1653 if ( prop )
1654 {
1655#ifdef FT_DEBUG_LEVEL_TRACE
1656 if ( prop->value.l < 0 )
1657 FT_TRACE0(( "pcf_load_font: negative X resolution\n" ));
1658#endif
1659 if ( FT_ABS( prop->value.l ) > 0x7FFF )
1660 {
1661 resolution_x = 0x7FFF;
1662 FT_TRACE0(( "pcf_load_font: clamping X resolution to value %d\n",
1663 resolution_x ));
1664 }
1665 else
1666 resolution_x = FT_ABS( (FT_Short)prop->value.l );
1667 }
1668
1669 prop = pcf_find_property( face, "RESOLUTION_Y" );
1670 if ( prop )
1671 {
1672#ifdef FT_DEBUG_LEVEL_TRACE
1673 if ( prop->value.l < 0 )
1674 FT_TRACE0(( "pcf_load_font: negative Y resolution\n" ));
1675#endif
1676 if ( FT_ABS( prop->value.l ) > 0x7FFF )
1677 {
1678 resolution_y = 0x7FFF;
1679 FT_TRACE0(( "pcf_load_font: clamping Y resolution to value %d\n",
1680 resolution_y ));
1681 }
1682 else
1683 resolution_y = FT_ABS( (FT_Short)prop->value.l );
1684 }
1685
1686 if ( bsize->y_ppem == 0 )
1687 {
1688 bsize->y_ppem = bsize->size;
1689 if ( resolution_y )
1690 bsize->y_ppem = FT_MulDiv( bsize->y_ppem, resolution_y, 72 );
1691 }
1692 if ( resolution_x && resolution_y )
1693 bsize->x_ppem = FT_MulDiv( bsize->y_ppem,
1694 resolution_x,
1695 resolution_y );
1696 else
1697 bsize->x_ppem = bsize->y_ppem;
1698 }
1699
1700 /* set up charset */
1701 {
1702 PCF_Property charset_registry, charset_encoding;
1703
1704
1705 charset_registry = pcf_find_property( face, "CHARSET_REGISTRY" );
1706 charset_encoding = pcf_find_property( face, "CHARSET_ENCODING" );
1707
1708 if ( charset_registry && charset_registry->isString &&
1709 charset_encoding && charset_encoding->isString )
1710 {
1711 if ( FT_STRDUP( face->charset_encoding,
1712 charset_encoding->value.atom ) ||
1713 FT_STRDUP( face->charset_registry,
1714 charset_registry->value.atom ) )
1715 goto Exit;
1716 }
1717 }
1718 }
1719
1720 Exit:
1721 if ( error )
1722 {
1723 /* This is done to respect the behaviour of the original */
1724 /* PCF font driver. */
1725 error = FT_THROW( Invalid_File_Format );
1726 }
1727
1728 return error;
1729 }
r l[0]
Definition: byte_order.h:168
#define FT_FACE_FLAG_FIXED_SIZES
Definition: freetype.h:1211
#define FT_FACE_FLAG_FIXED_WIDTH
Definition: freetype.h:1212
#define FT_FACE_FLAG_HORIZONTAL
Definition: freetype.h:1214
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
Definition: ftcalc.c:416
#define FT_SET_ERROR(expression)
Definition: ftmemory.h:42
#define FT_ZERO(p)
Definition: ftmemory.h:237
#define FT_FACE_DRIVER(x)
Definition: ftobjs.h:603
#define ft_strcat
Definition: ftstdlib.h:85
#define ft_strcpy
Definition: ftstdlib.h:87
if(dx< 0)
Definition: linetemp.h:194
struct @1708::@1709 driver
struct PCF_DriverRec_ * PCF_Driver
#define PCF_ACCELERATORS
Definition: pcf.h:230
static FT_Error pcf_get_properties(FT_Stream stream, PCF_Face face)
Definition: pcfread.c:480
static FT_Error pcf_get_encodings(FT_Stream stream, PCF_Face face)
Definition: pcfread.c:974
static FT_Bool pcf_has_table_type(PCF_Table tables, FT_ULong ntables, FT_ULong type)
Definition: pcfread.c:412
static FT_Error pcf_get_bitmaps(FT_Stream stream, PCF_Face face)
Definition: pcfread.c:808
static FT_Error pcf_get_accel(FT_Stream stream, PCF_Face face, FT_ULong type)
Definition: pcfread.c:1182
static FT_Error pcf_interpret_style(PCF_Face pcf)
Definition: pcfread.c:1298
static FT_Error pcf_read_TOC(FT_Stream stream, PCF_Face face)
Definition: pcfread.c:95
static FT_Error pcf_get_metrics(FT_Stream stream, PCF_Face face)
Definition: pcfread.c:679
FT_Pos y_ppem
Definition: freetype.h:379
FT_Pos x_ppem
Definition: freetype.h:378
FT_Short width
Definition: freetype.h:374
FT_Short height
Definition: freetype.h:373

Referenced by PCF_Face_Init().

◆ pcf_read_TOC()

static FT_Error pcf_read_TOC ( FT_Stream  stream,
PCF_Face  face 
)
static

Definition at line 95 of file pcfread.c.

97 {
99 PCF_Toc toc = &face->toc;
101
102 FT_Memory memory = FT_FACE( face )->memory;
103 FT_UInt n;
104
106
107
108 if ( FT_STREAM_SEEK( 0 ) ||
110 return FT_THROW( Cannot_Open_Resource );
111
112 if ( toc->version != PCF_FILE_VERSION ||
113 toc->count == 0 )
114 return FT_THROW( Invalid_File_Format );
115
116 if ( stream->size < 16 )
117 return FT_THROW( Invalid_File_Format );
118
119 /* we need 16 bytes per TOC entry, */
120 /* and there can be most 9 tables */
121 if ( toc->count > ( stream->size >> 4 ) ||
122 toc->count > 9 )
123 {
124 FT_TRACE0(( "pcf_read_TOC: adjusting number of tables"
125 " (from %d to %d)\n",
126 toc->count,
127 FT_MIN( stream->size >> 4, 9 ) ));
128 toc->count = FT_MIN( stream->size >> 4, 9 );
129 }
130
131 if ( FT_NEW_ARRAY( face->toc.tables, toc->count ) )
132 return error;
133
134 tables = face->toc.tables;
135 for ( n = 0; n < toc->count; n++ )
136 {
138 goto Exit;
139 tables++;
140 }
141
142 /* Sort tables and check for overlaps. Because they are almost */
143 /* always ordered already, an in-place bubble sort with simultaneous */
144 /* boundary checking seems appropriate. */
145 tables = face->toc.tables;
146
147 for ( n = 0; n < toc->count - 1; n++ )
148 {
149 FT_UInt i, have_change;
150
151
152 have_change = 0;
153
154 for ( i = 0; i < toc->count - 1 - n; i++ )
155 {
156 PCF_TableRec tmp;
157
158
159 if ( tables[i].offset > tables[i + 1].offset )
160 {
161 tmp = tables[i];
162 tables[i] = tables[i + 1];
163 tables[i + 1] = tmp;
164
165 have_change = 1;
166 }
167
168 if ( ( tables[i].size > tables[i + 1].offset ) ||
169 ( tables[i].offset > tables[i + 1].offset - tables[i].size ) )
170 {
171 error = FT_THROW( Invalid_Offset );
172 goto Exit;
173 }
174 }
175
176 if ( !have_change )
177 break;
178 }
179
180 /*
181 * We now check whether the `size' and `offset' values are reasonable:
182 * `offset' + `size' must not exceed the stream size.
183 *
184 * Note, however, that X11's `pcfWriteFont' routine (used by the
185 * `bdftopcf' program to create PCF font files) has two special
186 * features.
187 *
188 * - It always assigns the accelerator table a size of 100 bytes in the
189 * TOC, regardless of its real size, which can vary between 34 and 72
190 * bytes.
191 *
192 * - Due to the way the routine is designed, it ships out the last font
193 * table with its real size, ignoring the TOC's size value. Since
194 * the TOC size values are always rounded up to a multiple of 4, the
195 * difference can be up to three bytes for all tables except the
196 * accelerator table, for which the difference can be as large as 66
197 * bytes.
198 *
199 */
200
201 tables = face->toc.tables;
202 size = stream->size;
203
204 for ( n = 0; n < toc->count - 1; n++ )
205 {
206 /* we need two checks to avoid overflow */
207 if ( ( tables->size > size ) ||
208 ( tables->offset > size - tables->size ) )
209 {
210 error = FT_THROW( Invalid_Table );
211 goto Exit;
212 }
213 tables++;
214 }
215
216 /* only check `tables->offset' for last table element ... */
217 if ( ( tables->offset > size ) )
218 {
219 error = FT_THROW( Invalid_Table );
220 goto Exit;
221 }
222 /* ... and adjust `tables->size' to the real value if necessary */
223 if ( tables->size > size - tables->offset )
224 tables->size = size - tables->offset;
225
226#ifdef FT_DEBUG_LEVEL_TRACE
227
228 {
229 FT_UInt i, j;
230 const char* name = "?";
231
232
233 FT_TRACE4(( "pcf_read_TOC:\n" ));
234
235 FT_TRACE4(( " number of tables: %ld\n", face->toc.count ));
236
237 tables = face->toc.tables;
238 for ( i = 0; i < toc->count; i++ )
239 {
240 for ( j = 0; j < sizeof ( tableNames ) / sizeof ( tableNames[0] );
241 j++ )
242 if ( tables[i].type == (FT_UInt)( 1 << j ) )
243 name = tableNames[j];
244
245 FT_TRACE4(( " %d: type=%s, format=0x%X,"
246 " size=%ld (0x%lX), offset=%ld (0x%lX)\n",
247 i, name,
248 tables[i].format,
251 }
252 }
253
254#endif
255
256 return FT_Err_Ok;
257
258 Exit:
259 FT_FREE( face->toc.tables );
260 return error;
261 }
#define FT_MIN(a, b)
Definition: ftobjs.h:70
#define FT_STREAM_SEEK(position)
Definition: ftstream.h:514
unsigned int FT_UInt
Definition: fttypes.h:231
GLdouble n
Definition: glext.h:7729
FT_BEGIN_HEADER struct PCF_TableRec_ PCF_TableRec
FT_BEGIN_HEADER struct PCF_TableRec_ * PCF_Table
#define PCF_FILE_VERSION
Definition: pcf.h:184
static const FT_Frame_Field pcf_table_header[]
Definition: pcfread.c:80
static const FT_Frame_Field pcf_toc_header[]
Definition: pcfread.c:67
FT_ULong version
Definition: pcf.h:51
FT_ULong count
Definition: pcf.h:52
unsigned int size
Definition: parse.h:27

Referenced by pcf_load_font().

◆ pcf_seek_to_table_type()

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 373 of file pcfread.c.

379 {
380 FT_Error error = FT_ERR( Invalid_File_Format );
381 FT_ULong i;
382
383
384 for ( i = 0; i < ntables; i++ )
385 if ( tables[i].type == type )
386 {
387 if ( stream->pos > tables[i].offset )
388 {
389 error = FT_THROW( Invalid_Stream_Skip );
390 goto Fail;
391 }
392
393 if ( FT_STREAM_SKIP( tables[i].offset - stream->pos ) )
394 {
395 error = FT_THROW( Invalid_Stream_Skip );
396 goto Fail;
397 }
398
399 *asize = tables[i].size;
400 *aformat = tables[i].format;
401
402 return FT_Err_Ok;
403 }
404
405 Fail:
406 *asize = 0;
407 return error;
408 }
int Fail
Definition: ehthrow.cxx:24
#define FT_ERR(e)
Definition: fttypes.h:599

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

Variable Documentation

◆ pcf_accel_header

const FT_Frame_Field pcf_accel_header[]
static
Initial value:
=
{
#define FT_STRUCTURE
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_LONG_LE ( fontAscent ),
FT_FRAME_LONG_LE ( fontDescent ),
FT_FRAME_LONG_LE ( maxOverlap ),
}
#define FT_FRAME_END
Definition: ftstream.h:118
#define FT_FRAME_BYTE(f)
Definition: ftstream.h:126
#define FT_FRAME_SKIP_BYTES(count)
Definition: ftstream.h:147
#define FT_FRAME_LONG_LE(f)
Definition: ftstream.h:129
#define FT_FRAME_START(size)
Definition: ftstream.h:117

Definition at line 1138 of file pcfread.c.

Referenced by pcf_get_accel().

◆ pcf_accel_msb_header

const FT_Frame_Field pcf_accel_msb_header[]
static
Initial value:
=
{
#define FT_STRUCTURE
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_LONG ( fontAscent ),
FT_FRAME_LONG ( fontDescent ),
FT_FRAME_LONG ( maxOverlap ),
}
#define FT_FRAME_LONG(f)
Definition: ftstream.h:120

Definition at line 1160 of file pcfread.c.

Referenced by pcf_get_accel().

◆ pcf_compressed_metric_header

const FT_Frame_Field pcf_compressed_metric_header[]
static
Initial value:
=
{
#define FT_STRUCTURE
FT_FRAME_BYTE( leftSideBearing ),
FT_FRAME_BYTE( rightSideBearing ),
FT_FRAME_BYTE( characterWidth ),
FT_FRAME_BYTE( ascent ),
FT_FRAME_BYTE( descent ),
}

Definition at line 303 of file pcfread.c.

Referenced by pcf_get_metric().

◆ pcf_enc_header

const FT_Frame_Field pcf_enc_header[]
static
Initial value:
=
{
#define FT_STRUCTURE
FT_FRAME_USHORT_LE( firstCol ),
FT_FRAME_USHORT_LE( lastCol ),
FT_FRAME_USHORT_LE( firstRow ),
FT_FRAME_USHORT_LE( lastRow ),
FT_FRAME_USHORT_LE( defaultChar ),
}
#define FT_FRAME_USHORT_LE(f)
Definition: ftstream.h:132
#define PCF_ENC_SIZE
Definition: pcfread.c:939

Definition at line 942 of file pcfread.c.

Referenced by pcf_get_encodings().

◆ pcf_enc_msb_header

const FT_Frame_Field pcf_enc_msb_header[]
static
Initial value:
=
{
#define FT_STRUCTURE
FT_FRAME_USHORT( firstCol ),
FT_FRAME_USHORT( lastCol ),
FT_FRAME_USHORT( firstRow ),
FT_FRAME_USHORT( lastRow ),
FT_FRAME_USHORT( defaultChar ),
}
#define FT_FRAME_USHORT(f)
Definition: ftstream.h:123

Definition at line 958 of file pcfread.c.

Referenced by pcf_get_encodings().

◆ pcf_metric_header

const FT_Frame_Field pcf_metric_header[]
static
Initial value:
=
{
#define FT_STRUCTURE
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 ),
}
#define FT_FRAME_SHORT_LE(f)
Definition: ftstream.h:131

Definition at line 267 of file pcfread.c.

Referenced by pcf_get_metric().

◆ pcf_metric_msb_header

const FT_Frame_Field pcf_metric_msb_header[]
static
Initial value:
=
{
#define FT_STRUCTURE
FT_FRAME_SHORT( leftSideBearing ),
FT_FRAME_SHORT( rightSideBearing ),
FT_FRAME_SHORT( characterWidth ),
FT_FRAME_SHORT( ascent ),
FT_FRAME_SHORT( descent ),
FT_FRAME_SHORT( attributes ),
}
#define FT_FRAME_SHORT(f)
Definition: ftstream.h:122

Definition at line 284 of file pcfread.c.

Referenced by pcf_get_metric().

◆ pcf_property_header

const FT_Frame_Field pcf_property_header[]
static
Initial value:

Definition at line 430 of file pcfread.c.

Referenced by pcf_get_properties().

◆ pcf_property_msb_header

const FT_Frame_Field pcf_property_msb_header[]
static
Initial value:

Definition at line 444 of file pcfread.c.

Referenced by pcf_get_properties().

◆ pcf_table_header

const FT_Frame_Field pcf_table_header[]
static
Initial value:
=
{
#define FT_STRUCTURE
}
#define FT_FRAME_ULONG_LE(f)
Definition: ftstream.h:130

Definition at line 80 of file pcfread.c.

Referenced by pcf_read_TOC().

◆ pcf_toc_header

const FT_Frame_Field pcf_toc_header[]
static
Initial value:
=
{
#define FT_STRUCTURE
}
static const WCHAR version[]
Definition: asmname.c:66
GLuint GLuint GLsizei count
Definition: gl.h:1545

Definition at line 67 of file pcfread.c.

Referenced by pcf_read_TOC().