X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=buildscripts%2Fmf-to-table.py;h=dc8e134a7db198f8da1af8d2c0321cc24d150a81;hb=5762e8bb079db16dd31166fa0c4b2a85464b0b8b;hp=4694125658f25f5a98703bfe889d13df45daeb4d;hpb=cc596a61733e168e993fe8e42c3e76666bc5d97e;p=lilypond.git diff --git a/buildscripts/mf-to-table.py b/buildscripts/mf-to-table.py index 4694125658..dc8e134a7d 100644 --- a/buildscripts/mf-to-table.py +++ b/buildscripts/mf-to-table.py @@ -69,10 +69,15 @@ def parse_logfile (fn): tags = string.split(l, '@:') if tags[0] == 'group': group = tags[1] + elif tags[0] == 'puorg': + group = '' elif tags[0] == 'char': + name = tags[9] + if group: + name = group + '-' + name m = { 'description': tags[1], - 'name': group + '-' + tags[9], + 'name': name, 'tex': tags[10], 'code': string.atoi (tags[2]), 'breapth':string.atof (tags[3]), @@ -91,10 +96,12 @@ def parse_logfile (fn): #urg if 0: #testing tags.append ('Regular') - tags[5] = re.sub (' ','-', tags[5]) + + + encoding = re.sub (' ','-', tags[5]) + tags = tags[:-1] name = tags[1:] global_info['DesignSize'] = string.atof (tags[4]) - print tags global_info['FontName'] = string.join (name,'-') global_info['FullName'] = string.join (name,' ') global_info['FamilyName'] = string.join (name[1:-1], @@ -107,7 +114,7 @@ def parse_logfile (fn): global_info['FontBBox'] = '0 0 1000 1000' global_info['Ascender'] = '0' global_info['Descender'] = '0' - global_info['EncodingScheme'] = tags[5] + global_info['EncodingScheme'] = encoding return (global_info, charmetrics, deps) @@ -164,7 +171,7 @@ def write_fontlist (file, global_info, charmetrics): file.write (r""" %% LilyPond file to list all font symbols and the corresponding names %% Automatically generated by mf-to-table.py -\score{ \lyrics \new Lyrics { \time %d/8 +\score{ \new Lyrics \lyrics { \time %d/8 """ % (2*per_line+1)) count = 0 @@ -181,7 +188,7 @@ def write_fontlist (file, global_info, charmetrics): ## prevent TeX from interpreting "--" as long dash: tex_string=re.sub('--','-{}-', tex_string) - file.write (' \\markup { \\raise #0.75 \\vcenter \\musicglyph #"%s" " %s" } 4 \n' % (scm_string, tex_string)) + file.write (' \\markup { \\raise #0.75 \\vcenter \\musicglyph #"%s" \\typewriter " %s" } 4 \n' % (scm_string, tex_string)) if (count % 3) ==0: file.write ('\skip 8 \\break\n') @@ -191,12 +198,12 @@ def write_fontlist (file, global_info, charmetrics): interscoreline = 1.0 indent = 0.0 \cm \context { - \LyricsContext + \Lyrics \override SeparationItem #'padding = #2 minimumVerticalExtent = ##f } \context { - \ScoreContext + \Score \remove "Bar_number_engraver" } } @@ -256,7 +263,7 @@ for opt in options: texfile_nm = a elif o == '--enc': enc_nm = a - elif o == '--ly' or o == '-': + elif o == '--ly' or o == '-l': lyfile_nm = a elif o== '--help' or o == '-h': help() @@ -273,7 +280,7 @@ for opt in options: 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') @@ -284,7 +291,7 @@ for filenm in files: del g['DesignSize'] write_afm_metric (afm, g, m) - + write_tex_defs (open (texfile_nm, 'w'), g, m) enc_name = 'FetaEncoding' if re.search ('parmesan', filenm) : @@ -292,12 +299,14 @@ for filenm in files: 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 != '': - write_fontlist(open (lyfile_nm, 'w'), g, m) + 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)