stretchstacks.py (2524B)
1 #!/usr/bin/env python3 2 3 from utils import mathfont 4 import fontforge 5 6 arrowCodePoint = 0x2192 # horizontal stretch operator 7 8 v = 3 * mathfont.em 9 f = mathfont.create("stretchstack-bottomshiftdown%d" % v, 10 "Copyright (c) 2016 MathML Association") 11 mathfont.createSquareGlyph(f, arrowCodePoint) 12 f.math.LowerLimitBaselineDropMin = 0 13 f.math.LowerLimitGapMin = 0 14 f.math.OverbarExtraAscender = 0 15 f.math.OverbarVerticalGap = 0 16 f.math.StretchStackBottomShiftDown = v 17 f.math.StretchStackGapAboveMin = 0 18 f.math.StretchStackGapBelowMin = 0 19 f.math.StretchStackTopShiftUp = 0 20 f.math.UnderbarExtraDescender = 0 21 f.math.UnderbarVerticalGap = 0 22 f.math.UpperLimitBaselineRiseMin = 0 23 f.math.UpperLimitGapMin = 0 24 mathfont.save(f) 25 26 v = 11 * mathfont.em 27 f = mathfont.create("stretchstack-gapbelowmin%d" % v, 28 "Copyright (c) 2016 MathML Association") 29 mathfont.createSquareGlyph(f, arrowCodePoint) 30 f.math.LowerLimitBaselineDropMin = 0 31 f.math.LowerLimitGapMin = 0 32 f.math.OverbarExtraAscender = 0 33 f.math.OverbarVerticalGap = 0 34 f.math.StretchStackBottomShiftDown = 0 35 f.math.StretchStackGapAboveMin = 0 36 f.math.StretchStackGapBelowMin = v 37 f.math.StretchStackTopShiftUp = 0 38 f.math.UnderbarExtraDescender = 0 39 f.math.UnderbarVerticalGap = 0 40 f.math.UpperLimitBaselineRiseMin = 0 41 f.math.UpperLimitGapMin = 0 42 mathfont.save(f) 43 44 v = 5 * mathfont.em 45 f = mathfont.create("stretchstack-topshiftup%d" % v, 46 "Copyright (c) 2016 MathML Association") 47 mathfont.createSquareGlyph(f, arrowCodePoint) 48 f.math.LowerLimitBaselineDropMin = 0 49 f.math.LowerLimitGapMin = 0 50 f.math.OverbarExtraAscender = 0 51 f.math.OverbarVerticalGap = 0 52 f.math.StretchStackBottomShiftDown = 0 53 f.math.StretchStackGapAboveMin = 0 54 f.math.StretchStackGapBelowMin = 0 55 f.math.StretchStackTopShiftUp = v 56 f.math.UnderbarExtraDescender = 0 57 f.math.UnderbarVerticalGap = 0 58 f.math.UpperLimitBaselineRiseMin = 0 59 f.math.UpperLimitGapMin = 0 60 mathfont.save(f) 61 62 v = 7 * mathfont.em 63 f = mathfont.create("stretchstack-gapabovemin%d" % v, 64 "Copyright (c) 2016 MathML Association") 65 mathfont.createSquareGlyph(f, arrowCodePoint) 66 f.math.LowerLimitBaselineDropMin = 0 67 f.math.LowerLimitGapMin = 0 68 f.math.OverbarExtraAscender = 0 69 f.math.OverbarVerticalGap = 0 70 f.math.StretchStackBottomShiftDown = 0 71 f.math.StretchStackGapAboveMin = v 72 f.math.StretchStackGapBelowMin = 0 73 f.math.StretchStackTopShiftUp = 0 74 f.math.UnderbarExtraDescender = 0 75 f.math.UnderbarVerticalGap = 0 76 f.math.UpperLimitBaselineRiseMin = 0 77 f.math.UpperLimitGapMin = 0 78 mathfont.save(f)