9 # Luis' original scripts were invoked with "-lang=ff" on the command
10 # line. This was not supported by the version of FontForge in
11 # the current Debian stable release (Etch), so it was removed.
12 # However, the latest (as of July 2008) version of Debian (Sid)
13 # needed the language defined. Setting FONTFORGE_LANGUAGE gets
14 # around this conflict between the old and new FontForge command
15 # line options -- thanks to Anthony Fok for this solution.
17 export FONTFORGE_LANGUAGE = ff
20 # How to build unifont.ttf from GNU Unifont's unifont.hex
21 # -------------------------------------------------------
22 # Written by Luis Alejandro Gonzalez Miranda - http://www.lgm.cl/
26 # 2008 - Paul Hardy created this Makefile from Luis' original
27 # howto-build.sh and other bash scripts. Those original scripts
28 # don't appear in this archive, but they can be retrieved from
32 # First of all, you need a Perl interpreter and FontForge.
34 # I don't remember all the steps, but I think it was as described by
37 # This division is done only so the Simplify and RemoveOverlap
38 # operations don't use up too much memory, and because
39 # a .sfd generated from the whole unifont.hex would be too big to
40 # process all at once.
42 all: hex2sfd merge sfd2ttf
44 hex2sfd: unifont.hex $(BINDIR)/hex2sfd
45 echo "Separating unifont.hex into 16 parts"
46 for i in 0 1 2 3 4 5 6 7 8 9 A B C D E F ; \
48 grep ^$$i unifont.hex > $$i.hex ; \
49 $(BINDIR)/hex2sfd < $$i.hex > $$i.sfd ; \
51 for i in 0 1 2 3 4 5 6 7 8 9 A B C D E F ; \
53 $(FONTFORGE) -c 'Open($$1); SelectAll(); RemoveOverlap(); Simplify(-1,1); Save($$1);' $$i.sfd ; \
57 # We join all the generated .sfd files on a single one,
58 # and generate the final TrueType font
61 echo "Merging all .sfd files"
62 $(FONTFORGE) -script all.pe
65 echo "Converting .sfd font into .ttf font"
66 $(FONTFORGE) -c 'Open($$1); Generate($$2)' unifont.sfd unifont.ttf
70 # This fontforge script reads a BDF font file and generates an SBIT font file.
71 # Author: written by Qianqian Fang, given to Paul Hardy in 2008.
72 # Right now nothing calls this; it is just here for experimentation.
73 # The SBIT font is far smaller than the default outline TrueType font
74 # and takes far less time to build than the outline font. However, it
75 # isn't scalable. An SBIT font could be created and merged with the
76 # larger TTF font using fontforge, but I (Paul Hardy) haven't noticed
77 # any degradation in the screen rendering of just the outline TTF font
78 # that this Makefile produces as its final product. This is with
79 # daily use of this Makefile's default TrueType font. Note that there
80 # is no file in this directory called "unifont.bdf" -- copy a BDF font
81 # here from ../compiled and name it "unifont.bdf".
84 $(FONTFORGE) -c 'New(); Import($$1); Generate($$2, "ttf"); Close()' \
85 unifont.bdf unifont-sbit.ttf
96 \rm -f unifont-sbit.ttf
98 .PHONY: all hex2sfd merge sfd2ttf sbit clean distclean