#!/bin/sh

# Make a trial run of a font 'ourfont.bdf'

# First, make BDF source


ourfont="tmpfont"	# Name of the Unicode font we are working on
enc="KOI8-C"
tryfont="tmp"
sampleapp="wish ./tknotepad1 test_koi8c.txt"

[ -r $1 ] || {
	echo Cannot read font file $1. Exiting...
	exit 1;
}

ln -s $1 $ourfont.bdf

perl ucs2any.pl $ourfont.bdf $enc $enc

# Output is e.g. "tmpfont-KOI8-C.bdf"
# Now compile it. Use "compress" since it's more compatible than gzip.
mkdir -p $tryfont
bdftopcf $ourfont-$enc.bdf | compress > $tryfont/$ourfont.pcf.Z
cd $tryfont
mkfontdir
# Make a sensible alias. "fonts.dir" contains only one font name.
echo trialfont-koi8-c `tail -1 fonts.dir | cut -d' ' -f2` > fonts.alias
cd ..

# Refresh X server.

xset +fp `pwd`/$tryfont
xset fp rehash

# Start sample application

$sampleapp

#Clean up
xset -fp `pwd`/$tryfont
rm -rf `pwd`/$tryfont $ourfont.bdf $ourfont-$enc.bdf



