#!/bin/bash -

DEFAULTFONT=uni.sbf.gz
FONTS=
ZNAKOW=
ASCII=
BOLD=
UNDERLINE=
for A in $ARG
do
	case "$A" in
	(256)		ZNAKOW=-256;;
	(512)		ZNAKOW=;;
	(ascii)		ASCII=-ascii;;
	(bold)		BOLD=-bold;;
	(underline)	UNDERLINE=-underline;;
	(*)		for e in "" .gz .bz2
			do
				if [ -e "${0%/*}/../../consolefonts/$A.sbf$e" ]
				then
					FONTS="$FONTS ${0%/*}/../../consolefonts/$A.sbf$e"
					break
				fi
			done
			;;
	esac
done
[ "$FONTS" = "" ] && FONTS="${0%/*}/../../consolefonts/$DEFAULTFONT"

"${0%/*}/../../../lib/konwert/aux/dynafont" \
	$ZNAKOW $ASCII $BOLD $UNDERLINE \
	<(
		for f in $FONTS
		do
			case $f in
			(*.gz)	gunzip -c $f;;
			(*.bz2)	bunzip2 -c <$f;;
			(*)	cat $f;;
			esac
		done
	)
