#!/usr/bin/perl -w

# clean up BDF files created by psf2bdf.

$px = shift || die "$0: missing pixel size argument";


$pointsize = $px * 10;
$avgwidth = $px * 10; # square font!

$font = "-BW-Fauxtari Fixed Mono-Medium-R-Normal--$px-$pointsize-75-75-C-$avgwidth-iso10646-1";

while(<>) {
	chomp;
	if(/^STARTPROPERTIES\s+(\d+)/) {
		$oldprop = $1;
		$newprop = $oldprop + 15;
		print <<EOF;
STARTPROPERTIES $newprop
FOUNDRY "BW"
FAMILY_NAME "Fauxtari Fixed Mono"
FACE_NAME "Fauxtari $px"
WEIGHT_NAME "Medium"
SLANT "R"
SETWIDTH_NAME "Normal"
ADD_STYLE_NAME ""
PIXEL_SIZE $px
POINT_SIZE $pointsize
RESOLUTION_X 75
RESOLUTION_Y 75
SPACING "C"
AVERAGE_WIDTH $avgwidth
CHARSET_REGISTRY "iso10646"
CHARSET_ENCODING "1"
EOF
	} elsif(/^FONT\s/) {
		print "FONT $font\n";
	} else {
		print "$_\n";
	}
}
