base = re.sub ('.tex$', '', texfile_nm)
for filenm in files:
- (g,m, deps) = parse_logfile (filenm)
+ (g, m, deps) = parse_logfile (filenm)
cs = tfm_checksum (re.sub ('.log$', '.tfm', filenm))
afm = open (afmfile_nm, 'w')
elif re.search ('feta-brace', filenm) :
enc_name = 'FetaBraceEncoding'
-
write_ps_encoding (enc_name, open (enc_nm, 'w'), g, m)
- write_deps (open (depfile_nm, 'wb'), deps, [base + '.dvi', base + '.pfa', base + '.pfb', texfile_nm, afmfile_nm])
- if lyfile_nm != '':
+ if depfile_nm:
+ write_deps (open (depfile_nm, 'wb'), deps,
+ [base + '.dvi', base + '.pfa', base + '.pfb',
+ texfile_nm, afmfile_nm])
+ if lyfile_nm:
write_fontlist(open (lyfile_nm, 'w'), g, m)
MFMODE = env['MFMODE']
#ugh
outdir = os.path.join (env['build'], reldir, env['out'])
-tfm = Builder (action = ('cd ' + outdir + ' && ' \
- + '(MFINPUTS=:' + str (Dir ('#/mf')) \
+tfm = Builder (action = ('(cd ' + outdir + ' && ' \
+ + 'MFINPUTS=.:' + str (Dir ('#/mf')) \
+ ' mf "\\mode:=%(MFMODE)s; nonstopmode; ' \
- + ' input $$(basename $SOURCE);"' \
- + ' | grep -v "@\\|>>")') % vars (),
+ + ' input $$(basename $SOURCE);" ' \
+ + ' | grep -v "@\|>>")') % vars (),
suffix = '.tfm',
src_suffix = '.mf')
+# How do do multiple targets?
+log = Builder (action = ('(cd ' + outdir + ' && ' \
+ + 'MFINPUTS=.:' + str (Dir ('#/mf')) \
+ + ' mf "\\mode:=%(MFMODE)s; nonstopmode; ' \
+ + ' input $$(basename $SOURCE);" ' \
+ + ' | grep -v "@\|>>")') % vars (),
+ suffix = '.log',
+ src_suffix = '.mf')
+
+# How do do multiple targets?
+enc = Builder (action = ('(cd ' + outdir + ' && ' \
+ + 'MFINPUTS=.:' + str (Dir ('#/mf')) \
+ + ' mf "\\mode:=%(MFMODE)s; nonstopmode; ' \
+ + ' input $$(basename $SOURCE);" ' \
+ + ' | grep -v "@\|>>")') % vars (),
+ suffix = '.enc',
+ src_suffix = '.mf')
+
+# How do do multiple targets?
+ly = Builder (action = ('(cd ' + outdir + ' && ' \
+ + 'MFINPUTS=.:' + str (Dir ('#/mf')) \
+ + ' mf "\\mode:=%(MFMODE)s; nonstopmode; ' \
+ + ' input $$(basename $SOURCE);" ' \
+ + ' | grep -v "@\|>>")') % vars (),
+ suffix = '.ly',
+ src_suffix = '.mf')
+
+# How do do multiple targets?
+tex = Builder (action = ('(cd ' + outdir + ' && ' \
+ + 'MFINPUTS=.:' + str (Dir ('#/mf')) \
+ + ' mf "\\mode:=%(MFMODE)s; nonstopmode; ' \
+ + ' input $$(basename $SOURCE);" ' \
+ + ' | grep -v "@\|>>")') % vars (),
+ suffix = '.tex',
+ src_suffix = '.mf')
+
afm = Builder (action = (sys.executable
+ ' buildscripts/mf-to-table.py ' \
+ ' --package=. --outdir=%(outdir)s '\
suffix = '.pfa',
src_suffix = '.mf')
-e = env.Copy (BUILDERS = {'Tfm' : tfm, 'Afm' : afm, 'Pfa' : pfa},
- MFINPUTS = '#/mf')
-
-mf_sources = ('feta16.mf',)
-sources = map (lambda x: os.path.splitext (x)[0], mf_sources)
-
-##t = map (e.Tfm, mf_sources)
-#a = map (e.Afm, map (lambda x: outdir + os.path.splitext (x)[0] + '.log',
-# mf_sources))
-#p = map (e.Pfa, mf_sources)
-out_sources = map (lambda x: os.path.join (outdir, x), sources)
+xpfa = Builder (action = ('mftrace -I%(outdir)s --pfa --simplify --keep-trying'\
+ + ' $$(basename $SOURCE .log) ' \
+ + ' && mv $$(basename $TARGET) $TARGET') % vars (),
+ suffix = '.pfa',
+ src_suffix = '.log')
-#t = e.Tfm (os.path.join (outdir, 'feta16.tfm'))
-#a = e.Afm (os.path.join (outdir, 'feta16.afm'))
-#p = e.Pfa (os.path.join (outdir, 'feta16.pfa'))
-#t = e.Tfm ('feta16.tfm'))
-#a = e.Afm ('feta16.afm'))
-#p = e.Pfa ('feta16.pfa'))
+e = env.Copy (BUILDERS = {'Tfm' : tfm,
+ 'Log' : log, 'Enc' : enc, 'Ly' : ly, 'Tex' : tex,
+ 'Afm' : afm, 'Pfa' : pfa},
+ MFINPUTS = '#/mf')
-t = e.Tfm (os.path.join (outdir, 'feta16'))
-a = e.Afm (os.path.join (outdir, 'feta16'))
-p = e.Pfa (os.path.join (outdir, 'feta16'))
+#mf_sources = ('feta16.mf',)
+sources = map (lambda x: os.path.splitext (x)[0], mf_sources)
-#t = map (e.Tfm, out_sources)
-#a = map (e.Afm, out_sources)
-#p = map (e.Pfa, out_sources)
+t = map (e.Tfm, sources)
+a = map (e.Afm, sources)
+p = map (e.Pfa, sources)
-e.Depends ('feta16.log', 'feta16.tfm')
-e.Depends ('feta16.afm', 'feta16.log')
+#ugh?
+w = map (e.Log, sources)
+x = map (e.Enc, sources)
+y = map (e.Ly, sources)
+z = map (e.Tex, sources)
-#map (lambda x: e.Depends (x + '.log', x + '.tfm'), out_sources)
-#map (lambda x: e.Depends (x + '.afm', x + '.log'), out_sources)
+#map (lambda x: e.Depends (x + '.log', x + '.mf'), sources)
+#map (lambda x: e.Depends (x + '.afm', x + '.log'), sources)
+#map (lambda x: e.Depends (x + '.pfa', x + '.log'), sources)
tfmdir = os.path.join (env['lilypondprefix'], 'fonts/tfm')
afmdir = os.path.join (env['lilypondprefix'], 'afm')
pfadir = os.path.join (env['lilypondprefix'], 'fonts/type1')
-env.Install (tfmdir, t)
-env.Install (afmdir, a)
-env.Install (pfadir, p)
+ti = env.Install (tfmdir, t)
+ai = env.Install (afmdir, a)
+pi = env.Install (pfadir, p)
env.Alias ('install', tfmdir)
env.Alias ('install', afmdir)
env.Alias ('install', pfadir)