]> git.donarmstrong.com Git - lilypond.git/commitdiff
new file
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 3 May 2005 14:25:10 +0000 (14:25 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 3 May 2005 14:25:10 +0000 (14:25 +0000)
ChangeLog
buildscripts/substitute-encoding.py [new file with mode: 0644]
mf/GNUmakefile

index f41df7b0d87eb5763136c895f4e8486a88615bfb..6918b19fc6450801b7bc384fe47ecf28ec44371f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2005-05-03  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * buildscripts/substitute-encoding.py: new file
+
        * Documentation/user/basic-notation.itely (Basic polyphony): fix
        missing @end 
 
diff --git a/buildscripts/substitute-encoding.py b/buildscripts/substitute-encoding.py
new file mode 100644 (file)
index 0000000..c2fbeda
--- /dev/null
@@ -0,0 +1,51 @@
+#!@PYTHON@
+#
+# mess up the coding table of PFAemmentaler to work around
+# GS bug,
+#
+# http://bugs.ghostscript.com/show_bug.cgi?id=688017
+
+import string
+import sys
+import re
+import os
+
+filename = sys.argv[1]
+def get_glyph_names (enc_name):
+       enc_str = open (enc_name).read ()
+       glyphs = []
+       def note_glyph (match):
+               nm = match.group (1)
+               glyphs.append (nm)
+
+
+       m = re.sub ("(/[a-z-.A-Z0-9]+) %", note_glyph, enc_str )
+
+       glyphs = filter (lambda x: None == re.match (r'/\.notdef', x),
+                        glyphs)
+       return glyphs
+
+if re.search ('mmental', filename):
+       glyph_names = (get_glyph_names ('out/feta20.enc') +
+                      get_glyph_names ('out/feta-alphabet20.enc') +
+                      get_glyph_names ('out/parmesan20.enc'))
+
+       str = open (filename).read ()
+       os.rename (filename, filename + "~")
+
+       glyph_names = glyph_names[:256]
+       
+       put_glyphs = ''
+       i = 0
+       for g in glyph_names:
+               put_glyphs += 'dup %d %s put \n' % (i,g)
+               i += 1
+               
+       str = re.sub ('( 0 1 255 { 1 index exch /.notdef put} for)',
+                     '\\1 \n %s'  % put_glyphs,
+                     str)
+
+       open (filename, 'w').write (str)
+
+
+
index 18825a86e69d3216b680ad621efaf58e42c66c1c..1066565cc3864ef9f02f0f77190e796113448108 100644 (file)
@@ -58,6 +58,7 @@ MFTRACE_FLAGS=$(if $(ENCODING_FILE),--encoding $(ENCODING_FILE),) --no-afm
 
 $(outdir)/$(PFA_PREFIX)%.pfa $(outdir)/%.otf $(outdir)/%.svg: $(outdir)/%.pe
        (cd $(outdir) && $(FONTFORGE) -script $(notdir $<))
+       $(PYTHON) $(buildscript-dir)/substitute-encoding.py $@
        -rm $(outdir)/*.scale.pfa
 
 # ugh, this does not work