#
# Makefile for the creation of misc fonts
#
# make pcf  : creates the pcf set (fonts are created in the FDIR dir!)
# make pcfz : as above but also compresses fonts (XFree can do compressed fonts)
# make F737 : you should not need this unless you know whta you are doing
#	      creates the 737 fonts from ISO-8859-7 BDF files.
#	      This target creates 5 737 fonts (they are included so no need to
#	      run this).
#
# Make sure that you B2POPTS acoordingly for your machine (see below)
#
# For how to use the fonts with your X server see the README file
#
# (c) 1995 A. Haritsis <ah@doc.ic.ac.uk>
# DISTRIBUTE FREELY BUT KEEP THIS NOTICE INTACT. NO WARRANTIES.
#

# directory to put the created pcf files
TOPDIR=../inst
FDIR = $(TOPDIR)/misc

SHELL=/bin/sh
# --------------------- Compile bdf into pcf ---------------------------

BDF2PCF = bdftopcf


# CHANGE THIS TO REFLECT YOUR ARCHITECTURE. pcf files produced with the
# wrong values will STILL work but wil be slightly slower.
# byte order : -L (little endian) -M (big endian)
# bit order  : -l (LSBit first)   -m (MSBit first)
# You can use .bdf files directly with X servers. But pcf will be
# FASTER.
B2POPTS = -t -L -m	# Intel x86 (-m ?)

# the ones I chose as mostly useful; you can creat as many as you like
ALL737 = grfix-r-10.737.bdf grfix-r-13.737.bdf grfix-r-14.737.bdf \
	grfix-r-16.737.bdf grfix-r-23.737.bdf grvga-r-12.737.bdf

ALLBDF= grcour-b-12.bdf grcour-b-14.bdf grcour-o-12.bdf grcour-o-14.bdf \
	grcour-r-12.bdf grcour-r-14.bdf grcour-r-16.bdf gretl-r-14.bdf \
	gretl-r-16.bdf gretl-r-24.bdf grfix-b-16.bdf grfix-r-10.bdf \
	grfix-r-13.bdf grfix-r-13a.bdf grfix-r-14.bdf grfix-r-16.bdf \
	grfix-r-17.bdf grfix-r-19.bdf grfix-r-23.bdf grfix-r-25.bdf \
	grfix-r-26.bdf grhelv-b-08.bdf grhelv-b-10.bdf grhelv-b-12.bdf \
	grhelv-b-14.bdf grhelv-b-17.bdf grhelv-b-18.bdf grhelv-o-14.bdf \
	grhelv-r-14.bdf grvga-r-12.bdf \
	$(ALL737)

pcf:
	@echo "Building PCF fonts ..."
	@-mkdir -p $(FDIR)
	@for i in $(ALLBDF) ; do \
		( echo -n "$$i " && $(BDF2PCF) $(B2POPTS) $$i -o $(FDIR)/`basename $$i .bdf`.pcf ) \
	done 
	@echo
	@echo "Building font directory..."
	-cp xinst_fonts fonts.alias README* $(FDIR)/
	mkfontdir $(FDIR)
	@echo To make your X server use them just do: $(FDIR)/xinst_fonts

pcfz:
	@echo "Building PCF fonts ..."
	@-mkdir -p $(FDIR)
	@for i in $(ALLBDF) ; do \
		( echo -n "$$i " && $(BDF2PCF) $(B2POPTS) $$i -o $(FDIR)/`basename $$i .bdf`.pcf ) \
	done 
	@echo
	@echo "Compressing them..."
	@for i in $(FDIR)/*.pcf ; do \
		( compress -c < $$i > $$i.Z && rm -f $$i ) \
	done 
	-cp xinst_fonts fonts.alias README* $(FDIR)/
	mkfontdir $(FDIR)
	@echo To make your X server use them just do: $(FDIR)/xinst_fonts



# --------------------- 737 font creation -----------------------
BDFe2i = ../tools/bdfe2i

TO737 = grfix-r-10.bdf grfix-r-13.bdf grfix-r-14.bdf grfix-r-16.bdf  \
	grfix-r-23.bdf


F737:
	@echo "Building 737 fonts from ISO-8859-7 ones"
	@for i in $(TO737) ; do \
		( echo -n "$$i " && $(BDFe2i) $$i > `basename $$i .bdf`.737.bdf ) \
	done
	@echo
