xHeight.py (326B)
1 #!/usr/bin/env python3 2 3 from utils import mathfont 4 import fontforge 5 6 v = mathfont.em / 2 7 f = mathfont.create("xheight%d" % v, 8 "Copyright (c) 2016 MathML Association") 9 g = f.createChar(ord('x')) 10 mathfont.drawRectangleGlyph(g, mathfont.em, v, 0) 11 assert f.xHeight == v, "Bad x-height value!" 12 mathfont.save(f)