]> git.donarmstrong.com Git - lilypond.git/blobdiff - buildscripts/mf-to-table.py
*** empty log message ***
[lilypond.git] / buildscripts / mf-to-table.py
index 36e00febae2f0bc5efb7c1d2f93d4d5dfe8d687f..f3b9c2e661fd6cee2810624bd91b17fc0bc7b5a0 100644 (file)
@@ -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,6 +96,10 @@ def parse_logfile (fn):
                        #urg
                        if 0: #testing
                                tags.append ('Regular')
+
+                       
+                       encoding = re.sub (' ','-', tags[5])
+                       tags = tags[:-1]
                        name = tags[1:]
                        global_info['DesignSize'] = string.atof (tags[4])
                        global_info['FontName'] = string.join (name,'-')
@@ -101,10 +110,11 @@ def parse_logfile (fn):
                                global_info['Weight'] = tags[4]
                        else: #testing
                                global_info['Weight'] = tags[-1]
+                               
                        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)
 
@@ -161,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
@@ -188,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"
        }
        }
@@ -253,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()
@@ -270,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')
 
@@ -281,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) :
@@ -289,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)