diff options
Diffstat (limited to 'lib/libXfont/src/bitmap')
-rw-r--r-- | lib/libXfont/src/bitmap/Makefile.am | 24 | ||||
-rw-r--r-- | lib/libXfont/src/bitmap/Makefile.in | 35 | ||||
-rw-r--r-- | lib/libXfont/src/bitmap/bitmap.c | 6 | ||||
-rw-r--r-- | lib/libXfont/src/bitmap/bitmapfunc.c | 31 | ||||
-rw-r--r-- | lib/libXfont/src/bitmap/bitscale.c | 26 |
5 files changed, 60 insertions, 62 deletions
diff --git a/lib/libXfont/src/bitmap/Makefile.am b/lib/libXfont/src/bitmap/Makefile.am index 99682d9db..0f2d10a02 100644 --- a/lib/libXfont/src/bitmap/Makefile.am +++ b/lib/libXfont/src/bitmap/Makefile.am @@ -6,14 +6,24 @@ AM_CFLAGS = $(XFONT_CFLAGS) $(OS_CFLAGS) $(CWARNFLAGS) noinst_LTLIBRARIES = libbitmap.la libbitmap_la_SOURCES = \ - bdfread.c \ - bdfutils.c \ bitmap.c \ bitmapfunc.c \ bitmaputil.c \ bitscale.c \ - fontink.c \ - pcfread.c \ - pcfwrite.c \ - snfread.c \ - snfstr.h + fontink.c + +if XFONT_BDFFORMAT +libbitmap_la_SOURCES += bdfread.c bdfutils.c +endif + +if XFONT_PCF_OR_BUILTIN +libbitmap_la_SOURCES += pcfread.c +endif + +if XFONT_PCFFORMAT +libbitmap_la_SOURCES += pcfwrite.c +endif + +if XFONT_SNFFORMAT +libbitmap_la_SOURCES += snfread.c snfstr.h +endif diff --git a/lib/libXfont/src/bitmap/Makefile.in b/lib/libXfont/src/bitmap/Makefile.in index 5103ae959..f74d78a37 100644 --- a/lib/libXfont/src/bitmap/Makefile.in +++ b/lib/libXfont/src/bitmap/Makefile.in @@ -50,6 +50,10 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@XFONT_BDFFORMAT_TRUE@am__append_1 = bdfread.c bdfutils.c +@XFONT_PCF_OR_BUILTIN_TRUE@am__append_2 = pcfread.c +@XFONT_PCFFORMAT_TRUE@am__append_3 = pcfwrite.c +@XFONT_SNFFORMAT_TRUE@am__append_4 = snfread.c snfstr.h subdir = src/bitmap DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp @@ -64,9 +68,16 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libbitmap_la_LIBADD = -am_libbitmap_la_OBJECTS = bdfread.lo bdfutils.lo bitmap.lo \ - bitmapfunc.lo bitmaputil.lo bitscale.lo fontink.lo pcfread.lo \ - pcfwrite.lo snfread.lo +am__libbitmap_la_SOURCES_DIST = bitmap.c bitmapfunc.c bitmaputil.c \ + bitscale.c fontink.c bdfread.c bdfutils.c pcfread.c pcfwrite.c \ + snfread.c snfstr.h +@XFONT_BDFFORMAT_TRUE@am__objects_1 = bdfread.lo bdfutils.lo +@XFONT_PCF_OR_BUILTIN_TRUE@am__objects_2 = pcfread.lo +@XFONT_PCFFORMAT_TRUE@am__objects_3 = pcfwrite.lo +@XFONT_SNFFORMAT_TRUE@am__objects_4 = snfread.lo +am_libbitmap_la_OBJECTS = bitmap.lo bitmapfunc.lo bitmaputil.lo \ + bitscale.lo fontink.lo $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) $(am__objects_4) libbitmap_la_OBJECTS = $(am_libbitmap_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -107,7 +118,7 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libbitmap_la_SOURCES) -DIST_SOURCES = $(libbitmap_la_SOURCES) +DIST_SOURCES = $(am__libbitmap_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -272,19 +283,9 @@ AM_CPPFLAGS = \ AM_CFLAGS = $(XFONT_CFLAGS) $(OS_CFLAGS) $(CWARNFLAGS) noinst_LTLIBRARIES = libbitmap.la -libbitmap_la_SOURCES = \ - bdfread.c \ - bdfutils.c \ - bitmap.c \ - bitmapfunc.c \ - bitmaputil.c \ - bitscale.c \ - fontink.c \ - pcfread.c \ - pcfwrite.c \ - snfread.c \ - snfstr.h - +libbitmap_la_SOURCES = bitmap.c bitmapfunc.c bitmaputil.c bitscale.c \ + fontink.c $(am__append_1) $(am__append_2) $(am__append_3) \ + $(am__append_4) all: all-am .SUFFIXES: diff --git a/lib/libXfont/src/bitmap/bitmap.c b/lib/libXfont/src/bitmap/bitmap.c index 9b20fafe9..0a379eb08 100644 --- a/lib/libXfont/src/bitmap/bitmap.c +++ b/lib/libXfont/src/bitmap/bitmap.c @@ -63,8 +63,12 @@ bitmapGetGlyphs(FontPtr pFont, unsigned long count, unsigned char *chars, case Linear8Bit: case TwoD8Bit: - if (pFont->info.firstRow > 0) + if (pFont->info.firstRow > 0) { + if (pDefault) + while (count--) + *glyphs++ = pDefault; break; + } if (pFont->info.allExist && pDefault) { while (count--) { c = (*chars++) - firstCol; diff --git a/lib/libXfont/src/bitmap/bitmapfunc.c b/lib/libXfont/src/bitmap/bitmapfunc.c index 603d5d904..8c6b3d896 100644 --- a/lib/libXfont/src/bitmap/bitmapfunc.c +++ b/lib/libXfont/src/bitmap/bitmapfunc.c @@ -32,29 +32,20 @@ in this Software without prior written authorization from The Open Group. #include <config.h> #endif -/* - * Translate monolithic #defines to modular definitions - */ - -#ifdef PCFFORMAT -#define XFONT_PCFFORMAT 1 -#endif - -#ifdef SNFFORMAT -#define XFONT_SNFFORMAT 1 -#endif - -#ifdef BDFFORMAT -#define XFONT_BDFFORMAT 1 -#endif - #include <X11/fonts/fntfilst.h> #include <X11/fonts/bitmap.h> #include <X11/fonts/fontutil.h> +#if XFONT_BDFFORMAT #include <X11/fonts/bdfint.h> +#endif +#if XFONT_PCFFORMAT #include <X11/fonts/pcf.h> +#endif +#if XFONT_SNFFORMAT #include "snfstr.h" +#endif +#if XFONT_PCFFORMAT || XFONT_SNFFORMAT || XFONT_BDFFORMAT typedef struct _BitmapFileFunctions { int (*ReadFont) (FontPtr /* pFont */, FontFilePtr /* file */, int /* bit */, int /* byte */, @@ -252,3 +243,11 @@ BitmapGetRenderIndex(FontRendererPtr renderer) { return renderer - renderers; } + +#else +void +BitmapRegisterFontFileFunctions (void) +{ + /* nothing to do */ +} +#endif /* XFONT_PCFFORMAT || XFONT_SNFFORMAT || XFONT_BDFFORMAT */ diff --git a/lib/libXfont/src/bitmap/bitscale.c b/lib/libXfont/src/bitmap/bitscale.c index e89ba7ce0..c9af4c031 100644 --- a/lib/libXfont/src/bitmap/bitscale.c +++ b/lib/libXfont/src/bitmap/bitscale.c @@ -34,22 +34,6 @@ from The Open Group. #include <config.h> #endif -/* - * Translate monolithic #defines to modular definitions - */ - -#ifdef PCFFORMAT -#define XFONT_PCFFORMAT 1 -#endif - -#ifdef SNFFORMAT -#define XFONT_SNFFORMAT 1 -#endif - -#ifdef BDFFORMAT -#define XFONT_BDFFORMAT 1 -#endif - #include <X11/fonts/fntfilst.h> #include <X11/fonts/bitmap.h> #include <X11/fonts/fontutil.h> @@ -60,7 +44,7 @@ from The Open Group. #endif /* Should get this from elsewhere */ -extern unsigned long serverGeneration; +extern unsigned long __GetServerGeneration(void); static void bitmapUnloadScalable (FontPtr pFont); static void ScaleBitmap ( FontPtr pFont, CharInfoPtr opci, @@ -597,9 +581,9 @@ ComputeScaledProperties(FontInfoPtr sourceFontInfo, /* the font to be scaled */ char *isStringProp; int nProps; - if (bitscaleGeneration != serverGeneration) { + if (bitscaleGeneration != __GetServerGeneration()) { initFontPropTable(); - bitscaleGeneration = serverGeneration; + bitscaleGeneration = __GetServerGeneration(); } nProps = NPROPS + 1 + sizeof(fontPropTable) / sizeof(fontProp) + sizeof(rawFontPropTable) / sizeof(fontProp); @@ -751,6 +735,8 @@ compute_xform_matrix(FontScalablePtr vals, double dx, double dy, * ScaleFont * returns a pointer to the new scaled font, or NULL (due to AllocError). */ +#pragma GCC diagnostic ignored "-Wbad-function-cast" + static FontPtr ScaleFont(FontPtr opf, /* originating font */ double widthMult, /* glyphs width scale factor */ @@ -811,8 +797,6 @@ ScaleFont(FontPtr opf, /* originating font */ needs to be for the output font */ if (vals->nranges) { - int i; - pfi->allExist = 0; firstCol = 255; lastCol = 0; |