From f6dc5e44d6bac45c3997461208eec4e246748d9d Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 15 May 2014 11:17:09 +0200 Subject: Generate a .pe script for one design size at a time. In make a b: c command is shorthand for a: c command b: c command this means that in parallel builds the same command may be invoked twice. Fix this by associating each command with only one target, and adding dummy dependencies. Also, generate the .pe for only one design size at a time. Relative to botched commit 366316fd6be846c2050be6b1b3955b261026187e, this: * does not write .dep files from gen-emmentaler-scripts (the makefile already writes them) * declares explicit dependencies on out/*.lisp for the out/%.otf-table rule. --- scripts/build/gen-emmentaler-scripts.py | 56 ++++++++++++++------------------- 1 file changed, 24 insertions(+), 32 deletions(-) (limited to 'scripts') diff --git a/scripts/build/gen-emmentaler-scripts.py b/scripts/build/gen-emmentaler-scripts.py index 9f645b5929..0bd4168230 100644 --- a/scripts/build/gen-emmentaler-scripts.py +++ b/scripts/build/gen-emmentaler-scripts.py @@ -6,25 +6,26 @@ import os (options, files) = \ getopt.getopt (sys.argv[1:], - '', - ['dir=']) - + '', + ['dir=', 'design-size=']) +design_size = 0 outdir = '' for opt in options: o = opt[0] a = opt[1] if o == '--dir': outdir = a + elif o == '--design-size': + design_size = int(a) else: print o raise getopt.error -# Ugh -for design_size in [11,13,14,16,18,20,23,26]: - name = 'Emmentaler' - filename = name.lower () - script = '''#!@FONTFORGE@ + +name = 'Emmentaler' +filename = name.lower () +script = '''#!@FONTFORGE@ New(); @@ -80,32 +81,23 @@ Generate("%(filename)s-%(design_size)d.svg"); Generate("%(filename)s-%(design_size)d.woff"); ''' % vars() - basename = '%s-%d' % (filename, design_size) - path = os.path.join (outdir, basename + '.pe') - open (path, 'w').write (script) - - subfonts = ['feta%(design_size)d', - 'feta-noteheads%(design_size)d', - 'feta-flags%(design_size)d', - 'parmesan%(design_size)d', - 'parmesan-noteheads%(design_size)d', - 'feta-alphabet%(design_size)d'] +basename = '%s-%d' % (filename, design_size) +path = os.path.join (outdir, basename + '.genpe') +open (path, 'w').write (script) - ns = [] - for s in subfonts: - ns.append ('%s' % (s % vars())) +subfonts = ['feta%(design_size)d', + 'feta-noteheads%(design_size)d', + 'feta-flags%(design_size)d', + 'parmesan%(design_size)d', + 'parmesan-noteheads%(design_size)d', + 'feta-alphabet%(design_size)d'] - subfonts_str = ' '.join (ns) +ns = [] +for s in subfonts: + ns.append ('%s' % (s % vars())) - open (os.path.join (outdir, '%(filename)s-%(design_size)d.subfonts' % vars()), 'w').write (subfonts_str) +subfonts_str = ' '.join (ns) - path = os.path.join (outdir, '%s-%d.dep' % (filename, design_size)) - - deps = r'''%(filename)s-%(design_size)d.otf: $(outdir)/feta%(design_size)d.pfb \ - $(outdir)/parmesan%(design_size)d.pfb \ - $(outdir)/feta-alphabet%(design_size)d.pfb feta%(design_size)d.otf-table \ - feta%(design_size)d.otf-gtable -''' % vars() - open (path, 'w').write (deps) +open (os.path.join (outdir, '%(filename)s-%(design_size)d.subfonts' % vars()), 'w').write (subfonts_str) - open (os.path.join (outdir, basename + '.fontname'), 'w').write ("%s-%d" % (name, design_size)) +open (os.path.join (outdir, basename + '.fontname'), 'w').write ("%s-%d" % (name, design_size)) -- cgit v1.2.3