LEFT | RIGHT |
1 import fontforge | 1 import fontforge |
2 import getopt | 2 import getopt |
3 import os | 3 import os |
4 import psMat | 4 import psMat |
5 import re | 5 import re |
6 import sys | 6 import sys |
7 | 7 |
8 (options, files) = \ | 8 (options, files) = \ |
9 getopt.getopt (sys.argv[1:], | 9 getopt.getopt (sys.argv[1:], |
10 '', | 10 '', |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 scale = 1.0 | 31 scale = 1.0 |
32 subfonts = [] | 32 subfonts = [] |
33 for c in "abcdefghi" : | 33 for c in "abcdefghi" : |
34 subfont = "feta-braces-%s" %c | 34 subfont = "feta-braces-%s" %c |
35 subfonts.append(subfont) | 35 subfonts.append(subfont) |
36 f = fontforge.open(os.path.join(indir, subfont + ".pfb")) | 36 f = fontforge.open(os.path.join(indir, subfont + ".pfb")) |
37 f.selection.all() | 37 f.selection.all() |
38 f.transform(psMat.scale(scale)) | 38 f.transform(psMat.scale(scale)) |
39 | 39 |
40 font.mergeFonts(f) | 40 # mergeFonts takes a font, but this is a recent innovation of |
| 41 # b53e885e Aug 28, 2018 "Allow passing a font object to |
| 42 # mergeFonts()" |
| 43 tmp = "tmp.feta-brace-scaled.pfb" |
| 44 f.generate(tmp) |
| 45 font.mergeFonts(tmp) |
| 46 os.remove(tmp) |
41 scale += 1.0 | 47 scale += 1.0 |
42 | 48 |
43 font.fontname= "Emmentaler-Brace" | 49 font.fontname= "Emmentaler-Brace" |
44 font.familyname = "Emmentaler-Brace" | 50 font.familyname = "Emmentaler-Brace" |
45 font.weight = "Regular" | 51 font.weight = "Regular" |
46 font.copyright = "GNU GPL" | 52 font.copyright = "GNU GPL" |
47 font.version = version | 53 font.version = version |
48 | 54 |
49 # Set code points to PUA (Private Use Area) | 55 # Set code points to PUA (Private Use Area) |
50 i = 0 | 56 i = 0 |
(...skipping 10 matching lines...) Expand all Loading... |
61 | 67 |
62 font.setTableData("LILF", subfonts_str.encode("ascii")) | 68 font.setTableData("LILF", subfonts_str.encode("ascii")) |
63 font.setTableData("LILC", lisp) | 69 font.setTableData("LILC", lisp) |
64 font.setTableData("LILY", b'(design_size . 20)') | 70 font.setTableData("LILY", b'(design_size . 20)') |
65 | 71 |
66 font.generate(output) | 72 font.generate(output) |
67 base, ext = os.path.splitext(output) | 73 base, ext = os.path.splitext(output) |
68 | 74 |
69 font.generate(base + ".svg") | 75 font.generate(base + ".svg") |
70 font.generate(base + ".woff") | 76 font.generate(base + ".woff") |
LEFT | RIGHT |