underover.py (3127B)
1 #!/usr/bin/env python3 2 3 from utils import mathfont 4 import fontforge 5 6 breveCodePoint = 0x2D8 # accent operator 7 degreeCodePoint = 0xB0 # nonaccent operator 8 accentBaseHeight = 4 * mathfont.em 9 10 v = 3 * mathfont.em 11 f = mathfont.create("underover-accentbaseheight%d-overbarextraascender%d" % (accentBaseHeight, v), 12 "Copyright (c) 2016 MathML Association") 13 mathfont.createSquareGlyph(f, breveCodePoint) 14 mathfont.createSquareGlyph(f, degreeCodePoint) 15 f.math.AccentBaseHeight = accentBaseHeight 16 f.math.LowerLimitBaselineDropMin = 0 17 f.math.LowerLimitGapMin = 0 18 f.math.OverbarExtraAscender = v 19 f.math.OverbarVerticalGap = 0 20 f.math.StretchStackBottomShiftDown = 0 21 f.math.StretchStackGapAboveMin = 0 22 f.math.StretchStackGapBelowMin = 0 23 f.math.StretchStackTopShiftUp = 0 24 f.math.UnderbarExtraDescender = 0 25 f.math.UnderbarVerticalGap = 0 26 f.math.UpperLimitBaselineRiseMin = 0 27 f.math.UpperLimitGapMin = 0 28 mathfont.save(f) 29 30 v = 11 * mathfont.em 31 f = mathfont.create("underover-accentbaseheight%d-overbarverticalgap%d" % (accentBaseHeight, v), 32 "Copyright (c) 2016 MathML Association") 33 mathfont.createSquareGlyph(f, breveCodePoint) 34 mathfont.createSquareGlyph(f, degreeCodePoint) 35 f.math.AccentBaseHeight = accentBaseHeight 36 f.math.LowerLimitBaselineDropMin = 0 37 f.math.LowerLimitGapMin = 0 38 f.math.OverbarExtraAscender = 0 39 f.math.OverbarVerticalGap = v 40 f.math.StretchStackBottomShiftDown = 0 41 f.math.StretchStackGapAboveMin = 0 42 f.math.StretchStackGapBelowMin = 0 43 f.math.StretchStackTopShiftUp = 0 44 f.math.UnderbarExtraDescender = 0 45 f.math.UnderbarVerticalGap = 0 46 f.math.UpperLimitBaselineRiseMin = 0 47 f.math.UpperLimitGapMin = 0 48 mathfont.save(f) 49 50 v = 5 * mathfont.em 51 f = mathfont.create("underover-accentbaseheight%d-underbarextradescender%d" % (accentBaseHeight, v), 52 "Copyright (c) 2016 MathML Association") 53 mathfont.createSquareGlyph(f, breveCodePoint) 54 mathfont.createSquareGlyph(f, degreeCodePoint) 55 f.math.AccentBaseHeight = accentBaseHeight 56 f.math.LowerLimitBaselineDropMin = 0 57 f.math.LowerLimitGapMin = 0 58 f.math.OverbarExtraAscender = 0 59 f.math.OverbarVerticalGap = 0 60 f.math.StretchStackBottomShiftDown = 0 61 f.math.StretchStackGapAboveMin = 0 62 f.math.StretchStackGapBelowMin = 0 63 f.math.StretchStackTopShiftUp = 0 64 f.math.UnderbarExtraDescender = v 65 f.math.UnderbarVerticalGap = 0 66 f.math.UpperLimitBaselineRiseMin = 0 67 f.math.UpperLimitGapMin = 0 68 mathfont.save(f) 69 70 v = 7 * mathfont.em 71 f = mathfont.create("underover-accentbaseheight%d-underbarverticalgap%d" % (accentBaseHeight, v), 72 "Copyright (c) 2016 MathML Association") 73 mathfont.createSquareGlyph(f, breveCodePoint) 74 mathfont.createSquareGlyph(f, degreeCodePoint) 75 f.math.AccentBaseHeight = accentBaseHeight 76 f.math.LowerLimitBaselineDropMin = 0 77 f.math.LowerLimitGapMin = 0 78 f.math.OverbarExtraAscender = 0 79 f.math.OverbarVerticalGap = 0 80 f.math.StretchStackBottomShiftDown = 0 81 f.math.StretchStackGapAboveMin = 0 82 f.math.StretchStackGapBelowMin = 0 83 f.math.StretchStackTopShiftUp = 0 84 f.math.UnderbarExtraDescender = 0 85 f.math.UnderbarVerticalGap = v 86 f.math.UpperLimitBaselineRiseMin = 0 87 f.math.UpperLimitGapMin = 0 88 mathfont.save(f)