[PATCH:font/schumacher-misc] Replace common font checks with new macros from font-utils 1.1

Alan Coopersmith alan.coopersmith at sun.com
Mon Oct 5 19:51:37 PDT 2009


Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
---

A sample of a bitmap font module updated to use the new macros, including
support for other compression types besides just gzip.

 Makefile.am  |   42 +++++++++++++++++++++---------------------
 configure.ac |   18 +++---------------
 2 files changed, 24 insertions(+), 36 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 6a97fdb..573a2dd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -56,84 +56,84 @@ FONT_FILES = $(BDF2UCS_FONT_FILES) $(EXTRA_FONT_FILES)
 TRUNC_FONT_FILES = $(BDF2UCS_FONT_FILES)
 
 BDF_FILES = $(FONT_FILES:%=%.bdf)
-PCF_FILES = $(FONT_FILES:%=%.pcf.gz)
+PCF_FILES = $(FONT_FILES:%=%.pcf$(COMPRESS_SUFFIX))
 
 TRUNC_BDF_FILES = $(TRUNC_FONT_FILES:%=%t.bdf)
-TRUNC_PCF_FILES = $(TRUNC_FONT_FILES:%=%.pcf.gz)
+TRUNC_PCF_FILES = $(TRUNC_FONT_FILES:%=%.pcf$(COMPRESS_SUFFIX))
 
 if ISO8859_1
 ISO8859_1_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-1.bdf)
-ISO8859_1_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-1.pcf.gz)
+ISO8859_1_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-1.pcf$(COMPRESS_SUFFIX))
 endif
 
 if ISO8859_2
 ISO8859_2_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-2.bdf)
-ISO8859_2_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-2.pcf.gz)
+ISO8859_2_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-2.pcf$(COMPRESS_SUFFIX))
 endif
 
 if ISO8859_3
 ISO8859_3_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-3.bdf)
-ISO8859_3_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-3.pcf.gz)
+ISO8859_3_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-3.pcf$(COMPRESS_SUFFIX))
 endif
 
 if ISO8859_4
 ISO8859_4_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-4.bdf)
-ISO8859_4_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-4.pcf.gz)
+ISO8859_4_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-4.pcf$(COMPRESS_SUFFIX))
 endif
 
 if ISO8859_5
 ISO8859_5_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-5.bdf)
-ISO8859_5_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-5.pcf.gz)
+ISO8859_5_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-5.pcf$(COMPRESS_SUFFIX))
 endif
 
 if ISO8859_7
 ISO8859_7_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-7.bdf)
-ISO8859_7_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-7.pcf.gz)
+ISO8859_7_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-7.pcf$(COMPRESS_SUFFIX))
 endif
 
 if ISO8859_8
 ISO8859_8_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-8.bdf)
-ISO8859_8_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-8.pcf.gz)
+ISO8859_8_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-8.pcf$(COMPRESS_SUFFIX))
 endif
 
 if ISO8859_9
 ISO8859_9_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-9.bdf)
-ISO8859_9_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-9.pcf.gz)
+ISO8859_9_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-9.pcf$(COMPRESS_SUFFIX))
 endif
 
 if ISO8859_10
 ISO8859_10_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-10.bdf)
-ISO8859_10_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-10.pcf.gz)
+ISO8859_10_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-10.pcf$(COMPRESS_SUFFIX))
 endif
 
 if ISO8859_13
 ISO8859_13_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-13.bdf)
-ISO8859_13_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-13.pcf.gz)
+ISO8859_13_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-13.pcf$(COMPRESS_SUFFIX))
 endif
 
 if ISO8859_14
 ISO8859_14_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-14.bdf)
-ISO8859_14_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-14.pcf.gz)
+ISO8859_14_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-14.pcf$(COMPRESS_SUFFIX))
 endif
 
 if ISO8859_15
 ISO8859_15_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-15.bdf)
-ISO8859_15_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-15.pcf.gz)
+ISO8859_15_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-15.pcf$(COMPRESS_SUFFIX))
 endif
 
 if ISO8859_16
 ISO8859_16_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-16.bdf)
-ISO8859_16_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-16.pcf.gz)
+ISO8859_16_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-16.pcf$(COMPRESS_SUFFIX))
 endif
 
 if KOI8_R
 KOI8_R_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-KOI8-R.bdf)
-KOI8_R_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-KOI8-R.pcf.gz)
+KOI8_R_PCF_FILES = $(BDF2UCS_FONT_FILES:%=%-KOI8-R.pcf$(COMPRESS_SUFFIX))
 endif
 
 UTIL_DIR = @MAPFILES_PATH@
 
-SUFFIXES = .bdf .pcf.gz t.bdf \
+SUFFIXES = .bdf .pcf$(COMPRESS_SUFFIX) t.bdf \
 	-ISO8859-1.bdf \
 	-ISO8859-2.bdf \
 	-ISO8859-3.bdf \
@@ -149,9 +149,9 @@ SUFFIXES = .bdf .pcf.gz t.bdf \
 	-ISO8859-16.bdf \
 	-KOI8-R.bdf
 
-.bdf.pcf.gz:
+.bdf.pcf$(COMPRESS_SUFFIX):
 	@rm -f $@
-	$(BDFTOPCF) -t $< | gzip > $@
+	$(BDFTOPCF) -t $< | $(COMPRESS) > $@
 
 .bdft.bdf:
 	@rm -f $@
@@ -213,9 +213,9 @@ SUFFIXES = .bdf .pcf.gz t.bdf \
 	@rm -f $@
 	$(UCS2ANY) $< $(UTIL_DIR)/map-KOI8-R KOI8-R
 
-t.bdf.pcf.gz:
+t.bdf.pcf$(COMPRESS_SUFFIX):
 	@rm -f $@
-	$(BDFTOPCF) -t $< | gzip > $@
+	$(BDFTOPCF) -t $< | $(COMPRESS) > $@
 
 fontdir = @FONTDIR@
 font_DATA = \
diff --git a/configure.ac b/configure.ac
index b12adea..2f276b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,23 +31,11 @@ m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or late
 XORG_MACROS_VERSION(1.2)
 AC_PROG_INSTALL
 
-AC_PATH_PROG(BDFTOPCF, bdftopcf)
+XORG_FONT_BDF_UTILS
+XORG_FONT_REQUIRED_PROG(UCS2ANY, ucs2any)
 AC_PATH_PROG(BDFTRUNCATE, bdftruncate)
-AC_PATH_PROG(UCS2ANY, ucs2any)
-AC_PATH_PROG(MKFONTSCALE, mkfontscale)
-if test x"$MKFONTSCALE" = x; then
-	AC_MSG_ERROR([mkfontscale is required to build schumacher-misc fonts.])
-fi
-AC_PATH_PROG(MKFONTDIR, mkfontdir)
-if test x"$MKFONTDIR" = x; then
-	AC_MSG_ERROR([mkfontdir is required to build schumacher-misc fonts.])
-fi
 
-fontdir=${libdir}/X11/fonts/misc
-AC_ARG_WITH(fontdir, AC_HELP_STRING([--with-fontdir=<pathname>],
-	[Path to install fonts]), [fontdir="$withval"])
-FONTDIR="$fontdir"
-AC_SUBST(FONTDIR)
+XORG_FONTDIR(misc)
 
 PKG_CHECK_MODULES(MAPS, [fontutil])
 MAPFILES_PATH=`$PKG_CONFIG --variable=mapdir fontutil`
-- 
1.5.6.5



More information about the xorg-devel mailing list