diff options
Diffstat (limited to 'src/bitmap/pcfread.c')
-rw-r--r-- | src/bitmap/pcfread.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/bitmap/pcfread.c b/src/bitmap/pcfread.c index 32f9856..92b6348 100644 --- a/src/bitmap/pcfread.c +++ b/src/bitmap/pcfread.c @@ -56,7 +56,7 @@ pcfError(const char* message, ...) vfprintf(stderr, message, args); va_end(args); } - + /* Read PCF font files */ static void pcfUnloadFont ( FontPtr pFont ); @@ -197,7 +197,7 @@ pcfGetCompressedMetric(FontFilePtr file, CARD32 format, xCharInfo *metric) * in the font file */ static Bool -pcfSeekToType(FontFilePtr file, PCFTablePtr tables, int ntables, +pcfSeekToType(FontFilePtr file, PCFTablePtr tables, int ntables, CARD32 type, CARD32 *formatp, CARD32 *sizep) { int i; @@ -228,14 +228,14 @@ pcfHasType (PCFTablePtr tables, int ntables, CARD32 type) } /* - * pcfGetProperties + * pcfGetProperties * * Reads the font properties from the font file, filling in the FontInfo rec * supplied. Used by by both ReadFont and ReadFontInfo routines. */ static Bool -pcfGetProperties(FontInfoPtr pFontInfo, FontFilePtr file, +pcfGetProperties(FontInfoPtr pFontInfo, FontFilePtr file, PCFTablePtr tables, int ntables) { FontPropPtr props = 0; @@ -274,7 +274,7 @@ pcfGetProperties(FontInfoPtr pFontInfo, FontFilePtr file, props[i].name = pcfGetINT32(file, format); isStringProp[i] = pcfGetINT8(file, format); props[i].value = pcfGetINT32(file, format); - if (props[i].name < 0 + if (props[i].name < 0 || (isStringProp[i] != 0 && isStringProp[i] != 1) || (isStringProp[i] && props[i].value < 0)) { pcfError("pcfGetProperties(): invalid file format %d %d %d\n", @@ -334,7 +334,7 @@ Bail: */ static Bool -pcfGetAccel(FontInfoPtr pFontInfo, FontFilePtr file, +pcfGetAccel(FontInfoPtr pFontInfo, FontFilePtr file, PCFTablePtr tables, int ntables, CARD32 type) { CARD32 format; @@ -345,7 +345,7 @@ pcfGetAccel(FontInfoPtr pFontInfo, FontFilePtr file, goto Bail; format = pcfGetLSB32(file); if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT) && - !PCF_FORMAT_MATCH(format, PCF_ACCEL_W_INKBOUNDS)) + !PCF_FORMAT_MATCH(format, PCF_ACCEL_W_INKBOUNDS)) { goto Bail; } @@ -382,7 +382,7 @@ Bail: } int -pcfReadFont(FontPtr pFont, FontFilePtr file, +pcfReadFont(FontPtr pFont, FontFilePtr file, int bit, int byte, int glyph, int scan) { CARD32 format; @@ -454,7 +454,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr file, if (!pcfGetCompressedMetric(file, format, &(metrics + i)->metrics)) goto Bail; } - + /* bitmaps */ if (!pcfSeekToType(file, tables, ntables, PCF_BITMAPS, &format, &size)) @@ -482,7 +482,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr file, if (IS_EOF(file)) goto Bail; if (bitmapSizes[i] < 0) goto Bail; } - + sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX(format)]; /* guard against completely empty font */ bitmaps = malloc(sizebitmaps ? sizebitmaps : 1); @@ -559,7 +559,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr file, /* nmetrics already checked */ ink_metrics = malloc(nink_metrics * sizeof(xCharInfo)); if (!ink_metrics) { - pcfError("pcfReadFont(): Couldn't allocate ink_metrics (%d*%d)\n", nink_metrics, sizeof(xCharInfo)); + pcfError("pcfReadFont(): Couldn't allocate ink_metrics (%d*%d)\n", nink_metrics, sizeof(xCharInfo)); goto Bail; } for (i = 0; i < nink_metrics; i++) @@ -595,10 +595,10 @@ pcfReadFont(FontPtr pFont, FontFilePtr file, encoding = calloc(NUM_SEGMENTS(nencoding), sizeof(CharInfoPtr*)); if (!encoding) { - pcfError("pcfReadFont(): Couldn't allocate encoding (%d*%d)\n", nencoding, sizeof(CharInfoPtr)); + pcfError("pcfReadFont(): Couldn't allocate encoding (%d*%d)\n", nencoding, sizeof(CharInfoPtr)); goto Bail; } - + pFont->info.allExist = TRUE; for (i = 0; i < nencoding; i++) { encodingOffset = pcfGetINT16(file, format); |