Makefile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. PNGS = $(shell ./countchars.sh characters.png "pngs/%.0f.png")
  2. NARROWSVGS = $(shell ./msx2utf8.py -l | awk '{ print "narrow-svgs/" $$1 ".svg" }')
  3. WIDESVGS = $(shell ./msx2utf8.py -l | awk '{ print "wide-svgs/" $$1 ".svg" }')
  4. SCREEN0_OUTPUTS = MSX-Screen0.sfd MSX-Screen0.woff MSX-Screen0.ttf
  5. SCREEN1_OUTPUTS = MSX-Screen1.sfd MSX-Screen1.woff MSX-Screen1.ttf
  6. all: $(SCREEN0_OUTPUTS) $(SCREEN1_OUTPUTS)
  7. pngs:
  8. mkdir -p pngs
  9. $(PNGS): characters.png | pngs
  10. gm convert -crop 8x8 characters.png +adjoin pngs/%d.png
  11. narrow-svgs:
  12. mkdir -p narrow-svgs
  13. wide-svgs:
  14. mkdir -p wide-svgs
  15. $(NARROWSVGS): narrow-svgs/%.svg: pngs/%.png | narrow-svgs
  16. ./createsvg.sh "$<" "$@" 6 8
  17. $(WIDESVGS): wide-svgs/%.svg: pngs/%.png | wide-svgs
  18. ./createsvg.sh "$<" "$@" 8 8
  19. svgs: $(NARROWSVGS) $(WIDESVGS)
  20. unicode2msx.txt: msx2utf8.py
  21. ./msx2utf8.py -l | awk '{ print $$2" "$$1 }' > unicode2msx.txt
  22. $(SCREEN0_OUTPUTS): $(NARROWSVGS) unicode2msx.txt createfont.py
  23. ./createfont.py \
  24. --output-sfd MSX-Screen0.sfd \
  25. --output-woff MSX-Screen0.woff \
  26. --output-ttf MSX-Screen0.ttf \
  27. --familyname 'MSX Screen 0' \
  28. --fontname 'MSX-Screen0' \
  29. --fullname 'MSX Screen 0' \
  30. --width 768 \
  31. unicode2msx.txt narrow-svgs
  32. $(SCREEN1_OUTPUTS): $(WIDESVGS) unicode2msx.txt createfont.py
  33. ./createfont.py \
  34. --output-sfd MSX-Screen1.sfd \
  35. --output-woff MSX-Screen1.woff \
  36. --output-ttf MSX-Screen1.ttf \
  37. --familyname 'MSX Screen 1' \
  38. --fontname 'MSX-Screen1' \
  39. --fullname 'MSX Screen 1' \
  40. --width 1024 \
  41. unicode2msx.txt wide-svgs
  42. .PHONY: clean
  43. clean:
  44. rm -rf narrow-svgs wide-svgs pngs
  45. rm -f $(SCREEN0_OUTPUTS) $(SCREEN1_OUTPUTS)
  46. rm -f unicode2msx.txt