+ result += "x_height {:.3f};\n".format(float(x_height[len(x_height)*2//3])/fh)
+
+ for c, n in codes.items():
+ _, _, ox, oy, a = metrics[n]
+ x, y, w, h, b = glyphs[n]
+ result += "glyph {}\n{{\n".format(c)
+ result += "\ttexcoords {} {} {} {};\n".format(float(x)/tw, float(th-y-h)/th, float(x+w)/tw, float(th-y)/th)
+ result += "\tsize {:.3f} {:.3f};\n".format(float(w)/fh, float(h)/fh)
+ result += "\toffset {:.3f} {:.3f};\n".format(float(ox-b)/fh, float(oy-b)/fh)
+ result += "\tadvance {:.3f};\n".format(float(a)/fh)
+ result += "};\n"
+
+ for k in kerning:
+ l, r, d = k
+ result += "kerning {} {} {:.3f};\n".format(l, r, float(d)/fh)