bedstead/Makefile
Ben Harris b893d49beb Do not build bedstead.mjs as part of a release
I think it would be unwise to make the editor usable on Bedstead's Web
page.  This avoids the danger of Bedstead's Web page turning into a
regulated user-to-user service under the Online Safety Act 2023, with
all the paperwork that would entail.

Specifically, if there were an editor on Bedstead's Web page then
users could use it to create glyph designs.  That would, indeed, be
the whole point.  They might also send those designs to me for
incorporation into Bedstead.  But if I accepted any of those designs,
then "content generated directly on the service by a user" might "be
encountered by another user, or other users, of the service" (OSA
s3(1)), making the site a user-to-user service.

Ofcom take the position that being hosted on a .uk domain name is
enough to give a service "links to the UK", and none of the exemptions
cover Bedstead's Web page.  So if the page were a user-to-user
service, it would be a regulated one.

Being a regulated user-to-user service brings requirements for
risk-assessment, record-keeping, and terms of service.  These might be
reasonable for a service of any significant size, but it's not worth
the effort for something that I expect will get me a few glyphs at
most.  And there seem to be moves afoot to require age assurance on
all regulated user-to-user services, which would be particularly
annoying.

The OSA is arranged such that even if no new content can be created on
a service, the continuing presence of user-generated content on a
service causes it to be a user-to-user service.  So ever accepting a
glyph designed on the Web page would permanently make it into a
user-to-user service.  Thus it's important that I shouldn't do that.
2026-01-24 19:33:21 +00:00

141 lines
4.2 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
# CWARNFLAGS contains a set of GCC/Clang warning flags under which
# bedstead.c is clean. The "glyphs" array makes heavy use of the
# shortcuts disapproved by -Wmissing-field-initializers and
# -Wmissing-braces, so those are disabled.
CWARNFLAGS ?= -Wall -Wextra \
-Wno-missing-field-initializers -Wno-missing-braces
CFLAGS += $(CWARNFLAGS)
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 -P -q -dNOSAFER -dNODISPLAY -dBATCH -- $< $@
%.otf: %.ttx
ttx --no-recalc-timestamp -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 $< $@
EMCCFLAGS = -O2 -sEXIT_RUNTIME -sSTRICT \
-sINCOMING_MODULE_JS_API='["arguments","print"]'
EMCCFLAGS += $(CWARNFLAGS)
%.mjs: %.c
emcc $(EMCCFLAGS) -o $@ $<
.PHONY: clean
clean:
rm -f bedstead *.ttx *.otf *.bdf *.bdf.ps *.png *.pdf *.mjs *.wasm \
bedstead-complement.ps
.PHONY: install-user
install-user: $(OTFFILES)
install -d "$${HOME}"/.fonts
install -m 644 $(OTFFILES) "$${HOME}"/.fonts
VERSION != sed -n 's/^\#define VERSION "\(.*\)"/\1/p' < bedstead.c
.PHONY: dist
dist: $(DISTFILES)
rm -rf bedstead-$(VERSION)
mkdir bedstead-$(VERSION)
ln $(DISTFILES) bedstead-$(VERSION)
zip -r bedstead-$(VERSION).zip bedstead-$(VERSION)
rm -r bedstead-$(VERSION)
.DELETE_ON_ERROR: