From 873e6d273ec7f9712bbde0fba47e4c3447b3c958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andy=20Teijelo=20P=C3=A9rez?= Date: Thu, 15 Sep 2016 14:36:10 -0400 Subject: [PATCH] Don't generate SVGs that have no char defined --- Makefile | 12 ++++++------ createfont.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 2bb80f6..6aaff02 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ -PNGS = $(shell ./countchars.sh characters.png "pngs/%03.0f.png") -NARROWSVGS = $(shell ./countchars.sh characters.png "narrow-svgs/%03.0f.svg") -WIDESVGS = $(shell ./countchars.sh characters.png "wide-svgs/%03.0f.svg") +PNGS = $(shell ./countchars.sh characters.png "pngs/%.0f.png") +NARROWSVGS = $(shell ./msx2utf8.py -l | awk '{ print "narrow-svgs/" $$1 ".svg" }') +WIDESVGS = $(shell ./msx2utf8.py -l | awk '{ print "wide-svgs/" $$1 ".svg" }') SCREEN0_OUTPUTS = msx-screen0.sfd msx-screen0.woff msx-screen0.ttf SCREEN1_OUTPUTS = msx-screen1.sfd msx-screen1.woff msx-screen1.ttf @@ -11,7 +11,7 @@ pngs: mkdir -p pngs $(PNGS): characters.png | pngs - gm convert -crop 8x8 characters.png +adjoin pngs/%03d.png + gm convert -crop 8x8 characters.png +adjoin pngs/%d.png narrow-svgs: mkdir -p narrow-svgs @@ -35,7 +35,7 @@ $(SCREEN0_OUTPUTS): $(NARROWSVGS) unicode2msx.txt createfont.py --output-sfd msx-screen0.sfd \ --output-woff msx-screen0.woff \ --output-ttf msx-screen0.ttf \ - --familyname 'MSX' \ + --familyname 'MSX Screen 0' \ --fontname 'MSX-Screen0' \ --fullname 'MSX Screen 0' \ --width 768 \ @@ -46,7 +46,7 @@ $(SCREEN1_OUTPUTS): $(WIDESVGS) unicode2msx.txt createfont.py --output-sfd msx-screen1.sfd \ --output-woff msx-screen1.woff \ --output-ttf msx-screen1.ttf \ - --familyname 'MSX' \ + --familyname 'MSX Screen 1' \ --fontname 'MSX-Screen1' \ --fullname 'MSX Screen 1' \ --width 1024 \ diff --git a/createfont.py b/createfont.py index a7be055..6f0d1ec 100755 --- a/createfont.py +++ b/createfont.py @@ -33,7 +33,7 @@ for line in f: codepoint = int(codepoint) msxcode = int(msxcode) glyph = font.createChar(codepoint) - svgfile = "{:03d}.svg".format(msxcode) + svgfile = "{}.svg".format(msxcode) glyph.importOutlines(os.path.join(args.svgdir, svgfile)) glyph.width = args.width glyph.simplify()