#!/bin/sh
#
# HACK:
#  alias koi8 fonts with iso8859-1 registry XFLD
#
# Usage:
#    manually do 2 steps:
#
#  1. copy KOI2iso_pcf and this script to __DEST__;
#       where __DEST__ is koi8 fonts directory for
#	X-server or font-server on Your X11 system
#       NOTE: usually this directory contains subdirs 75dpi, 100dpi, 75koi8..
#  2. run this script
#
# 1996/09/05 - vsv
#

# there is no matter for order,
# fonts.alias will appended by new aliases in every catalogue
#

koi8fonts="75dpi 100dpi misc"
## koi8fonts="75dpi 100dpi" # exclude fixed fonts 
### koi8fonts="xcyr2" # for debug only

# make sure directory exist
### cd ./iso_hack || exit 1;

for font in $koi8fonts
do
	(
	# NOTE: probably, better use ./Makefile (there is no one)
	cd $font || exit 1

	# make sure file exist:
	touch fonts.alias || exit 1

	cp fonts.alias fonts.alias.new || exit 1

	# no comments in fonts.alias!!!
	###echo '# HACK: alias koi8 fonts to iso8859 XFLD registry' \
	###	>> fonts.alias.new || exit 1

	../KOI2iso_pcf < fonts.dir | \
		grep -e '-iso8859-' >> fonts.alias.new || exit 1
	##true;

	ln fonts.alias fonts.alias.b
	mv fonts.alias.new fonts.alias
	)
done

