From f54e7e8c2aeb4fafebf0d5bd5570b060462c9ecf Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Thu, 1 Feb 2018 08:31:01 +0200 Subject: Initial commit --- font/tools/mergebdf | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 font/tools/mergebdf (limited to 'font/tools/mergebdf') diff --git a/font/tools/mergebdf b/font/tools/mergebdf new file mode 100755 index 0000000..86c75f5 --- /dev/null +++ b/font/tools/mergebdf @@ -0,0 +1,29 @@ +#!/usr/bin/perl -w + +if ($#ARGV < 0) { + die "Usage: mergebdf font1.bdf ... > newfont.bdf\n"; +} + +foreach $font (@ARGV) { + open(F, "<$font") || die; + for (;;) { + while (defined($_ = ) && !/^STARTCHAR /) { + if (!$donehead) { print; } + } + if (!defined($_)) { last; } + $donehead = 1; + $c = $_; + undef $e; + while (($_ = ) !~ /^ENDCHAR/) { + if (/^ENCODING (\d+)$/) { $e = $1; } + $c .= $_; + } + $c .= $_; + if (!$char{$e}) { + $char{$e} = 1; + print $c; + } + } + close(F); +} +print "ENDFONT\n"; -- cgit v1.2.3-70-g09d2