7 Import ('env', 'base_glob', 'install')
8 feta = reduce (lambda x, y: x + y,
9 map (lambda x: base_glob (x),
11 'feta-alphabet*[0-9].mf',
12 'feta-braces-[a-z]*.mf',
13 'parmesan[0-9]*.mf',)))
14 feta = base_glob ('feta[0-9][0-9]*.mf')
15 feta_alphabet = base_glob ('feta-alphabet[0-9][0-9]*.mf')
16 feta_braces = base_glob ('feta-braces-[a-z].mf')
17 parmesan = base_glob ('parmesan[0-9][0-9]*.mf')
19 fonts = feta + feta_alphabet + feta_braces + parmesan
21 feta_sizes = map (lambda x: re.sub ('feta([0-9]+)', '\\1', x), feta)
22 otfs = map (lambda x: 'emmentaler-' + x, feta_sizes) + ['aybabtu']
24 t = map (env.TFM, fonts)
25 g = map (env.GTABLE, fonts)
26 p = map (env.PFA, fonts)
27 e = map (lambda x: x + '.enc', fonts)
28 s = map (lambda x: x + '.svg', fonts)
29 o = map (env.OTF, otfs)
32 a = '''cat ${SOURCE} \
33 $$(echo ${SOURCE} | grep -v brace | sed s/feta/parmesan/) \
34 $$(echo ${SOURCE} | grep -v brace | sed s/feta/feta-alphabet/) \
36 otf_table = Builder (action = a, suffix = '.otf-table',
39 env.Append (BUILDERS = {'OTF_TABLE': otf_table})
40 f = map (env.OTF_TABLE, feta)
41 g = map (env.OTF_TABLE, feta_braces)
43 map (lambda x: env.Depends ('feta' + x + '.otf-table',
44 ['parmesan' + x + '.lisp',
45 'feta-alphabet' + x + '.lisp']), feta_sizes)
47 map (lambda x: env.Depends ('emmentaler-' + x + '.otf',
48 'feta' + x + '.otf-table'),
51 map (lambda x: env.Depends ('emmentaler-' + x + '.otf',
53 'parmesan' + x + '.pfa',
54 'feta-alphabet' + x + '.pfa']), feta_sizes)
57 env.Command ('emmentaler-%(i)s.pe' % locals (),
58 '$srcdir/buildscripts/gen-emmentaler-scripts.py',
59 '$PYTHON $srcdir/buildscripts/gen-emmentaler-scripts.py --dir=${TARGET.dir}')
61 map (lambda x: env.Depends (x + '.pfa', x + '.enc'), feta)
66 feta_braces_pfa = map (lambda x: x + '.pfa', feta_braces)
68 env.AT_COPY ('aybabtu.pe.in')
69 env.Command ('aybabtu.fontname', '', 'echo -n aybabtu > $TARGET')
70 env.Command ('aybabtu.subfonts',
71 map (lambda x: x + '.mf', feta_braces),
72 'echo ${SOURCES.filebase} > $TARGET')
74 env.Command ('aybabtu.otf-table',
75 map (lambda x: x + '.otf-table', feta_braces),
76 'cd ${TARGET.dir} && cat ${SOURCES.file} > ${TARGET.file}')
78 env.Command ('aybabtu.otf-gtable',
79 map (lambda x: x + '.otf-gtable', feta_braces),
80 'echo "(design_size . 20)" > $TARGET')
82 env.Depends ('aybabtu.otf',
84 + ['aybabtu.subfonts',
87 'aybabtu.otf-gtable'])
89 ## FIXME: building only a few fonts does not seem to work anymore.
90 ## what is essential these days, aybabtu/emmentaler are needed always?
91 mf_essential = ['feta16', 'feta20', 'parmesan16', ]
92 pfa_essential = map (env.PFA, mf_essential) + ['emmentaler-20.otf']
93 env.Alias ('mf-essential', pfa_essential)
94 env.Alias ('mf-essential', 'fonts.cache-1')
96 env['fonts'] = string.join (fonts)
97 env['feta_sizes'] = string.join (feta_sizes)
99 env.Alias ('mf', pfa_essential + p + map (lambda x: x[0], o))
101 env.Alias ('mf', 'fonts.cache-1')
103 install (t, env['sharedir_package_version'] + '/fonts/tfm')
104 install (p, env['sharedir_package_version'] + '/fonts/type1')
105 install (o, env['sharedir_package_version'] + '/fonts/otf')
106 install (e, env['sharedir_package_version'] + '/ps')
107 install (s, env['sharedir_package_version'] + '/fonts/svg')