aboutsummaryrefslogtreecommitdiff
path: root/libXfont/src/bitmap
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-07-25 13:45:56 +0000
committermarha <marha@users.sourceforge.net>2009-07-25 13:45:56 +0000
commit2fb179f86b0f9ecb7876759b87f9c64634a3f114 (patch)
tree351df3c4d5648356980bc078544e25820e4d26fc /libXfont/src/bitmap
parenta7be905cf4423239285228d4e23caf2172adfa8b (diff)
downloadvcxsrv-2fb179f86b0f9ecb7876759b87f9c64634a3f114.tar.gz
vcxsrv-2fb179f86b0f9ecb7876759b87f9c64634a3f114.tar.bz2
vcxsrv-2fb179f86b0f9ecb7876759b87f9c64634a3f114.zip
Added libXfont-1.4.0.tar.gz.
Diffstat (limited to 'libXfont/src/bitmap')
-rw-r--r--libXfont/src/bitmap/Makefile.in46
-rw-r--r--libXfont/src/bitmap/bdfread.c71
-rw-r--r--libXfont/src/bitmap/bdfutils.c8
-rw-r--r--libXfont/src/bitmap/bitmapfunc.c13
-rw-r--r--libXfont/src/bitmap/bitmaputil.c2
-rw-r--r--libXfont/src/bitmap/bitscale.c369
-rw-r--r--libXfont/src/bitmap/pcfread.c327
-rw-r--r--libXfont/src/bitmap/pcfwrite.c6
-rw-r--r--libXfont/src/bitmap/snfread.c62
9 files changed, 174 insertions, 730 deletions
diff --git a/libXfont/src/bitmap/Makefile.in b/libXfont/src/bitmap/Makefile.in
index 7bd5fe3ad..7ccd5819d 100644
--- a/libXfont/src/bitmap/Makefile.in
+++ b/libXfont/src/bitmap/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -48,7 +48,7 @@ am_libbitmap_la_OBJECTS = bdfread.lo bdfutils.lo bitmap.lo \
bitmapfunc.lo bitmaputil.lo bitscale.lo fontink.lo pcfread.lo \
pcfwrite.lo snfread.lo
libbitmap_la_OBJECTS = $(am_libbitmap_la_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(top_builddir) -I$(top_builddir)/include/X11/fonts@am__isrc@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/include/X11/fonts
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -79,22 +79,18 @@ CHANGELOG_CMD = @CHANGELOG_CMD@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
-ECHO = @ECHO@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENCODINGSDIR = @ENCODINGSDIR@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
FREETYPE_LIBS = @FREETYPE_LIBS@
FREETYPE_REQUIRES = @FREETYPE_REQUIRES@
@@ -104,17 +100,24 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MATH_LIBS = @MATH_LIBS@
MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_CFLAGS = @OS_CFLAGS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -124,6 +127,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
+SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@@ -137,8 +141,7 @@ abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -171,6 +174,7 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
@@ -183,6 +187,7 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INCLUDES = \
@@ -211,8 +216,8 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
@@ -297,8 +302,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -310,8 +315,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -321,13 +326,12 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
- here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
diff --git a/libXfont/src/bitmap/bdfread.c b/libXfont/src/bitmap/bdfread.c
index a6f0c1e7e..083565358 100644
--- a/libXfont/src/bitmap/bdfread.c
+++ b/libXfont/src/bitmap/bdfread.c
@@ -56,9 +56,7 @@ from The Open Group.
#include <config.h>
#endif
-#ifndef FONTMODULE
#include <ctype.h>
-#endif
#include <X11/fonts/fntfilst.h>
#include <X11/fonts/fontutil.h>
/* use bitmap structure */
@@ -102,7 +100,7 @@ bdfReadBitmap(CharInfoPtr pCI, FontFilePtr file, int bit, int byte,
widthBytes = BYTES_PER_ROW(widthBits, glyph);
if (widthBytes * height > 0) {
- picture = (unsigned char *) xalloc(widthBytes * height);
+ picture = malloc(widthBytes * height);
if (!picture) {
bdfError("Couldn't allocate picture (%d*%d)\n", widthBytes, height);
goto BAILOUT;
@@ -192,7 +190,7 @@ bdfReadBitmap(CharInfoPtr pCI, FontFilePtr file, int bit, int byte,
return (TRUE);
BAILOUT:
if (picture)
- xfree(picture);
+ free(picture);
pCI->bits = NULL;
return (FALSE);
}
@@ -229,25 +227,25 @@ bdfFreeFontBits(FontPtr pFont)
bitmapFont = (BitmapFontPtr) pFont->fontPrivate;
bitmapExtra = (BitmapExtraPtr) bitmapFont->bitmapExtra;
- xfree(bitmapFont->ink_metrics);
+ free(bitmapFont->ink_metrics);
if(bitmapFont->encoding) {
nencoding = (pFont->info.lastCol - pFont->info.firstCol + 1) *
(pFont->info.lastRow - pFont->info.firstRow + 1);
for(i=0; i<NUM_SEGMENTS(nencoding); i++)
- xfree(bitmapFont->encoding[i]);
+ free(bitmapFont->encoding[i]);
}
- xfree(bitmapFont->encoding);
+ free(bitmapFont->encoding);
for (i = 0; i < bitmapFont->num_chars; i++)
- xfree(bitmapFont->metrics[i].bits);
- xfree(bitmapFont->metrics);
+ free(bitmapFont->metrics[i].bits);
+ free(bitmapFont->metrics);
if (bitmapExtra)
{
- xfree (bitmapExtra->glyphNames);
- xfree (bitmapExtra->sWidths);
- xfree (bitmapExtra);
+ free (bitmapExtra->glyphNames);
+ free (bitmapExtra->sWidths);
+ free (bitmapExtra);
}
- xfree(pFont->info.props);
- xfree(bitmapFont);
+ free(pFont->info.props);
+ free(bitmapFont);
}
@@ -299,17 +297,16 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
sizeof(CharInfoRec));
goto BAILOUT;
}
- ci = (CharInfoPtr) xalloc(nchars * sizeof(CharInfoRec));
+ ci = calloc(nchars, sizeof(CharInfoRec));
if (!ci) {
bdfError("Couldn't allocate pCI (%d*%d)\n", nchars,
sizeof(CharInfoRec));
goto BAILOUT;
}
- bzero((char *)ci, nchars * sizeof(CharInfoRec));
bitmapFont->metrics = ci;
if (bitmapExtra) {
- bitmapExtra->glyphNames = (Atom *) xalloc(nchars * sizeof(Atom));
+ bitmapExtra->glyphNames = malloc(nchars * sizeof(Atom));
if (!bitmapExtra->glyphNames) {
bdfError("Couldn't allocate glyphNames (%d*%d)\n",
nchars, sizeof(Atom));
@@ -317,7 +314,7 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
}
}
if (bitmapExtra) {
- bitmapExtra->sWidths = (int *) xalloc(nchars * sizeof(int));
+ bitmapExtra->sWidths = malloc(nchars * sizeof(int));
if (!bitmapExtra->sWidths) {
bdfError("Couldn't allocate sWidth (%d *%d)\n",
nchars, sizeof(int));
@@ -383,8 +380,7 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
if (char_col > pFont->info.lastCol)
pFont->info.lastCol = char_col;
if (bdfEncoding[char_row] == (CharInfoPtr *) NULL) {
- bdfEncoding[char_row] =
- (CharInfoPtr *) xalloc(256 * sizeof(CharInfoPtr));
+ bdfEncoding[char_row] = malloc(256 * sizeof(CharInfoPtr));
if (!bdfEncoding[char_row]) {
bdfError("Couldn't allocate row %d of encoding (%d*%d)\n",
char_row, INDICES, sizeof(CharInfoPtr));
@@ -493,9 +489,7 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
nencoding = (pFont->info.lastRow - pFont->info.firstRow + 1) *
(pFont->info.lastCol - pFont->info.firstCol + 1);
- bitmapFont->encoding =
- (CharInfoPtr **) xcalloc(NUM_SEGMENTS(nencoding),
- sizeof(CharInfoPtr*));
+ bitmapFont->encoding = calloc(NUM_SEGMENTS(nencoding),sizeof(CharInfoPtr*));
if (!bitmapFont->encoding) {
bdfError("Couldn't allocate ppCI (%d,%d)\n",
NUM_SEGMENTS(nencoding),
@@ -519,8 +513,8 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
else {
if (!bitmapFont->encoding[SEGMENT_MAJOR(i)]) {
bitmapFont->encoding[SEGMENT_MAJOR(i)]=
- (CharInfoPtr*)xcalloc(BITMAP_FONT_SEGMENT_SIZE,
- sizeof(CharInfoPtr));
+ calloc(BITMAP_FONT_SEGMENT_SIZE,
+ sizeof(CharInfoPtr));
if (!bitmapFont->encoding[SEGMENT_MAJOR(i)])
goto BAILOUT;
}
@@ -533,12 +527,12 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
}
for (i = 0; i < 256; i++)
if (bdfEncoding[i])
- xfree(bdfEncoding[i]);
+ free(bdfEncoding[i]);
return (TRUE);
BAILOUT:
for (i = 0; i < 256; i++)
if (bdfEncoding[i])
- xfree(bdfEncoding[i]);
+ free(bdfEncoding[i]);
/* bdfFreeFontBits will clean up the rest */
return (FALSE);
}
@@ -615,21 +609,20 @@ bdfReadProperties(FontFilePtr file, FontPtr pFont, bdfFileState *pState)
pFont->info.props = NULL;
pFont->info.nprops = 0;
- stringProps = (char *) xalloc((nProps + BDF_GENPROPS) * sizeof(char));
+ stringProps = malloc((nProps + BDF_GENPROPS) * sizeof(char));
pFont->info.isStringProp = stringProps;
if (stringProps == NULL) {
bdfError("Couldn't allocate stringProps (%d*%d)\n",
(nProps + BDF_GENPROPS), sizeof(Bool));
goto BAILOUT;
}
- pFont->info.props = props = (FontPropPtr) xalloc((nProps + BDF_GENPROPS) *
- sizeof(FontPropRec));
+ pFont->info.props = props = calloc(nProps + BDF_GENPROPS,
+ sizeof(FontPropRec));
if (props == NULL) {
bdfError("Couldn't allocate props (%d*%d)\n", nProps + BDF_GENPROPS,
sizeof(FontPropRec));
goto BAILOUT;
}
- bzero((char *)props, (nProps + BDF_GENPROPS) * sizeof(FontPropRec));
nextProp = 0;
props_left = nProps;
@@ -770,11 +763,11 @@ bdfReadProperties(FontFilePtr file, FontPtr pFont, bdfFileState *pState)
return (TRUE);
BAILOUT:
if (pFont->info.isStringProp) {
- xfree(pFont->info.isStringProp);
+ free(pFont->info.isStringProp);
pFont->info.isStringProp = NULL;
}
if (pFont->info.props) {
- xfree(pFont->info.props);
+ free(pFont->info.props);
pFont->info.props = NULL;
}
while (line && bdfIsPrefix(line, "ENDPROPERTIES"))
@@ -808,12 +801,11 @@ bdfReadFont(FontPtr pFont, FontFilePtr file,
if (!bdfReadHeader(file, &state))
goto BAILOUT;
- bitmapFont = (BitmapFontPtr) xalloc(sizeof(BitmapFontRec));
+ bitmapFont = calloc(1, sizeof(BitmapFontRec));
if (!bitmapFont) {
bdfError("Couldn't allocate bitmapFontRec (%d)\n", sizeof(BitmapFontRec));
goto BAILOUT;
}
- bzero((char *)bitmapFont, sizeof(BitmapFontRec));
pFont->fontPrivate = (pointer) bitmapFont;
bitmapFont->metrics = 0;
@@ -822,12 +814,11 @@ bdfReadFont(FontPtr pFont, FontFilePtr file,
bitmapFont->encoding = 0;
bitmapFont->pDefault = NULL;
- bitmapFont->bitmapExtra = (BitmapExtraPtr) xalloc(sizeof(BitmapExtraRec));
+ bitmapFont->bitmapExtra = calloc(1, sizeof(BitmapExtraRec));
if (!bitmapFont->bitmapExtra) {
bdfError("Couldn't allocate bitmapExtra (%d)\n", sizeof(BitmapExtraRec));
goto BAILOUT;
}
- bzero((char *)bitmapFont->bitmapExtra, sizeof(BitmapExtraRec));
bitmapFont->bitmapExtra->glyphNames = 0;
bitmapFont->bitmapExtra->sWidths = 0;
@@ -945,14 +936,14 @@ bdfPadToTerminal(FontPtr pFont)
new_size = BYTES_FOR_GLYPH(&new, pFont->glyph);
for (i = 0; i < bitmapFont->num_chars; i++) {
- new.bits = (char *) xalloc(new_size);
+ new.bits = malloc(new_size);
if (!new.bits) {
bdfError("Couldn't allocate bits (%d)\n", new_size);
return FALSE;
- }
+ }
FontCharReshape(pFont, &bitmapFont->metrics[i], &new);
new.metrics.attributes = bitmapFont->metrics[i].metrics.attributes;
- xfree(bitmapFont->metrics[i].bits);
+ free(bitmapFont->metrics[i].bits);
bitmapFont->metrics[i] = new;
}
bitmapExtra = bitmapFont->bitmapExtra;
diff --git a/libXfont/src/bitmap/bdfutils.c b/libXfont/src/bitmap/bdfutils.c
index a0c5ae949..17596c323 100644
--- a/libXfont/src/bitmap/bdfutils.c
+++ b/libXfont/src/bitmap/bdfutils.c
@@ -55,11 +55,9 @@ from The Open Group.
#include <config.h>
#endif
-#ifndef FONTMODULE
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
-#endif
#include <X11/fonts/fntfilst.h>
#include <X11/fonts/fontstruct.h>
@@ -176,7 +174,7 @@ bdfGetPropertyValue(char *s)
}
/* quoted string: strip outer quotes and undouble inner quotes */
s++;
- pp = p = (char *) xalloc((unsigned) strlen(s) + 1);
+ pp = p = malloc((unsigned) strlen(s) + 1);
if (pp == NULL) {
bdfError("Couldn't allocate property value string (%d)\n", strlen(s) + 1);
return None;
@@ -186,7 +184,7 @@ bdfGetPropertyValue(char *s)
if (*(s + 1) != '"') {
*p++ = 0;
atom = bdfForceMakeAtom(pp, NULL);
- xfree(pp);
+ free(pp);
return atom;
} else {
s++;
@@ -194,7 +192,7 @@ bdfGetPropertyValue(char *s)
}
*p++ = *s++;
}
- xfree (pp);
+ free (pp);
bdfError("unterminated quoted string property: %s\n", (pointer) orig_s);
return None;
}
diff --git a/libXfont/src/bitmap/bitmapfunc.c b/libXfont/src/bitmap/bitmapfunc.c
index e980dfbcc..80d7da19d 100644
--- a/libXfont/src/bitmap/bitmapfunc.c
+++ b/libXfont/src/bitmap/bitmapfunc.c
@@ -67,6 +67,7 @@ typedef struct _BitmapFileFunctions {
FontFilePtr /* file */ );
} BitmapFileFunctionsRec, *BitmapFileFunctionsPtr;
+static int BitmapGetRenderIndex(FontRendererPtr renderer);
/*
* the readers[] and renderers[] arrays must be in the same order,
@@ -104,9 +105,6 @@ static BitmapFileFunctionsRec readers[] = {
{ bdfReadFont, bdfReadFontInfo} ,
# endif
#endif
-#if XFONT_PCFFORMAT
- { pmfReadFont, pcfReadFontInfo} ,
-#endif
};
@@ -150,7 +148,7 @@ BitmapOpenBitmap (FontPathElementPtr fpe, FontPtr *ppFont, int flags,
FontFileClose (file);
if (ret != Successful) {
- xfree(pFont);
+ free(pFont);
} else {
*ppFont = pFont;
}
@@ -235,11 +233,6 @@ static FontRendererRec renderers[] = {
CAPABILITIES },
# endif
#endif
-#if XFONT_PCFFORMAT
- { ".pmf", 4, BitmapOpenBitmap, BitmapOpenScalable,
- BitmapGetInfoBitmap, BitmapGetInfoScalable, 0,
- CAPABILITIES }
-#endif
};
#define numRenderers (sizeof renderers / sizeof renderers[0])
@@ -258,7 +251,7 @@ BitmapRegisterFontFileFunctions (void)
* the font info reader, and the bitmap scaling routine. All users
* of this routine must be kept in step with the renderer array.
*/
-int
+static int
BitmapGetRenderIndex(FontRendererPtr renderer)
{
return renderer - renderers;
diff --git a/libXfont/src/bitmap/bitmaputil.c b/libXfont/src/bitmap/bitmaputil.c
index 3487f7f92..3a7bbc7a0 100644
--- a/libXfont/src/bitmap/bitmaputil.c
+++ b/libXfont/src/bitmap/bitmaputil.c
@@ -212,7 +212,7 @@ bitmapAddInkMetrics(FontPtr pFont)
int i;
bitmapFont = (BitmapFontPtr) pFont->fontPrivate;
- bitmapFont->ink_metrics = (xCharInfo *) xalloc(bitmapFont->num_chars * sizeof(xCharInfo));
+ bitmapFont->ink_metrics = malloc(bitmapFont->num_chars * sizeof(xCharInfo));
if (!bitmapFont->ink_metrics) {
fprintf(stderr, "Error: Couldn't allocate ink_metrics (%d*%ld)\n",
bitmapFont->num_chars, (unsigned long)sizeof(xCharInfo));
diff --git a/libXfont/src/bitmap/bitscale.c b/libXfont/src/bitmap/bitscale.c
index ffdbe1d3c..a4d991d3b 100644
--- a/libXfont/src/bitmap/bitscale.c
+++ b/libXfont/src/bitmap/bitscale.c
@@ -1,4 +1,3 @@
-/* $Xorg: bitscale.c,v 1.5 2001/02/09 02:04:02 xorgcvs Exp $ */
/*
Copyright 1991, 1994, 1998 The Open Group
@@ -55,15 +54,7 @@ from The Open Group.
#include <X11/fonts/fntfilst.h>
#include <X11/fonts/bitmap.h>
#include <X11/fonts/fontutil.h>
-#ifndef FONTMODULE
-#ifdef _XOPEN_SOURCE
#include <math.h>
-#else
-#define _XOPEN_SOURCE /* to get prototype for hypot on some systems */
-#include <math.h>
-#undef _XOPEN_SOURCE
-#endif
-#endif
#ifndef MAX
#define MAX(a,b) (((a)>(b)) ? a : b)
@@ -79,9 +70,6 @@ static void ScaleBitmap ( FontPtr pFont, CharInfoPtr opci,
static FontPtr BitmapScaleBitmaps(FontPtr pf, FontPtr opf,
double widthMult, double heightMult,
FontScalablePtr vals);
-static FontPtr PrinterScaleBitmaps(FontPtr pf, FontPtr opf,
- double widthMult, double heightMult,
- FontScalablePtr vals);
enum scaleType {
atom, truncate_atom, pixel_size, point_size, resolution_x,
@@ -96,50 +84,6 @@ typedef struct _fontProp {
enum scaleType type;
} fontProp;
-typedef FontPtr (*ScaleFunc) ( FontPtr /* pf */,
- FontPtr /* opf */,
- double /* widthMult */,
- double /* heightMult */,
- FontScalablePtr /* vals */);
-
-/* These next two arrays must be kept in step with the renderer array */
-static const ScaleFunc scale[] =
-{
-#if XFONT_PCFFORMAT
- BitmapScaleBitmaps,
- BitmapScaleBitmaps,
-# ifdef X_GZIP_FONT_COMPRESSION
- BitmapScaleBitmaps,
-# endif
-# ifdef X_BZIP2_FONT_COMPRESSION
- BitmapScaleBitmaps,
-# endif
-#endif
-#if XFONT_SNFFORMAT
- BitmapScaleBitmaps,
- BitmapScaleBitmaps,
-# ifdef X_GZIP_FONT_COMPRESSION
- BitmapScaleBitmaps,
-# endif
-# ifdef X_BZIP2_FONT_COMPRESSION
- BitmapScaleBitmaps,
-# endif
-#endif
-#if XFONT_BDFFORMAT
- BitmapScaleBitmaps,
- BitmapScaleBitmaps,
-# ifdef X_GZIP_FONT_COMPRESSION
- BitmapScaleBitmaps,
-# endif
-# ifdef X_BZIP2_FONT_COMPRESSION
- BitmapScaleBitmaps,
-# endif
-#endif
-#if XFONT_PCFFORMAT
- PrinterScaleBitmaps,
-#endif
-};
-
static FontEntryPtr FindBestToScale ( FontPathElementPtr fpe,
FontEntryPtr entry,
FontScalablePtr vals,
@@ -147,48 +91,6 @@ static FontEntryPtr FindBestToScale ( FontPathElementPtr fpe,
double *dxp, double *dyp,
double *sdxp, double *sdyp,
FontPathElementPtr *fpep );
-static FontEntryPtr FindPmfToScale ( FontPathElementPtr fpe,
- FontEntryPtr entry,
- FontScalablePtr vals,
- FontScalablePtr best,
- double *dxp, double *dyp,
- double *sdxp, double *sdyp,
- FontPathElementPtr *fpep );
-
-typedef FontEntryPtr (*FindToScale) (FontPathElementPtr fpe,
- FontEntryPtr entry,
- FontScalablePtr vals,
- FontScalablePtr best,
- double *dxp, double *dyp,
- double *sdxp, double *sdyp,
- FontPathElementPtr *fpep);
-static const FindToScale find_scale[] =
-{
-#if XFONT_PCFFORMAT
- FindBestToScale,
- FindBestToScale,
-#ifdef X_GZIP_FONT_COMPRESSION
- FindBestToScale,
-#endif
-#endif
-#if XFONT_SNFFORMAT
- FindBestToScale,
- FindBestToScale,
-#ifdef X_GZIP_FONT_COMPRESSION
- FindBestToScale,
-#endif
-#endif
-#if XFONT_BDFFORMAT
- FindBestToScale,
- FindBestToScale,
-#ifdef X_GZIP_FONT_COMPRESSION
- FindBestToScale,
-#endif
-#endif
-#if XFONT_PCFFORMAT
- FindPmfToScale,
-#endif
-};
static unsigned long bitscaleGeneration = 0; /* initialization flag */
@@ -262,9 +164,6 @@ static fontProp fontPropTable[] = {
{ "_ADOBE_POSTSCRIPT_FONTNAME", 0, unscaled }
};
-/* sleazy way to shut up the compiler */
-#define zerohack (enum scaleType)0
-
static fontProp rawFontPropTable[] = {
{ "RAW_MIN_SPACE", 0, },
{ "RAW_NORM_SPACE", 0, },
@@ -611,17 +510,7 @@ FindBestToScale(FontPathElementPtr fpe, FontEntryPtr entry,
the matrix appropriately */
vals->pixel_matrix[0] *= rescale_x;
vals->pixel_matrix[1] *= rescale_x;
-#ifdef NOTDEF
- /* This would force the pointsize and pixelsize fields in the
- FONT property to display as matrices to more accurately
- report the font being supplied. It might also break existing
- applications that expect a single number in that field. */
- vals->values_supplied =
- vals->values_supplied & ~(PIXELSIZE_MASK | POINTSIZE_MASK) |
- PIXELSIZE_ARRAY;
-#else /* NOTDEF */
vals->values_supplied = vals->values_supplied & ~POINTSIZE_MASK;
-#endif /* NOTDEF */
/* Recompute and reround the FontScalablePtr values after
rescaling for the new width. */
FontFileCompleteXLFD(vals, vals);
@@ -630,58 +519,6 @@ FindBestToScale(FontPathElementPtr fpe, FontEntryPtr entry,
return result;
}
-static FontEntryPtr
-FindPmfToScale(FontPathElementPtr fpe, FontEntryPtr entry,
- FontScalablePtr vals, FontScalablePtr best,
- double *dxp, double *dyp,
- double *sdxp, double *sdyp,
- FontPathElementPtr *fpep)
-{
- FontEntryPtr result = NULL;
- FontScaledPtr scaled;
- FontScalableExtraPtr extra;
- int i;
-
- extra = entry->u.scalable.extra;
- for (i = 0; i < extra->numScaled; i++)
- {
- double rescale_x;
-
- scaled = &extra->scaled[i];
- if (!scaled->bitmap)
- continue;
- if (!ComputeScaleFactors(&scaled->vals, vals, dxp, dyp, sdxp, sdyp,
- &rescale_x))
- continue;
- *best = scaled->vals;
- *fpep = fpe;
- result = scaled->bitmap;
- if (rescale_x != 1.0)
- {
- /* We have rescaled horizontally due to an XLFD width field. Change
- the matrix appropriately */
- vals->pixel_matrix[0] *= rescale_x;
- vals->pixel_matrix[1] *= rescale_x;
-#ifdef NOTDEF
- /* This would force the pointsize and pixelsize fields in the
- FONT property to display as matrices to more accurately
- report the font being supplied. It might also break existing
- applications that expect a single number in that field. */
- vals->values_supplied =
- vals->values_supplied & ~(PIXELSIZE_MASK | POINTSIZE_MASK) |
- PIXELSIZE_ARRAY;
-#else /* NOTDEF */
- vals->values_supplied = vals->values_supplied & ~POINTSIZE_MASK;
-#endif /* NOTDEF */
- /* Recompute and reround the FontScalablePtr values after
- rescaling for the new width. */
- FontFileCompleteXLFD(vals, vals);
- }
- break;
- }
- return result;
-}
-
static long
doround(double x)
{
@@ -767,19 +604,19 @@ ComputeScaledProperties(FontInfoPtr sourceFontInfo, /* the font to be scaled */
}
nProps = NPROPS + 1 + sizeof(fontPropTable) / sizeof(fontProp) +
sizeof(rawFontPropTable) / sizeof(fontProp);
- fp = (FontPropPtr) xalloc(sizeof(FontPropRec) * nProps);
+ fp = malloc(sizeof(FontPropRec) * nProps);
*pProps = fp;
if (!fp) {
fprintf(stderr, "Error: Couldn't allocate font properties (%ld*%d)\n",
(unsigned long)sizeof(FontPropRec), nProps);
return 1;
}
- isStringProp = (char *) xalloc (nProps);
+ isStringProp = malloc (nProps);
*pIsStringProp = isStringProp;
if (!isStringProp)
{
fprintf(stderr, "Error: Couldn't allocate isStringProp (%d)\n", nProps);
- xfree (fp);
+ free (fp);
return 1;
}
ptr2 = name;
@@ -1020,7 +857,7 @@ ScaleFont(FontPtr opf, /* originating font */
lastRow = opfi->lastRow;
}
- bitmapFont = (BitmapFontPtr) xalloc(sizeof(BitmapFontRec));
+ bitmapFont = malloc(sizeof(BitmapFontRec));
if (!bitmapFont) {
fprintf(stderr, "Error: Couldn't allocate bitmapFont (%ld)\n",
(unsigned long)sizeof(BitmapFontRec));
@@ -1041,15 +878,13 @@ ScaleFont(FontPtr opf, /* originating font */
bitmapFont->encoding = 0;
bitmapFont->bitmapExtra = 0;
bitmapFont->pDefault = 0;
- bitmapFont->metrics = (CharInfoPtr) xalloc(nchars * sizeof(CharInfoRec));
+ bitmapFont->metrics = malloc(nchars * sizeof(CharInfoRec));
if (!bitmapFont->metrics) {
fprintf(stderr, "Error: Couldn't allocate metrics (%d*%ld)\n",
nchars, (unsigned long)sizeof(CharInfoRec));
goto bail;
}
- bitmapFont->encoding =
- (CharInfoPtr **) xcalloc(NUM_SEGMENTS(nchars),
- sizeof(CharInfoPtr*));
+ bitmapFont->encoding = calloc(NUM_SEGMENTS(nchars), sizeof(CharInfoPtr*));
if (!bitmapFont->encoding) {
fprintf(stderr, "Error: Couldn't allocate encoding (%d*%ld)\n",
nchars, (unsigned long)sizeof(CharInfoPtr));
@@ -1127,8 +962,7 @@ ScaleFont(FontPtr opf, /* originating font */
if(!bitmapFont->encoding[SEGMENT_MAJOR(i)]) {
bitmapFont->encoding[SEGMENT_MAJOR(i)]=
- (CharInfoPtr*)xcalloc(BITMAP_FONT_SEGMENT_SIZE,
- sizeof(CharInfoPtr));
+ calloc(BITMAP_FONT_SEGMENT_SIZE, sizeof(CharInfoPtr));
if(!bitmapFont->encoding[SEGMENT_MAJOR(i)])
goto bail;
}
@@ -1270,15 +1104,15 @@ ScaleFont(FontPtr opf, /* originating font */
return pf;
bail:
if (pf)
- xfree(pf);
+ free(pf);
if (bitmapFont) {
- xfree(bitmapFont->metrics);
- xfree(bitmapFont->ink_metrics);
- xfree(bitmapFont->bitmaps);
+ free(bitmapFont->metrics);
+ free(bitmapFont->ink_metrics);
+ free(bitmapFont->bitmaps);
if(bitmapFont->encoding)
for(i=0; i<NUM_SEGMENTS(nchars); i++)
- xfree(bitmapFont->encoding[i]);
- xfree(bitmapFont->encoding);
+ free(bitmapFont->encoding[i]);
+ free(bitmapFont->encoding);
}
return NULL;
}
@@ -1359,23 +1193,19 @@ ScaleBitmap(FontPtr pFont, CharInfoPtr opci, CharInfoPtr pci,
/* Looks like we need to anti-alias. Create a workspace to
contain the grayscale character plus an additional row and
column for scratch */
- char_grayscale =
- (unsigned char *)xalloc((width + 1) * (height + 1));
+ char_grayscale = malloc((width + 1) * (height + 1));
if (char_grayscale)
{
- diffusion_workspace =
- (INT32 *)xalloc((newWidth + 2) * 2 * sizeof(int));
+ diffusion_workspace = calloc((newWidth + 2) * 2, sizeof(int));
if (!diffusion_workspace)
{
fprintf(stderr, "Warning: Couldn't allocate diffusion"
" workspace (%ld)\n",
(newWidth + 2) * 2 * (unsigned long)sizeof(int));
- xfree(char_grayscale);
+ free(char_grayscale);
char_grayscale = (unsigned char *)0;
}
/* Initialize our error diffusion workspace for later use */
- bzero((char *)diffusion_workspace + sizeof(INT32),
- (newWidth + 3) * sizeof(int));
thisrow = diffusion_workspace + 1;
nextrow = diffusion_workspace + newWidth + 3;
} else {
@@ -1625,8 +1455,8 @@ ScaleBitmap(FontPtr pFont, CharInfoPtr opci, CharInfoPtr pci,
if (char_grayscale)
{
- xfree(char_grayscale);
- xfree(diffusion_workspace);
+ free(char_grayscale);
+ free(diffusion_workspace);
}
}
@@ -1677,12 +1507,11 @@ BitmapScaleBitmaps(FontPtr pf, /* scaled font */
/* Will need to remember to free in the Unload routine */
- bitmapFont->bitmaps = (char *) xalloc(bytestoalloc);
+ bitmapFont->bitmaps = calloc(1, bytestoalloc);
if (!bitmapFont->bitmaps) {
fprintf(stderr, "Error: Couldn't allocate bitmaps (%d)\n", bytestoalloc);
goto bail;
}
- bzero(bitmapFont->bitmaps, bytestoalloc);
glyphBytes = bitmapFont->bitmaps;
for (i = 0; i < nchars; i++)
@@ -1700,137 +1529,19 @@ BitmapScaleBitmaps(FontPtr pf, /* scaled font */
bail:
if (pf)
- xfree(pf);
+ free(pf);
if (bitmapFont) {
- xfree(bitmapFont->metrics);
- xfree(bitmapFont->ink_metrics);
- xfree(bitmapFont->bitmaps);
+ free(bitmapFont->metrics);
+ free(bitmapFont->ink_metrics);
+ free(bitmapFont->bitmaps);
if(bitmapFont->encoding)
for(i=0; i<NUM_SEGMENTS(nchars); i++)
- xfree(bitmapFont->encoding[i]);
- xfree(bitmapFont->encoding);
+ free(bitmapFont->encoding[i]);
+ free(bitmapFont->encoding);
}
return NULL;
}
-static FontPtr
-PrinterScaleBitmaps(FontPtr pf, /* scaled font */
- FontPtr opf, /* originating font */
- double widthMult, /* glyphs width scale factor */
- double heightMult, /* glyphs height scale factor */
- FontScalablePtr vals)
-{
- register int i;
- int nchars = 0;
- char *glyphBytes;
- BitmapFontPtr bitmapFont,
- obitmapFont;
- CharInfoPtr pci;
- FontInfoPtr pfi;
- int glyph;
- unsigned bytestoalloc = 0;
- int firstCol, lastCol, firstRow, lastRow;
-
- double xform[4], inv_xform[4];
- double xmult, ymult;
-
- bitmapFont = (BitmapFontPtr) pf->fontPrivate;
- obitmapFont = (BitmapFontPtr) opf->fontPrivate;
-
- if (!compute_xform_matrix(vals, widthMult, heightMult, xform,
- inv_xform, &xmult, &ymult))
- goto bail;
-
- pfi = &pf->info;
- firstCol = pfi->firstCol;
- lastCol = pfi->lastCol;
- firstRow = pfi->firstRow;
- lastRow = pfi->lastRow;
-
- nchars = (lastRow - firstRow + 1) * (lastCol - firstCol + 1);
- glyph = pf->glyph;
- for (i = 0; i < nchars; i++)
- {
- if ((pci = ACCESSENCODING(bitmapFont->encoding, i)))
- bytestoalloc = MAX(bytestoalloc,BYTES_FOR_GLYPH(pci, glyph));
- }
-
- /* Do we add the font malloc stuff for VALUE ADDED ? */
- /* Will need to remember to free in the Unload routine */
-
-
- bitmapFont->bitmaps = (char *) xalloc(bytestoalloc);
- if (!bitmapFont->bitmaps) {
- fprintf(stderr, "Error: Couldn't allocate bitmaps (%d)\n", bytestoalloc);
- goto bail;
- }
- bzero(bitmapFont->bitmaps, bytestoalloc);
-
- glyphBytes = bitmapFont->bitmaps;
- for (i = 0; i < nchars; i++)
- {
- if ((pci = ACCESSENCODING(bitmapFont->encoding, i)) &&
- (ACCESSENCODING(obitmapFont->encoding, OLDINDEX(i))))
- {
- pci->bits = glyphBytes;
- }
- }
- return pf;
-
-bail:
- if (pf)
- xfree(pf);
- if (bitmapFont) {
- xfree(bitmapFont->metrics);
- xfree(bitmapFont->ink_metrics);
- xfree(bitmapFont->bitmaps);
- if(bitmapFont->encoding)
- for(i=0; i<NUM_SEGMENTS(nchars); i++)
- xfree(bitmapFont->encoding[i]);
- xfree(bitmapFont->encoding);
- }
- return NULL;
-}
-
-#ifdef NOTDEF
-/*
- * exported interfaces
- */
-
-FontFileLoadName(FontFileDirPtr *dirs, int ndirs, char *name, FontPtr *pfont,
- fsBitmapFormat format, fsBitmapFormatMask fmask)
-{
- FontFileNamePtr fname;
- char full_name[1024];
- int ret = BadFontName;
- int i;
-
- i = 0;
- while (i < ndirs) {
- if (fname = FontFileFindNameInDir(dirs[i], name)) {
- if (!fname->alias) {
- if (!fname->font) {
- strcpy(full_name, dirs[i]->dir);
- strcat(full_name, fname->file);
- ret = FontFileLoad(pfont, full_name, format, fmask);
- if (ret == Successful) {
- fname->font = *pfont;
- (*pfont)->fpePrivate = (pointer) fname;
- }
- return ret;
- }
- *pfont = fname->font;
- return Successful;
- }
- name = fname->file;
- i = 0;
- } else
- i++;
- }
- return BadFontName;
-}
-#endif
-
/* ARGSUSED */
int
BitmapOpenScalable (FontPathElementPtr fpe,
@@ -1855,17 +1566,12 @@ BitmapOpenScalable (FontPathElementPtr fpe,
long sWidth;
FontEntryPtr scaleFrom;
- FontPathElementPtr scaleFPE;
+ FontPathElementPtr scaleFPE = NULL;
FontPtr sourceFont;
char fontName[MAXFONTNAMELEN];
/* Can't deal with mix-endian fonts yet */
-#ifdef NOTDEF /* XXX need better test */
- if ((format & BitmapFormatByteOrderMask) !=
- (format & BitmapFormatBitOrderMask))
- return NullFontFileName;
-#endif
/* Reject outrageously small font sizes to keep the math from
blowing up. */
@@ -1873,8 +1579,8 @@ BitmapOpenScalable (FontPathElementPtr fpe,
get_matrix_horizontal_component(vals->pixel_matrix) < 1.0)
return BadFontName;
- scaleFrom = (*find_scale[BitmapGetRenderIndex(entry->u.bitmap.renderer)])
- (fpe, entry, vals, &best, &dx, &dy, &sdx, &sdy, &scaleFPE);
+ scaleFrom = FindBestToScale(fpe, entry, vals, &best, &dx, &dy, &sdx, &sdy,
+ &scaleFPE);
if (!scaleFrom)
return BadFontName;
@@ -1894,8 +1600,7 @@ BitmapOpenScalable (FontPathElementPtr fpe,
savedY = dy;
font = ScaleFont(sourceFont, dx, dy, sdx, sdy, vals, &dx, &dy, &sWidth);
if (font)
- font = (*scale[ BitmapGetRenderIndex(entry->u.bitmap.renderer) ])
- (font, sourceFont, savedX, savedY, vals);
+ font = BitmapScaleBitmaps(font, sourceFont, savedX, savedY, vals);
if (!font)
{
@@ -1970,18 +1675,18 @@ bitmapUnloadScalable (FontPtr pFont)
bitmapFont = (BitmapFontPtr) pFont->fontPrivate;
pfi = &pFont->info;
- xfree (pfi->props);
- xfree (pfi->isStringProp);
+ free (pfi->props);
+ free (pfi->isStringProp);
if(bitmapFont->encoding) {
nencoding = (pFont->info.lastCol - pFont->info.firstCol + 1) *
(pFont->info.lastRow - pFont->info.firstRow + 1);
for(i=0; i<NUM_SEGMENTS(nencoding); i++)
- xfree(bitmapFont->encoding[i]);
+ free(bitmapFont->encoding[i]);
}
- xfree (bitmapFont->encoding);
- xfree (bitmapFont->bitmaps);
- xfree (bitmapFont->ink_metrics);
- xfree (bitmapFont->metrics);
- xfree (pFont->fontPrivate);
+ free (bitmapFont->encoding);
+ free (bitmapFont->bitmaps);
+ free (bitmapFont->ink_metrics);
+ free (bitmapFont->metrics);
+ free (pFont->fontPrivate);
DestroyFontRec (pFont);
}
diff --git a/libXfont/src/bitmap/pcfread.c b/libXfont/src/bitmap/pcfread.c
index c5db2555b..182144adc 100644
--- a/libXfont/src/bitmap/pcfread.c
+++ b/libXfont/src/bitmap/pcfread.c
@@ -1,4 +1,3 @@
-/* $Xorg: pcfread.c,v 1.5 2001/02/09 02:04:02 xorgcvs Exp $ */
/*
Copyright 1990, 1998 The Open Group
@@ -138,7 +137,7 @@ pcfReadTOC(FontFilePtr file, int *countp)
pcfError("pcfReadTOC(): invalid file format\n");
return NULL;
}
- tables = (PCFTablePtr) xalloc(count * sizeof(PCFTableRec));
+ tables = malloc(count * sizeof(PCFTableRec));
if (!tables) {
pcfError("pcfReadTOC(): Couldn't allocate tables (%d*%d)\n", count, sizeof(PCFTableRec));
return (PCFTablePtr) NULL;
@@ -155,7 +154,7 @@ pcfReadTOC(FontFilePtr file, int *countp)
return tables;
Bail:
- xfree(tables);
+ free(tables);
return (PCFTablePtr) NULL;
}
@@ -262,12 +261,12 @@ pcfGetProperties(FontInfoPtr pFontInfo, FontFilePtr file,
goto Bail;
}
if (IS_EOF(file)) goto Bail;
- props = (FontPropPtr) xalloc(nprops * sizeof(FontPropRec));
+ props = malloc(nprops * sizeof(FontPropRec));
if (!props) {
pcfError("pcfGetProperties(): Couldn't allocate props (%d*%d)\n", nprops, sizeof(FontPropRec));
goto Bail;
}
- isStringProp = (char *) xalloc(nprops * sizeof(char));
+ isStringProp = malloc(nprops * sizeof(char));
if (!isStringProp) {
pcfError("pcfGetProperties(): Couldn't allocate isStringProp (%d*%d)\n", nprops, sizeof(char));
goto Bail;
@@ -300,7 +299,7 @@ pcfGetProperties(FontInfoPtr pFontInfo, FontFilePtr file,
string_size = pcfGetINT32(file, format);
if (string_size < 0) goto Bail;
if (IS_EOF(file)) goto Bail;
- strings = (char *) xalloc(string_size);
+ strings = malloc(string_size);
if (!strings) {
pcfError("pcfGetProperties(): Couldn't allocate strings (%d)\n", string_size);
goto Bail;
@@ -316,14 +315,14 @@ pcfGetProperties(FontInfoPtr pFontInfo, FontFilePtr file,
strlen(strings + props[i].value), TRUE);
}
}
- xfree(strings);
+ free(strings);
pFontInfo->isStringProp = isStringProp;
pFontInfo->props = props;
pFontInfo->nprops = nprops;
return TRUE;
Bail:
- xfree(isStringProp);
- xfree(props);
+ free(isStringProp);
+ free(props);
return FALSE;
}
@@ -443,7 +442,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr file,
pcfError("pcfReadFont(): invalid file format\n");
goto Bail;
}
- metrics = (CharInfoPtr) xalloc(nmetrics * sizeof(CharInfoRec));
+ metrics = malloc(nmetrics * sizeof(CharInfoRec));
if (!metrics) {
pcfError("pcfReadFont(): Couldn't allocate metrics (%d*%d)\n", nmetrics, sizeof(CharInfoRec));
goto Bail;
@@ -469,7 +468,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr file,
if (nbitmaps != nmetrics || IS_EOF(file))
goto Bail;
/* nmetrics is already ok, so nbitmap also is */
- offsets = (CARD32 *) xalloc(nbitmaps * sizeof(CARD32));
+ offsets = malloc(nbitmaps * sizeof(CARD32));
if (!offsets) {
pcfError("pcfReadFont(): Couldn't allocate offsets (%d*%d)\n", nbitmaps, sizeof(CARD32));
goto Bail;
@@ -487,7 +486,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr file,
sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX(format)];
/* guard against completely empty font */
- bitmaps = xalloc(sizebitmaps ? sizebitmaps : 1);
+ bitmaps = malloc(sizebitmaps ? sizebitmaps : 1);
if (!bitmaps) {
pcfError("pcfReadFont(): Couldn't allocate bitmaps (%d)\n", sizebitmaps ? sizebitmaps : 1);
goto Bail;
@@ -518,7 +517,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr file,
xCharInfo *metric;
sizepadbitmaps = bitmapSizes[PCF_SIZE_TO_INDEX(glyph)];
- padbitmaps = (char *) xalloc(sizepadbitmaps);
+ padbitmaps = malloc(sizepadbitmaps);
if (!padbitmaps) {
pcfError("pcfReadFont(): Couldn't allocate padbitmaps (%d)\n", sizepadbitmaps);
goto Bail;
@@ -533,13 +532,13 @@ pcfReadFont(FontPtr pFont, FontFilePtr file,
metric->rightSideBearing - metric->leftSideBearing,
metric->ascent + metric->descent);
}
- xfree(bitmaps);
+ free(bitmaps);
bitmaps = padbitmaps;
}
for (i = 0; i < nbitmaps; i++)
metrics[i].bits = bitmaps + offsets[i];
- xfree(offsets);
+ free(offsets);
offsets = NULL;
/* ink metrics ? */
@@ -559,7 +558,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr file,
if (nink_metrics != nmetrics)
goto Bail;
/* nmetrics already checked */
- ink_metrics = (xCharInfo *) xalloc(nink_metrics * sizeof(xCharInfo));
+ ink_metrics = malloc(nink_metrics * sizeof(xCharInfo));
if (!ink_metrics) {
pcfError("pcfReadFont(): Couldn't allocate ink_metrics (%d*%d)\n", nink_metrics, sizeof(xCharInfo));
goto Bail;
@@ -595,8 +594,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr file,
nencoding = (pFont->info.lastCol - pFont->info.firstCol + 1) *
(pFont->info.lastRow - pFont->info.firstRow + 1);
- encoding = (CharInfoPtr **) xcalloc(NUM_SEGMENTS(nencoding),
- sizeof(CharInfoPtr*));
+ encoding = calloc(NUM_SEGMENTS(nencoding), sizeof(CharInfoPtr*));
if (!encoding) {
pcfError("pcfReadFont(): Couldn't allocate encoding (%d*%d)\n", nencoding, sizeof(CharInfoPtr));
goto Bail;
@@ -611,8 +609,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr file,
} else {
if(!encoding[SEGMENT_MAJOR(i)]) {
encoding[SEGMENT_MAJOR(i)]=
- (CharInfoPtr*)xcalloc(BITMAP_FONT_SEGMENT_SIZE,
- sizeof(CharInfoPtr));
+ calloc(BITMAP_FONT_SEGMENT_SIZE, sizeof(CharInfoPtr));
if(!encoding[SEGMENT_MAJOR(i)])
goto Bail;
}
@@ -626,7 +623,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr file,
if (!pcfGetAccel (&pFont->info, file, tables, ntables, PCF_BDF_ACCELERATORS))
goto Bail;
- bitmapFont = (BitmapFontPtr) xalloc(sizeof *bitmapFont);
+ bitmapFont = malloc(sizeof *bitmapFont);
if (!bitmapFont) {
pcfError("pcfReadFont(): Couldn't allocate bitmapFont (%d)\n", sizeof *bitmapFont);
goto Bail;
@@ -665,24 +662,24 @@ pcfReadFont(FontPtr pFont, FontFilePtr file,
pFont->byte = byte;
pFont->glyph = glyph;
pFont->scan = scan;
- xfree(tables);
+ free(tables);
return Successful;
Bail:
- xfree(ink_metrics);
+ free(ink_metrics);
if(encoding) {
for(i=0; i<NUM_SEGMENTS(nencoding); i++)
- xfree(encoding[i]);
+ free(encoding[i]);
}
- xfree(encoding);
- xfree(bitmaps);
- xfree(metrics);
- xfree(pFont->info.props);
+ free(encoding);
+ free(bitmaps);
+ free(metrics);
+ free(pFont->info.props);
pFont->info.nprops = 0;
pFont->info.props = 0;
- xfree (pFont->info.isStringProp);
- xfree(bitmapFont);
- xfree(tables);
- xfree(offsets);
+ free (pFont->info.isStringProp);
+ free(bitmapFont);
+ free(tables);
+ free(offsets);
return AllocError;
}
@@ -750,13 +747,13 @@ pcfReadFontInfo(FontInfoPtr pFontInfo, FontFilePtr file)
if (!pcfGetAccel (pFontInfo, file, tables, ntables, PCF_BDF_ACCELERATORS))
goto Bail;
- xfree(tables);
+ free(tables);
return Successful;
Bail:
pFontInfo->nprops = 0;
- xfree (pFontInfo->props);
- xfree (pFontInfo->isStringProp);
- xfree(tables);
+ free (pFontInfo->props);
+ free (pFontInfo->isStringProp);
+ free(tables);
return AllocError;
}
@@ -767,258 +764,18 @@ pcfUnloadFont(FontPtr pFont)
int i,nencoding;
bitmapFont = (BitmapFontPtr) pFont->fontPrivate;
- xfree(bitmapFont->ink_metrics);
+ free(bitmapFont->ink_metrics);
if(bitmapFont->encoding) {
nencoding = (pFont->info.lastCol - pFont->info.firstCol + 1) *
(pFont->info.lastRow - pFont->info.firstRow + 1);
for(i=0; i<NUM_SEGMENTS(nencoding); i++)
- xfree(bitmapFont->encoding[i]);
- }
- xfree(bitmapFont->encoding);
- xfree(bitmapFont->bitmaps);
- xfree(bitmapFont->metrics);
- xfree(pFont->info.isStringProp);
- xfree(pFont->info.props);
- xfree(bitmapFont);
+ free(bitmapFont->encoding[i]);
+ }
+ free(bitmapFont->encoding);
+ free(bitmapFont->bitmaps);
+ free(bitmapFont->metrics);
+ free(pFont->info.isStringProp);
+ free(pFont->info.props);
+ free(bitmapFont);
DestroyFontRec(pFont);
}
-
-int
-pmfReadFont(FontPtr pFont, FontFilePtr file,
- int bit, int byte, int glyph, int scan)
-{
- CARD32 format;
- CARD32 size;
- BitmapFontPtr bitmapFont = 0;
- int i;
- PCFTablePtr tables = 0;
- int ntables;
- int nmetrics;
- int sizebitmaps;
- int nink_metrics;
- CharInfoPtr metrics = 0;
- xCharInfo *ink_metrics = 0;
- char *bitmaps = 0;
- CharInfoPtr **encoding = 0;
- int nencoding = 0;
- int encodingOffset;
- Bool hasBDFAccelerators;
- CharInfoPtr pci;
-
- pFont->info.nprops = 0;
- pFont->info.props = 0;
-
- if (!(tables = pcfReadTOC(file, &ntables)))
- goto Bail;
-
- /* properties */
-
- if (!pcfGetProperties(&pFont->info, file, tables, ntables))
- goto Bail;
-
- /* Use the old accelerators if no BDF accelerators are in the file */
-
- hasBDFAccelerators = pcfHasType (tables, ntables, PCF_BDF_ACCELERATORS);
- if (!hasBDFAccelerators)
- if (!pcfGetAccel (&pFont->info, file, tables, ntables, PCF_ACCELERATORS))
- goto Bail;
-
- /* metrics */
-
- if (!pcfSeekToType(file, tables, ntables, PCF_METRICS, &format, &size)) {
- goto Bail;
- }
- format = pcfGetLSB32(file);
- if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT) &&
- !PCF_FORMAT_MATCH(format, PCF_COMPRESSED_METRICS)) {
- goto Bail;
- }
- if (PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT))
- nmetrics = pcfGetINT32(file, format);
- else
- nmetrics = pcfGetINT16(file, format);
- if (IS_EOF(file)) goto Bail;
- if (nmetrics < 0 || nmetrics > INT32_MAX / sizeof(CharInfoRec)) {
- pcfError("pmfReadFont(): invalid file format\n");
- goto Bail;
- }
- metrics = (CharInfoPtr) xalloc(nmetrics * sizeof(CharInfoRec));
- if (!metrics) {
- pcfError("pmfReadFont(): Couldn't allocate metrics (%d*%d)\n", nmetrics, sizeof(CharInfoRec));
- goto Bail;
- }
- for (i = 0; i < nmetrics; i++)
- if (PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) {
- if (!pcfGetMetric(file, format, &(metrics + i)->metrics))
- goto Bail;
- } else {
- if (!pcfGetCompressedMetric(file, format, &(metrics + i)->metrics))
- goto Bail;
- }
-
- /* Set the bitmaps to all point to the same zero filled array
- * that is the size of the largest bitmap.
- */
-
- pci = metrics;
- sizebitmaps = 0;
- for (i = 0; i < nmetrics; i++)
- {
- sizebitmaps = MAX(sizebitmaps,BYTES_FOR_GLYPH(pci, glyph));
- pci++;
- }
-
-#ifdef FONTMODULE
- sizebitmaps = 1024; /* Default - we xalloc the size anyway */
-#else
- sizebitmaps = BUFSIZ;
-#endif
- /* guard against completely empty font */
- bitmaps = (char *) xalloc(sizebitmaps);
- if (!bitmaps) {
- pcfError("pmfReadFont(): Couldn't allocate bitmaps (%d)\n", sizebitmaps);
- goto Bail;
- }
-
- memset(bitmaps,0,sizebitmaps);
- for (i = 0; i < nmetrics; i++)
- metrics[i].bits = bitmaps;
-
- /* ink metrics ? */
-
- ink_metrics = NULL;
- if (pcfSeekToType(file, tables, ntables, PCF_INK_METRICS, &format, &size)) {
- format = pcfGetLSB32(file);
- if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT) &&
- !PCF_FORMAT_MATCH(format, PCF_COMPRESSED_METRICS)) {
- goto Bail;
- }
- if (PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT))
- nink_metrics = pcfGetINT32(file, format);
- else
- nink_metrics = pcfGetINT16(file, format);
- if (nink_metrics != nmetrics)
- goto Bail;
- if (IS_EOF(file)) goto Bail;
- ink_metrics = (xCharInfo *) xalloc(nink_metrics * sizeof(xCharInfo));
- if (!ink_metrics) {
- pcfError("pmfReadFont(): Couldn't allocate ink_metrics (%d*%d)\n", nink_metrics, sizeof(xCharInfo));
- goto Bail;
- }
- for (i = 0; i < nink_metrics; i++)
- if (PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) {
- if (!pcfGetMetric(file, format, ink_metrics + i))
- goto Bail;
- } else {
- if (!pcfGetCompressedMetric(file, format, ink_metrics + i))
- goto Bail;
- }
- }
-
- /* encoding */
-
- if (!pcfSeekToType(file, tables, ntables, PCF_BDF_ENCODINGS, &format, &size))
- goto Bail;
- format = pcfGetLSB32(file);
- if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT))
- goto Bail;
-
- pFont->info.firstCol = pcfGetINT16(file, format);
- pFont->info.lastCol = pcfGetINT16(file, format);
- pFont->info.firstRow = pcfGetINT16(file, format);
- pFont->info.lastRow = pcfGetINT16(file, format);
- pFont->info.defaultCh = pcfGetINT16(file, format);
- if (IS_EOF(file)) goto Bail;
-
- nencoding = (pFont->info.lastCol - pFont->info.firstCol + 1) *
- (pFont->info.lastRow - pFont->info.firstRow + 1);
-
- encoding = (CharInfoPtr **) xcalloc(NUM_SEGMENTS(nencoding),
- sizeof(CharInfoPtr*));
- if (!encoding) {
- pcfError("pmfReadFont(): 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);
- if (IS_EOF(file)) goto Bail;
- if (encodingOffset == 0xFFFF) {
- pFont->info.allExist = FALSE;
- } else {
- if(!encoding[SEGMENT_MAJOR(i)]) {
- encoding[SEGMENT_MAJOR(i)]=
- (CharInfoPtr*)xcalloc(BITMAP_FONT_SEGMENT_SIZE,
- sizeof(CharInfoPtr));
- if(!encoding[SEGMENT_MAJOR(i)])
- goto Bail;
- }
- ACCESSENCODINGL(encoding, i) = metrics + encodingOffset;
- }
- }
- if (IS_EOF(file)) goto Bail;
-
- /* BDF style accelerators (i.e. bounds based on encoded glyphs) */
-
- if (hasBDFAccelerators)
- if (!pcfGetAccel (&pFont->info, file, tables, ntables, PCF_BDF_ACCELERATORS))
- goto Bail;
-
- bitmapFont = (BitmapFontPtr) xalloc(sizeof *bitmapFont);
- if (!bitmapFont) {
- pcfError("pmfReadFont(): Couldn't allocate bitmapFont (%d)\n", sizeof *bitmapFont);
- goto Bail;
- }
-
- bitmapFont->version_num = PCF_FILE_VERSION;
- bitmapFont->num_chars = nmetrics;
- bitmapFont->num_tables = ntables;
- bitmapFont->metrics = metrics;
- bitmapFont->ink_metrics = ink_metrics;
- bitmapFont->bitmaps = bitmaps;
- bitmapFont->encoding = encoding;
- bitmapFont->pDefault = (CharInfoPtr) 0;
- if (pFont->info.defaultCh != (unsigned short) NO_SUCH_CHAR) {
- unsigned int r,
- c,
- cols;
-
- r = pFont->info.defaultCh >> 8;
- c = pFont->info.defaultCh & 0xFF;
- if (pFont->info.firstRow <= r && r <= pFont->info.lastRow &&
- pFont->info.firstCol <= c && c <= pFont->info.lastCol) {
- cols = pFont->info.lastCol - pFont->info.firstCol + 1;
- r = r - pFont->info.firstRow;
- c = c - pFont->info.firstCol;
- bitmapFont->pDefault = ACCESSENCODING(encoding, r * cols + c);
- }
- }
- bitmapFont->bitmapExtra = (BitmapExtraPtr) 0;
- pFont->fontPrivate = (pointer) bitmapFont;
- pFont->get_glyphs = bitmapGetGlyphs;
- pFont->get_metrics = bitmapGetMetrics;
- pFont->unload_font = pcfUnloadFont;
- pFont->unload_glyphs = NULL;
- pFont->bit = bit;
- pFont->byte = byte;
- pFont->glyph = glyph;
- pFont->scan = scan;
- xfree(tables);
- return Successful;
-Bail:
- xfree(ink_metrics);
- if(encoding) {
- for(i=0; i<NUM_SEGMENTS(nencoding); i++)
- xfree(encoding[i]);
- }
- xfree(encoding);
- xfree(bitmaps);
- xfree(metrics);
- xfree(pFont->info.props);
- pFont->info.nprops = 0;
- pFont->info.props = 0;
- xfree (pFont->info.isStringProp);
- xfree(bitmapFont);
- xfree(tables);
- return AllocError;
-}
diff --git a/libXfont/src/bitmap/pcfwrite.c b/libXfont/src/bitmap/pcfwrite.c
index 8d5e9425f..5d1aab154 100644
--- a/libXfont/src/bitmap/pcfwrite.c
+++ b/libXfont/src/bitmap/pcfwrite.c
@@ -236,7 +236,7 @@ pcfWriteFont(FontPtr pFont, FontFilePtr file)
ink_minbounds = &pFont->info.ink_minbounds;
ink_maxbounds = &pFont->info.ink_maxbounds;
}
- offsetProps = (FontPropPtr) xalloc(pFont->info.nprops * sizeof(FontPropRec));
+ offsetProps = malloc(pFont->info.nprops * sizeof(FontPropRec));
if (!offsetProps) {
pcfError("pcfWriteFont(): Couldn't allocate offsetProps (%d*%d)", pFont->info.nprops, sizeof(FontPropRec));
return AllocError;
@@ -358,7 +358,7 @@ pcfWriteFont(FontPtr pFont, FontFilePtr file)
if (current_position > table->offset) {
printf("can't go backwards... %d > %d\n",
(int)current_position, (int)table->offset);
- xfree(offsetProps);
+ free(offsetProps);
return BadFontName;
}
while (current_position < table->offset)
@@ -463,6 +463,6 @@ pcfWriteFont(FontPtr pFont, FontFilePtr file)
}
}
- xfree(offsetProps);
+ free(offsetProps);
return Successful;
}
diff --git a/libXfont/src/bitmap/snfread.c b/libXfont/src/bitmap/snfread.c
index f48e2d8a7..53a72da9f 100644
--- a/libXfont/src/bitmap/snfread.c
+++ b/libXfont/src/bitmap/snfread.c
@@ -55,10 +55,7 @@ from The Open Group.
#include <config.h>
#endif
-#ifndef FONTMODULE
#include <ctype.h>
-#endif
-
#include <X11/fonts/fntfilst.h>
#include <X11/fonts/bitmap.h>
#include "snfstr.h"
@@ -150,14 +147,14 @@ snfReadProps(snfFontInfoPtr snfInfo, FontInfoPtr pFontInfo, FontFilePtr file)
bytestoalloc = snfInfo->nProps * sizeof(snfFontPropRec) +
BYTESOFSTRINGINFO(snfInfo);
- propspace = (char *) xalloc(bytestoalloc);
+ propspace = malloc(bytestoalloc);
if (!propspace) {
snfError("snfReadProps(): Couldn't allocate propspace (%d)\n", bytestoalloc);
return AllocError;
}
if (FontFileRead(file, propspace, bytestoalloc) != bytestoalloc) {
- xfree(propspace);
+ free(propspace);
return BadFontName;
}
psnfp = (snfFontPropPtr) propspace;
@@ -175,7 +172,7 @@ snfReadProps(snfFontInfoPtr snfInfo, FontInfoPtr pFontInfo, FontFilePtr file)
pfp->value = psnfp->value;
}
- xfree(propspace);
+ free(propspace);
return Successful;
}
@@ -269,16 +266,16 @@ snfReadFont(FontPtr pFont, FontFilePtr file,
if (fi.inkMetrics)
bytestoalloc += num_chars * sizeof(xCharInfo); /* ink_metrics */
- fontspace = (char *) xalloc(bytestoalloc);
+ fontspace = malloc(bytestoalloc);
if (!fontspace) {
snfError("snfReadFont(): Couldn't allocate fontspace (%d)\n", bytestoalloc);
return AllocError;
}
- bitmaps = (char *) xalloc (bitmapsSize);
+ bitmaps = malloc (bitmapsSize);
if (!bitmaps)
{
snfError("snfReadFont(): Couldn't allocate bitmaps (%d)\n", bitmapsSize);
- xfree (fontspace);
+ free (fontspace);
return AllocError;
}
/*
@@ -311,8 +308,7 @@ snfReadFont(FontPtr pFont, FontFilePtr file,
if (bitmapFont->metrics[i].bits) {
if (!bitmapFont->encoding[SEGMENT_MAJOR(i)]) {
bitmapFont->encoding[SEGMENT_MAJOR(i)]=
- (CharInfoPtr*)xcalloc(BITMAP_FONT_SEGMENT_SIZE,
- sizeof(CharInfoPtr));
+ calloc(BITMAP_FONT_SEGMENT_SIZE, sizeof(CharInfoPtr));
if (!bitmapFont->encoding[SEGMENT_MAJOR(i)]) {
ret = AllocError;
break;
@@ -323,12 +319,12 @@ snfReadFont(FontPtr pFont, FontFilePtr file,
}
if (ret != Successful) {
- xfree(bitmaps);
+ free(bitmaps);
if(bitmapFont->encoding) {
for(j=0; j<SEGMENT_MAJOR(i); j++)
- xfree(bitmapFont->encoding[i]);
+ free(bitmapFont->encoding[i]);
}
- xfree(fontspace);
+ free(fontspace);
return ret;
}
/*
@@ -336,8 +332,8 @@ snfReadFont(FontPtr pFont, FontFilePtr file,
*/
if (FontFileRead(file, bitmaps, bitmapsSize) != bitmapsSize) {
- xfree(bitmaps);
- xfree(fontspace);
+ free(bitmaps);
+ free(fontspace);
return BadFontName;
}
@@ -369,11 +365,11 @@ snfReadFont(FontPtr pFont, FontFilePtr file,
sizepadbitmaps += BYTES_FOR_GLYPH(metric,glyph);
metric++;
}
- padbitmaps = (char *) xalloc(sizepadbitmaps);
+ padbitmaps = malloc(sizepadbitmaps);
if (!padbitmaps) {
snfError("snfReadFont(): Couldn't allocate padbitmaps (%d)\n", sizepadbitmaps);
- xfree (bitmaps);
- xfree (fontspace);
+ free (bitmaps);
+ free (fontspace);
return AllocError;
}
metric = bitmapFont->metrics;
@@ -388,14 +384,14 @@ snfReadFont(FontPtr pFont, FontFilePtr file,
padbitmaps += sizechar;
metric++;
}
- xfree(bitmaps);
+ free(bitmaps);
}
/* now read and atom'ize properties */
ret = snfReadProps(&fi, &pFont->info, file);
if (ret != Successful) {
- xfree(fontspace);
+ free(fontspace);
return ret;
}
snfCopyInfo(&fi, &pFont->info);
@@ -409,7 +405,7 @@ snfReadFont(FontPtr pFont, FontFilePtr file,
for (i = 0; ret == Successful && i < num_chars; i++)
ret = snfReadxCharInfo(file, &bitmapFont->ink_metrics[i]);
if (ret != Successful) {
- xfree(fontspace);
+ free(fontspace);
return ret;
}
} else {
@@ -458,15 +454,15 @@ snfReadFontInfo(FontInfoPtr pFontInfo, FontFilePtr file)
return ret;
snfCopyInfo(&fi, pFontInfo);
- pFontInfo->props = (FontPropPtr) xalloc(fi.nProps * sizeof(FontPropRec));
+ pFontInfo->props = malloc(fi.nProps * sizeof(FontPropRec));
if (!pFontInfo->props) {
snfError("snfReadFontInfo(): Couldn't allocate props (%d*%d)\n", fi.nProps, sizeof(FontPropRec));
return AllocError;
}
- pFontInfo->isStringProp = (char *) xalloc(fi.nProps * sizeof(char));
+ pFontInfo->isStringProp = malloc(fi.nProps * sizeof(char));
if (!pFontInfo->isStringProp) {
snfError("snfReadFontInfo(): Couldn't allocate isStringProp (%d*%d)\n", fi.nProps, sizeof(char));
- xfree(pFontInfo->props);
+ free(pFontInfo->props);
return AllocError;
}
num_chars = n2dChars(&fi);
@@ -476,21 +472,21 @@ snfReadFontInfo(FontInfoPtr pFontInfo, FontFilePtr file)
ret = snfReadProps(&fi, pFontInfo, file);
if (ret != Successful) {
- xfree(pFontInfo->props);
- xfree(pFontInfo->isStringProp);
+ free(pFontInfo->props);
+ free(pFontInfo->isStringProp);
return ret;
}
if (fi.inkMetrics) {
ret = snfReadxCharInfo(file, &pFontInfo->ink_minbounds);
if (ret != Successful) {
- xfree(pFontInfo->props);
- xfree(pFontInfo->isStringProp);
+ free(pFontInfo->props);
+ free(pFontInfo->isStringProp);
return ret;
}
ret = snfReadxCharInfo(file, &pFontInfo->ink_maxbounds);
if (ret != Successful) {
- xfree(pFontInfo->props);
- xfree(pFontInfo->isStringProp);
+ free(pFontInfo->props);
+ free(pFontInfo->isStringProp);
return ret;
}
} else {
@@ -507,8 +503,8 @@ snfUnloadFont(FontPtr pFont)
BitmapFontPtr bitmapFont;
bitmapFont = (BitmapFontPtr) pFont->fontPrivate;
- xfree (bitmapFont->bitmaps);
- xfree (bitmapFont);
+ free (bitmapFont->bitmaps);
+ free (bitmapFont);
DestroyFontRec (pFont);
}