#!@PYTHON@
-# mf-to-table.py -- convert spacing info in MF logs . and .tex
+# mf-to-table.py -- convert spacing info in MF logs .
#
# source file of the GNU LilyPond music typesetter
#
a.append (match.group (1))
return ''
- str = re.sub ('\(([a-zA-Z_0-9-]+\.mf)', include_func, str)
+ str = re.sub ('\\(([/a-z.A-Z_0-9-]+\\.mf)', include_func, str)
str = re.sub ('@{(.*?)@}', auto_func, str)
return (autolines, deps)
elif tags[0] == 'char':
name = tags[9]
- name = re.sub ('-', 'M', name)
if group:
name = group + '.' + name
m = {
-def write_tex_defs (file, global_info, charmetrics):
- nm = font_family
- for m in charmetrics:
-
- texname = re.sub ('[_.]', 'X', m['name'])
- def digit_to_letter (match):
- return chr (ord (match.group(1)) - ord ('0') + ord ('A'))
- texname = re.sub ('([0-9])', digit_to_letter, texname)
- file.write (r'''\gdef\%s%s{\char%d}%%%s''' % \
- (nm, texname, m['code'],'\n'))
- file.write ('\\endinput\n')
def write_character_lisp_table (file, global_info, charmetrics):
-l, --ly=FILE name output table
-o, --outdir=DIR prefix for dependency info
-p, --package=DIR specify package
- -t, --tex=FILE name output tex chardefs
""")
sys.exit (0)
'a:d:ho:p:t:',
['enc=', 'outdir=', 'dep=', 'lisp=',
'global-lisp=',
- 'tex=', 'debug', 'help', 'package='])
+ 'debug', 'help', 'package='])
global_lisp_nm = ''
char_lisp_nm = ''
enc_nm = ''
-texfile_nm = ''
depfile_nm = ''
lyfile_nm = ''
outdir_prefix = '.'
depfile_nm = a
elif o == '--outdir' or o == '-o':
outdir_prefix = a
- elif o == '--tex' or o == '-t':
- texfile_nm = a
elif o == '--lisp':
char_lisp_nm = a
elif o == '--global-lisp':
print o
raise getopt.error
-base = re.sub ('.tex$', '', texfile_nm)
+base = os.path.splitext (lyfile_nm)[0]
for filenm in files:
(g, m, deps) = parse_logfile (filenm)
- write_tex_defs (open (texfile_nm, 'w'), g, m)
enc_name = 'FetaEncoding'
if re.search ('parmesan', filenm):
enc_name = 'ParmesanEncoding'
write_deps (open (depfile_nm, 'wb'), deps,
[base + '.log', base + '.dvi', base + '.pfa',
depfile_nm,
- base + '.pfb', texfile_nm])
+ base + '.pfb'])