Last change
on this file was 018c029, checked in by Thomas Lopatic <thomas@…>, 5 years ago |
Create web fonts.
|
-
Property mode
set to
100755
|
File size:
624 bytes
|
Rev | Line | |
---|
[018c029] | 1 | #!/usr/bin/python
|
---|
| 2 |
|
---|
| 3 | import fontforge
|
---|
| 4 |
|
---|
| 5 | font = fontforge.font()
|
---|
| 6 |
|
---|
| 7 | font.ascent = 2816
|
---|
| 8 | font.descent = 256
|
---|
| 9 | font.em = 3072
|
---|
| 10 | font.upos = -256
|
---|
| 11 |
|
---|
| 12 | font.copyright = ""
|
---|
| 13 |
|
---|
| 14 | font.fontname = "Buchla"
|
---|
| 15 | font.familyname = "Buchla"
|
---|
| 16 | font.fullname = ""
|
---|
| 17 |
|
---|
| 18 | for i in range(0, 256):
|
---|
| 19 | if i < 32:
|
---|
| 20 | code = 10240 + i
|
---|
| 21 | elif i < 127:
|
---|
| 22 | code = i
|
---|
| 23 | else:
|
---|
| 24 | code = (10240 + 32) + (i - 127);
|
---|
| 25 |
|
---|
| 26 | print("importing {:04x}".format(code))
|
---|
| 27 |
|
---|
| 28 | glyph = font.createChar(code)
|
---|
| 29 | glyph.width = 2048
|
---|
| 30 |
|
---|
| 31 | glyph.importOutlines("glyphs/{:04x}.svg".format(code))
|
---|
| 32 |
|
---|
| 33 | font.generate("buchla.woff")
|
---|
| 34 | font.generate("buchla.ttf")
|
---|
| 35 | font.generate("buchla.eot")
|
---|
Note:
See
TracBrowser
for help on using the repository browser.