]> git.donarmstrong.com Git - lilypond.git/blob - buildscripts/gen-emmentaler-scripts.py
* scm/framework-ps.scm (dump-page): use output-units for landscape.
[lilypond.git] / buildscripts / gen-emmentaler-scripts.py
1 #!@PYTHON@
2 import sys
3 import getopt
4 import re 
5 import os
6 import string
7
8 (options, files) = \
9   getopt.getopt (sys.argv[1:],
10                  '',
11                  ['dir='])
12
13
14 outdir = ''
15 for opt in options:
16         o = opt[0]
17         a = opt[1]
18         if o == '--dir':
19                 outdir = a
20         else:
21                 print o
22                 raise getopt.error
23
24
25 for design_size in [11,13,14,16,18,20,23,26]:
26         name = 'Emmentaler' 
27         filename = name.lower ()
28         script = '''#!@FONTFORGE@
29
30 New();
31
32 # Separate Feta versioning?
33 #         *  using 20 as Weight works for gnome-font-select widget: gfs
34 SetFontNames("%(name)s-%(design_size)d", "%(name)s", "%(name)s %(design_size)d", "%(design_size)d", "GNU GPL", "@TOPLEVEL_VERSION@");
35
36 MergeFonts("feta%(design_size)d.pfa");
37 MergeFonts("parmesan%(design_size)d.pfa");
38
39 # load nummer/din after setting PUA.
40 i = 0;
41 while (i < CharCnt())
42   Select(i);
43 # crashes fontforge, use PUA for now -- jcn
44 # SetUnicodeValue(i + 0xF0000, 0);
45 /*
46 PRIVATE AREA
47        In the BMP, the range 0xe000 to 0xf8ff will never be  assigned  to  any
48        characters  by  the standard and is reserved for private usage. For the
49        Linux community, this private area has been subdivided further into the
50        range  0xe000  to 0xefff which can be used individually by any end-user
51        and the Linux zone in the range 0xf000 to 0xf8ff where  extensions  are
52        coordinated  among  all  Linux  users.  The  registry of the characters
53        assigned to the Linux zone is currently maintained by  H.  Peter  Anvin
54        <Peter.Anvin@linux.org>.
55 */
56   SetUnicodeValue(i + 0xE000, 0);
57   ++i;
58 endloop
59
60
61 MergeFonts("feta-alphabet%(design_size)d.pfa");
62 MergeKern("feta-alphabet%(design_size)d.tfm");
63
64 LoadTableFromFile("LILF", "%(name)s-%(design_size)d.subfonts")
65 LoadTableFromFile("LILC", "feta%(design_size)d.otf-table")
66 LoadTableFromFile("LILY", "feta%(design_size)d.otf-gtable")
67
68 Generate("%(filename)s-%(design_size)d.otf");
69 Generate("%(filename)s-%(design_size)d.cff");
70 Generate("%(filename)s-%(design_size)d.svg");
71 ''' % vars()
72
73         path = os.path.join (outdir, '%s-%d.pe' % (filename, design_size))
74         open (path, 'w').write (script)
75
76         subfonts = ['feta%(design_size)d',
77                     'parmesan%(design_size)d',
78                     'feta-alphabet%(design_size)d']
79
80         ns = []
81         for s in subfonts:
82                 ns.append ('%s' % (s % vars()))
83                 
84         subfonts_str = string.join (ns)
85         
86         open (os.path.join (outdir, '%(name)s-%(design_size)d.subfonts' % vars()), 'w').write (subfonts_str)
87
88         path = os.path.join (outdir, '%s-%d.dep' % (name, design_size))
89
90         deps = r'''%(name)s-%(design_size)d.otf: $(outdir)/feta%(design_size)d.pfa \
91   $(outdir)/parmesan%(design_size)d.pfa  \
92   $(outdir)/feta-alphabet%(design_size)d.pfa feta%(design_size)d.otf-table \
93   $(outdir)/feta-alphabet%(design_size)d.pfa feta%(design_size)d.otf-gtable
94 ''' % vars()
95         open (path, 'w').write (deps)