mirror of
https://bjh21.me.uk/bedstead/.git
synced 2026-07-10 05:53:05 -04:00
bedstead.c outputs an utterly minimal TTX file containing no tables, and TTX compiles it into a similarly minimal OTF. Which Ghostscript then complains about. FontForge is an impressive application, but it's not well-suited to being part of a mechanical font-production pipeline. The SFD format is weird and rather difficult to generate, and FontForge imposes rather more of its own opinions on the output than I'd like. TTX is a lower-level format, and while it's a little bit weird, most of it's weirdness comes from being a faithful representation of the structure of an OpenType font. Ideally I'd like something a little higher-level, but a format that's too low-level is much easier to work with than one that's too high-level. The obvious alternative is UFO, which is very popular but looks like being a pain to generate from plain C. Looking to the future, I like the idea of a variable version of Bedstead, and neither SFD nor UFO seems to support that very well. In UFO's case, it seems that the convention is to create UFOs at various points in the design space and then have a tool interpolate between them, which seems wrong when they're all procedurally generated from the same source. TTX will allow me to directly generate the variation tables, if I can understand how they work.
126 lines
3.8 KiB
Makefile
126 lines
3.8 KiB
Makefile
# SPDX-License-Identifier: CC0-1.0
|
|
|
|
FONTBASES = bedstead bedstead-extended bedstead-semicondensed \
|
|
bedstead-condensed bedstead-extracondensed \
|
|
bedstead-ultracondensed \
|
|
bedstead-bold bedstead-boldextended bedstead-boldsemicondensed \
|
|
bedstead-boldcondensed bedstead-boldextracondensed \
|
|
bedstead-boldultracondensed
|
|
|
|
TTXFILES = $(addsuffix .ttx, $(FONTBASES))
|
|
OTFFILES = $(addsuffix .otf, $(FONTBASES))
|
|
|
|
DISTFILES = bedstead.c Makefile CONTRIBUTING COPYING HACKING NEWS \
|
|
df.ps rom.ps Fontmap \
|
|
$(OTFFILES) \
|
|
bedstead-10.bdf bedstead-20.bdf bedstead-bold-20.bdf \
|
|
bedstead-10-df.png bedstead-20-df.png \
|
|
bedstead-complement.pdf
|
|
|
|
all: $(DISTFILES)
|
|
|
|
.PHONY: all-web
|
|
all-web: all sample.png extended.png icon-16.png icon-32.png icon-64.png
|
|
|
|
.PHONY: experimental
|
|
experimental: bedstead-chiseltip.otf bedstead-plotter-thin.otf \
|
|
bedstead-plotter-light.otf bedstead-plotter-medium.otf \
|
|
bedstead-plotter-bold.otf plotter.png
|
|
|
|
bedstead.ttx: bedstead
|
|
./bedstead > bedstead.ttx
|
|
|
|
bedstead-extended.ttx: bedstead
|
|
./bedstead --extended > bedstead-extended.ttx
|
|
|
|
bedstead-semicondensed.ttx: bedstead
|
|
./bedstead --semi-condensed > bedstead-semicondensed.ttx
|
|
|
|
bedstead-condensed.ttx: bedstead
|
|
./bedstead --condensed > bedstead-condensed.ttx
|
|
|
|
bedstead-extracondensed.ttx: bedstead
|
|
./bedstead --extra-condensed > bedstead-extracondensed.ttx
|
|
|
|
bedstead-ultracondensed.ttx: bedstead
|
|
./bedstead --ultra-condensed > bedstead-ultracondensed.ttx
|
|
|
|
bedstead-bold.ttx: bedstead
|
|
./bedstead --bold > bedstead-bold.ttx
|
|
|
|
bedstead-boldextended.ttx: bedstead
|
|
./bedstead --bold --extended > bedstead-boldextended.ttx
|
|
|
|
bedstead-boldsemicondensed.ttx: bedstead
|
|
./bedstead --bold --semi-condensed > bedstead-boldsemicondensed.ttx
|
|
|
|
bedstead-boldcondensed.ttx: bedstead
|
|
./bedstead --bold --condensed > bedstead-boldcondensed.ttx
|
|
|
|
bedstead-boldextracondensed.ttx: bedstead
|
|
./bedstead --bold --extra-condensed > bedstead-boldextracondensed.ttx
|
|
|
|
bedstead-boldultracondensed.ttx: bedstead
|
|
./bedstead --bold --ultra-condensed > bedstead-boldultracondensed.ttx
|
|
|
|
bedstead-oc.ttx: bedstead
|
|
./bedstead --plotter > bedstead-oc.ttx
|
|
|
|
bedstead-plotter-%.ttx: strokefont.py bedstead-oc.ttx
|
|
fontforge -lang=py -script strokefont.py plotter-$* bedstead-oc.ttx \
|
|
bedstead-plotter-$*.ttx
|
|
|
|
bedstead-chiseltip.ttx: strokefont.py bedstead-oc.ttx
|
|
fontforge -lang=py -script strokefont.py chiseltip bedstead-oc.ttx \
|
|
bedstead-chiseltip.ttx
|
|
|
|
bedstead-%.bdf.ps: bedstead
|
|
./bedstead --bdfgen $* > $@
|
|
|
|
bedstead-bold-%.bdf.ps: bedstead
|
|
./bedstead --bold --bdfgen $* > $@
|
|
|
|
# Dependency of all of OTFFILES could be narrowed to just the relevant
|
|
# one.
|
|
%.bdf: %.bdf.ps $(OTFFILES) Fontmap
|
|
gs -q -P -dSAFER -dNODISPLAY -dBATCH $< > $@
|
|
|
|
%.otf: %.ttx
|
|
ttx -o $@ $<
|
|
|
|
%.png: %.ps $(OTFFILES) Fontmap
|
|
gs -P -q -dSAFER -sDEVICE=png16m -dTextAlphaBits=4 -o $@ $<
|
|
|
|
icon-%.png: icon.ps bedstead-extended.otf Fontmap
|
|
gs -P -q -dSAFER -dsize=$* -sDEVICE=png16m -dTextAlphaBits=4 -o $@ $<
|
|
|
|
bedstead-%-df.png: df.ps bedstead.otf Fontmap
|
|
gs -P -q -dSAFER -dsize=$* -sDEVICE=png16m -o $@ $<
|
|
|
|
bedstead-complement.ps: bedstead
|
|
./bedstead --complement > bedstead-complement.ps
|
|
|
|
bedstead-complement.pdf: bedstead-complement.ps bedstead.otf Fontmap
|
|
ps2pdf -P $< $@
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -f bedstead *.ttx *.otf *.bdf *.bdf.ps *.png *.pdf \
|
|
bedstead-complement.ps
|
|
|
|
.PHONY: install-user
|
|
install-user: $(OTFFILES)
|
|
install -d "$${HOME}"/.fonts
|
|
install -m 644 $(OTFFILES) "$${HOME}"/.fonts
|
|
|
|
.PHONY: dist
|
|
|
|
dist: $(DISTFILES)
|
|
rm -rf bedstead-$$(sed -n 's/^Version: //p' < bedstead.sfd)
|
|
mkdir bedstead-$$(sed -n 's/^Version: //p' < bedstead.sfd)
|
|
ln $(DISTFILES) \
|
|
bedstead-$$(sed -n 's/^Version: //p' < bedstead.sfd)
|
|
zip -r bedstead-$$(sed -n 's/^Version: //p' < bedstead.sfd).zip \
|
|
bedstead-$$(sed -n 's/^Version: //p' < bedstead.sfd)
|
|
rm -r bedstead-$$(sed -n 's/^Version: //p' < bedstead.sfd)
|