foo
This commit is contained in:
@@ -27,6 +27,7 @@ if __name__ == '__main__':
|
|||||||
print("Name "+f.name)
|
print("Name "+f.name)
|
||||||
print("Ascender "+str(f.ascender))
|
print("Ascender "+str(f.ascender))
|
||||||
print("Descender "+str(f.descender))
|
print("Descender "+str(f.descender))
|
||||||
|
print("AdvanceWidthMax "+str(f.header.advance_width_max))
|
||||||
print("Units "+str(f.units_per_em))
|
print("Units "+str(f.units_per_em))
|
||||||
print("MacStyle "+str(f.tables[b'head'].mac_style))
|
print("MacStyle "+str(f.tables[b'head'].mac_style))
|
||||||
for c in chars:
|
for c in chars:
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ if __name__ == '__main__':
|
|||||||
pass
|
pass
|
||||||
chars = sorted(glyphs.keys())
|
chars = sorted(glyphs.keys())
|
||||||
|
|
||||||
|
print(f.name)
|
||||||
fontID = re.sub(r"[^0-9A-Za-z]", "_", f.name)
|
fontID = re.sub(r"[^0-9A-Za-z]", "_", f.name)
|
||||||
if fontID[0].isdigit():
|
if fontID[0].isdigit():
|
||||||
fontID = "_" + fontID
|
fontID = "_" + fontID
|
||||||
@@ -34,7 +35,7 @@ if __name__ == '__main__':
|
|||||||
%d, // descender
|
%d, // descender
|
||||||
%f, // units_per_em
|
%f, // units_per_em
|
||||||
[
|
[
|
||||||
""" % (fontID, f.font_family, f.tables[b'head'].mac_style, f.ascender, f.descender,
|
""" % (fontID, f.font_family, f.tables[b'head'].mac_style, f.tables[b'os2'].sTypoAscender, f.tables[b'os2'].sTypoDescender,
|
||||||
f.units_per_em))
|
f.units_per_em))
|
||||||
for c in chars:
|
for c in chars:
|
||||||
glyph = f.char_to_glyph(c)
|
glyph = f.char_to_glyph(c)
|
||||||
|
|||||||
3
go
Normal file
3
go
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
for x in mst/* ; do echo $x ; (python dumpscad.py $x >> ~/3d/mstfonts.scad ) ; done
|
||||||
|
python makelist.py ~/3d/mstfonts.scad > list.scad
|
||||||
|
cat list.scad >> ~/3d/mstfonts.scad
|
||||||
9
makelist.py
Normal file
9
makelist.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
from sys import argv
|
||||||
|
import re
|
||||||
|
|
||||||
|
fonts = []
|
||||||
|
with open(argv[1]) as f:
|
||||||
|
for line in f:
|
||||||
|
if line.startswith("FONT_"):
|
||||||
|
fonts.append(line.split()[0])
|
||||||
|
print("FONTS = [ " + ','.join(fonts) + " ];\n")
|
||||||
@@ -91,7 +91,10 @@ def fixed_version(num):
|
|||||||
:param num: fixed 16:16 floating point number as a 32-bit unsigned integer
|
:param num: fixed 16:16 floating point number as a 32-bit unsigned integer
|
||||||
:return: version number (float)
|
:return: version number (float)
|
||||||
"""
|
"""
|
||||||
return float("{:04x}.{:04x}".format(num >> 16, num & 0x0000ffff))
|
try:
|
||||||
|
return float("{:04x}.{:04x}".format(num >> 16, num & 0x0000ffff))
|
||||||
|
except:
|
||||||
|
return 1.0
|
||||||
|
|
||||||
|
|
||||||
def binary_search_parameters(length):
|
def binary_search_parameters(length):
|
||||||
|
|||||||
Reference in New Issue
Block a user