Commit 34fd48f4b89d44d4805e9878a4d249faf0e8235b

Darren Embry 2023-11-22T15:22:30

also make zero/ and zero. variants in Makefile

diff --git a/Makefile b/Makefile
index bff933e..84ccfee 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,23 @@
 .PHONY: FORCE
 
-SOURCES = sfd/IBM-Courier.sfd sfd/IBM-Courier-Italic.sfd sfd/IBM-Courier-Bold.sfd sfd/IBM-Courier-Bold-Italic.sfd
+SFD_SOURCES    := sfd/IBM-Courier.sfd sfd/IBM-Courier-Italic.sfd sfd/IBM-Courier-Bold.sfd sfd/IBM-Courier-Bold-Italic.sfd
+SFD_ZERO_SLASH := $(patsubst sfd/%.sfd,sfd/zero-slash/%-zero-slash.sfd,$(SFD_SOURCES))
+SFD_ZERO_DOT   := $(patsubst sfd/%.sfd,sfd/zero-dot/%-zero-dot.sfd,$(SFD_SOURCES))
+SFD            := $(SFD_SOURCES) $(SFD_ZERO_SLASH) $(SFD_ZERO_DOT)
 
-TTF     = $(patsubst sfd/%.sfd,fonts/%.ttf,$(SOURCES))
-WOFF    = $(patsubst sfd/%.sfd,fonts/%.woff,$(SOURCES))
-WOFF2   = $(patsubst sfd/%.sfd,fonts/%.woff2,$(SOURCES))
-SVG     = $(patsubst sfd/%.sfd,fonts/%.svg,$(SOURCES))
-OTF     = $(patsubst sfd/%.sfd,fonts/%.otf,$(SOURCES))
+TTF     := $(patsubst sfd/%.sfd,fonts/%.ttf,$(SFD))
+WOFF    := $(patsubst sfd/%.sfd,fonts/%.woff,$(SFD))
+WOFF2   := $(patsubst sfd/%.sfd,fonts/%.woff2,$(SFD))
+SVG     := $(patsubst sfd/%.sfd,fonts/%.svg,$(SFD))
+OTF     := $(patsubst sfd/%.sfd,fonts/%.otf,$(SFD))
 
 default: FORCE $(TTF) $(WOFF) $(WOFF2) $(SVG) $(OTF)
 
+sfd: $(SFD_ZERO_SLASH) $(SFD_ZERO_DOT)
+
+echo: FORCE
+	for file in $(TTF) $(WOFF) $(WOFF2) $(SVG) $(OTF) ; do echo $$file ; done
+
 fonts/%.ttf: sfd/%.sfd Makefile bin/convert.py
 	bin/convert.py "$<" "$@"
 fonts/%.woff: sfd/%.sfd Makefile bin/convert.py
@@ -21,5 +29,14 @@ fonts/%.svg: sfd/%.sfd Makefile bin/convert.py
 fonts/%.otf: sfd/%.sfd Makefile bin/convert.py
 	bin/convert.py "$<" "$@"
 
+sfd/zero-dot/%-zero-dot.sfd: sfd/%.sfd Makefile bin/zeroslash.py
+	mkdir -p $(<D)
+	bin/zeroslash.py --char zerodot "$<" "$@.tmp.sfd"
+	mv "$@.tmp.sfd" "$@"
+sfd/zero-slash/%-zero-slash.sfd: sfd/%.sfd Makefile bin/zeroslash.py
+	mkdir -p $(<D)
+	bin/zeroslash.py --char zeroslash "$<" "$@.tmp.sfd"
+	mv "$@.tmp.sfd" "$@"
+
 clean:
-	/bin/rm $(TTF) $(WOFF) $(WOFF2) $(SVG) $(OTF) >/dev/null 2>/dev/null || true
+	/bin/rm $(SFD_ZERO_SLASH) $(SFD_ZERO_DOT) $(TTF) $(WOFF) $(WOFF2) $(SVG) $(OTF) >/dev/null 2>/dev/null || true