]> git.tdb.fi Git - libs/gl.git/commitdiff
Sort the cap_height and x_height arrays in makefont.py
authorMikko Rasa <tdb@tdb.fi>
Wed, 25 Apr 2018 11:58:39 +0000 (14:58 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 25 Apr 2018 11:58:39 +0000 (14:58 +0300)
I'm pretty sure they were intended to be sorted given that the item at
the two-thirds position is selected.

scripts/makefont.py

index 1d7a4332906a55e02dc0df2f8009648b4ee6408b..d24732ee33ea0d5bd05fd2a417c254a182fa5506 100755 (executable)
@@ -40,8 +40,10 @@ def convert_def(fn):
                        result += "kerning %d %d %.3f;\n"%(l, r, float(d)/fh)
 
        if cap_height:
+               cap_height.sort()
                header += "cap_height %.3f;\n"%(float(cap_height[len(cap_height)*2/3])/fh)
        if x_height:
+               x_height.sort()
                header += "x_height %.3f;\n"%(float(x_height[len(x_height)*2/3])/fh)
 
        return header+result