8 COPYRIGHT = "Copyright (C) 2013 Roman Czyborra, Paul Hardy, et al. \
9 Licensed under the GNU General Public License; either version 2, or \
10 (at your option) a later version, with the GNU Font Embedding Exception."
12 VERSION = 6.3.20131215
15 # How to build unifont.ttf from GNU Unifont's unifont.hex
16 # -------------------------------------------------------
17 # Written by Luis Alejandro Gonzalez Miranda - http://www.lgm.cl/
21 # 2008 - Paul Hardy created this Makefile from Luis' original
22 # howto-build.sh and other bash scripts. Those original scripts
23 # don't appear in this archive, but they can be retrieved from
27 # First of all, you need a Perl interpreter and FontForge.
29 # I don't remember all the steps, but I think it was as described by
32 # This division is done only so the Simplify and RemoveOverlap
33 # operations don't use up too much memory, and because
34 # a .sfd generated from the whole unifont.hex would be too big to
35 # process all at once.
37 all: hex2sfd merge sfd2ttf sbit
39 hex2sfd: unifont.hex $(BINDIR)/hex2sfd
40 echo "Separating unifont.hex into 16 parts"
41 for i in 0 1 2 3 4 5 6 7 8 9 A B C D E F ; \
43 grep ^$$i unifont.hex > $$i.hex ; \
44 $(BINDIR)/hex2sfd < $$i.hex > $$i.sfd ; \
46 for i in 0 1 2 3 4 5 6 7 8 9 A B C D E F ; \
48 $(FONTFORGE) -lang=ff -c \
58 # We join all the generated .sfd files into a single one,
59 # and generate the final TrueType font.
62 echo "Merging all .sfd files"
63 $(FONTFORGE) -script all.pe
66 echo "Converting .sfd font into .ttf font"
67 $(FONTFORGE) -lang=ff -c \
69 SetFontNames("UnifontMedium", "GNU", "Unifont", "Medium", $(COPYRIGHT), "$(VERSION)"); \
70 Generate($$2)' unifont.sfd unifont.ttf
74 # This fontforge script reads a BDF font file and generates an SBIT font file.
75 # Author: written by Qianqian Fang, given to Paul Hardy in 2008.
76 # The SBIT font is far smaller than the default outline TrueType font
77 # and takes far less time to build than the outline font. However, it
78 # isn't scalable. An SBIT font could be created and merged with the
79 # larger TTF font using fontforge, but I (Paul Hardy) haven't noticed
80 # any degradation in the screen rendering of just the outline TTF font
81 # that this Makefile produces as its final product. This is with
82 # daily use of this Makefile's default TrueType font.
84 # This builds an SBIT font from the unifont_sample BDF font. The
85 # BDF font already contains font name, etc., so they don't need to
86 # be set using SetFontNames; those parameters are left null so the
87 # existing font's values will be preserved. However, Fontforge
88 # does not read the FONT_VERSION property so Paul Hardy added the
89 # the SetFontNames call.
92 $(FONTFORGE) -lang=ff -c \
94 SetFontNames("","","","","","$(VERSION)"); \
96 Generate($$2, "ttf"); \
98 unifont_sample.bdf unifont_sample.ttf
109 \rm -f unifont-sbit.ttf
111 .PHONY: all hex2sfd merge sfd2ttf sbit clean distclean