aboutsummaryrefslogtreecommitdiff
path: root/libXfont/src/bitmap
diff options
context:
space:
mode:
Diffstat (limited to 'libXfont/src/bitmap')
-rw-r--r--libXfont/src/bitmap/Makefile.am24
-rw-r--r--libXfont/src/bitmap/Makefile.in37
-rw-r--r--libXfont/src/bitmap/bitmap.c14
-rw-r--r--libXfont/src/bitmap/bitmapfunc.c43
-rw-r--r--libXfont/src/bitmap/bitscale.c26
-rw-r--r--libXfont/src/bitmap/fontink.c2
-rw-r--r--libXfont/src/bitmap/snfstr.h2
7 files changed, 73 insertions, 75 deletions
diff --git a/libXfont/src/bitmap/Makefile.am b/libXfont/src/bitmap/Makefile.am
index 99682d9db..0f2d10a02 100644
--- a/libXfont/src/bitmap/Makefile.am
+++ b/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/libXfont/src/bitmap/Makefile.in b/libXfont/src/bitmap/Makefile.in
index 5aa1a4a7b..4f654aa67 100644
--- a/libXfont/src/bitmap/Makefile.in
+++ b/libXfont/src/bitmap/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.14 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -78,6 +78,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.in $(srcdir)/Makefile.am \
$(top_srcdir)/depcomp
@@ -92,9 +96,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@)
@@ -135,7 +146,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;; \
@@ -315,19 +326,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/libXfont/src/bitmap/bitmap.c b/libXfont/src/bitmap/bitmap.c
index 1ceb4bb17..0a379eb08 100644
--- a/libXfont/src/bitmap/bitmap.c
+++ b/libXfont/src/bitmap/bitmap.c
@@ -36,8 +36,8 @@ in this Software without prior written authorization from The Open Group.
#include <X11/fonts/bitmap.h>
int
-bitmapGetGlyphs(FontPtr pFont, unsigned long count, unsigned char *chars,
- FontEncoding charEncoding,
+bitmapGetGlyphs(FontPtr pFont, unsigned long count, unsigned char *chars,
+ FontEncoding charEncoding,
unsigned long *glyphCount, /* RETURN */
CharInfoPtr *glyphs) /* RETURN */
{
@@ -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;
@@ -126,8 +130,8 @@ bitmapGetGlyphs(FontPtr pFont, unsigned long count, unsigned char *chars,
static CharInfoRec nonExistantChar;
int
-bitmapGetMetrics(FontPtr pFont, unsigned long count, unsigned char *chars,
- FontEncoding charEncoding,
+bitmapGetMetrics(FontPtr pFont, unsigned long count, unsigned char *chars,
+ FontEncoding charEncoding,
unsigned long *glyphCount, /* RETURN */
xCharInfo **glyphs) /* RETURN */
{
diff --git a/libXfont/src/bitmap/bitmapfunc.c b/libXfont/src/bitmap/bitmapfunc.c
index 47ce488d0..8c6b3d896 100644
--- a/libXfont/src/bitmap/bitmapfunc.c
+++ b/libXfont/src/bitmap/bitmapfunc.c
@@ -32,34 +32,25 @@ 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 */,
+ int (*ReadFont) (FontPtr /* pFont */, FontFilePtr /* file */,
+ int /* bit */, int /* byte */,
int /* glyph */, int /* scan */);
- int (*ReadInfo) ( FontInfoPtr /* pFontInfo */,
+ int (*ReadInfo) ( FontInfoPtr /* pFontInfo */,
FontFilePtr /* file */ );
} BitmapFileFunctionsRec, *BitmapFileFunctionsPtr;
@@ -107,8 +98,8 @@ static BitmapFileFunctionsRec readers[] = {
#define CAPABILITIES (CAP_MATRIX | CAP_CHARSUBSETTING)
static int
-BitmapOpenBitmap (FontPathElementPtr fpe, FontPtr *ppFont, int flags,
- FontEntryPtr entry, char *fileName,
+BitmapOpenBitmap (FontPathElementPtr fpe, FontPtr *ppFont, int flags,
+ FontEntryPtr entry, char *fileName,
fsBitmapFormat format, fsBitmapFormatMask fmask,
FontPtr non_cachable_font) /* We don't do licensing */
{
@@ -152,7 +143,7 @@ BitmapOpenBitmap (FontPathElementPtr fpe, FontPtr *ppFont, int flags,
}
static int
-BitmapGetInfoBitmap (FontPathElementPtr fpe, FontInfoPtr pFontInfo,
+BitmapGetInfoBitmap (FontPathElementPtr fpe, FontInfoPtr pFontInfo,
FontEntryPtr entry, char *fileName)
{
FontFilePtr file;
@@ -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/libXfont/src/bitmap/bitscale.c b/libXfont/src/bitmap/bitscale.c
index e89ba7ce0..c9af4c031 100644
--- a/libXfont/src/bitmap/bitscale.c
+++ b/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;
diff --git a/libXfont/src/bitmap/fontink.c b/libXfont/src/bitmap/fontink.c
index ad7091fa6..f4898da10 100644
--- a/libXfont/src/bitmap/fontink.c
+++ b/libXfont/src/bitmap/fontink.c
@@ -98,7 +98,7 @@ FontCharInkMetrics(FontPtr pFont, CharInfoPtr pCI, xCharInfo *pInk)
found_ascent:
pInk->ascent = vpos - descent + 1;
- p = ((unsigned char *) pCI->bits) + bitmapByteWidthPadded *
+ p = ((unsigned char *) pCI->bits) + bitmapByteWidthPadded *
(descent + ascent - 1) + bitmapByteWidth;
for (vpos = descent + ascent; --vpos >= 0;) {
diff --git a/libXfont/src/bitmap/snfstr.h b/libXfont/src/bitmap/snfstr.h
index 148bb1fcc..8f39ded01 100644
--- a/libXfont/src/bitmap/snfstr.h
+++ b/libXfont/src/bitmap/snfstr.h
@@ -175,7 +175,7 @@ typedef struct _snfFontInfo {
} snfFontInfoRec;
extern void SnfSetFormat ( int bit, int byte, int glyph, int scan );
-extern int snfReadFont ( FontPtr pFont, FontFilePtr file,
+extern int snfReadFont ( FontPtr pFont, FontFilePtr file,
int bit, int byte, int glyph, int scan );
extern int snfReadFontInfo ( FontInfoPtr pFontInfo, FontFilePtr file );