summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/mathml/tools/fractions.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
commit0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch)
treea31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /testing/web-platform/tests/mathml/tools/fractions.py
parentInitial commit. (diff)
downloadfirefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz
firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/mathml/tools/fractions.py')
-rwxr-xr-xtesting/web-platform/tests/mathml/tools/fractions.py163
1 files changed, 163 insertions, 0 deletions
diff --git a/testing/web-platform/tests/mathml/tools/fractions.py b/testing/web-platform/tests/mathml/tools/fractions.py
new file mode 100755
index 0000000000..bd39fc2fdb
--- /dev/null
+++ b/testing/web-platform/tests/mathml/tools/fractions.py
@@ -0,0 +1,163 @@
+#!/usr/bin/env python3
+
+from utils import mathfont
+import fontforge
+
+v1 = 7 * mathfont.em
+v2 = 1 * mathfont.em
+f = mathfont.create("fraction-axisheight%d-rulethickness%d" % (v1, v2),
+ "Copyright (c) 2016 MathML Association")
+f.math.AxisHeight = v1
+f.math.FractionDenominatorDisplayStyleGapMin = 0
+f.math.FractionDenominatorDisplayStyleShiftDown = 0
+f.math.FractionDenominatorGapMin = 0
+f.math.FractionDenominatorShiftDown = 0
+f.math.FractionNumeratorDisplayStyleGapMin = 0
+f.math.FractionNumeratorDisplayStyleShiftUp = 0
+f.math.FractionNumeratorGapMin = 0
+f.math.FractionNumeratorShiftUp = 0
+f.math.FractionRuleThickness = v2
+mathfont.save(f)
+
+v1 = 5 * mathfont.em
+v2 = 1 * mathfont.em
+f = mathfont.create("fraction-denominatordisplaystylegapmin%d-rulethickness%d" % (v1, v2),
+ "Copyright (c) 2016 MathML Association")
+f.math.AxisHeight = 0
+f.math.FractionDenominatorDisplayStyleGapMin = v1
+f.math.FractionDenominatorDisplayStyleShiftDown = 0
+f.math.FractionDenominatorGapMin = 0
+f.math.FractionDenominatorShiftDown = 0
+f.math.FractionNumeratorDisplayStyleGapMin = 0
+f.math.FractionNumeratorDisplayStyleShiftUp = 0
+f.math.FractionNumeratorGapMin = 0
+f.math.FractionNumeratorShiftUp = 0
+f.math.FractionRuleThickness = v2
+mathfont.save(f)
+
+v1 = 6 * mathfont.em
+v2 = 1 * mathfont.em
+f = mathfont.create("fraction-denominatordisplaystyleshiftdown%d-axisheight%d-rulethickness%d" % (v1, v2, v2),
+ "Copyright (c) 2016 MathML Association")
+f.math.AxisHeight = v2
+f.math.FractionDenominatorDisplayStyleGapMin = 0
+f.math.FractionDenominatorDisplayStyleShiftDown = v1
+f.math.FractionDenominatorGapMin = 0
+f.math.FractionDenominatorShiftDown = 0
+f.math.FractionNumeratorDisplayStyleGapMin = 0
+f.math.FractionNumeratorDisplayStyleShiftUp = 0
+f.math.FractionNumeratorGapMin = 0
+f.math.FractionNumeratorShiftUp = 0
+f.math.FractionRuleThickness = v2
+mathfont.save(f)
+
+v1 = 4 * mathfont.em
+v2 = 1 * mathfont.em
+f = mathfont.create("fraction-denominatorgapmin%d-rulethickness%d" % (v1, v2),
+ "Copyright (c) 2016 MathML Association")
+f.math.AxisHeight = 0
+f.math.FractionDenominatorDisplayStyleGapMin = 0
+f.math.FractionDenominatorDisplayStyleShiftDown = 0
+f.math.FractionDenominatorGapMin = v1
+f.math.FractionDenominatorShiftDown = 0
+f.math.FractionNumeratorDisplayStyleGapMin = 0
+f.math.FractionNumeratorDisplayStyleShiftUp = 0
+f.math.FractionNumeratorGapMin = 0
+f.math.FractionNumeratorShiftUp = 0
+f.math.FractionRuleThickness = v2
+mathfont.save(f)
+
+v1 = 3 * mathfont.em
+v2 = 1 * mathfont.em
+f = mathfont.create("fraction-denominatorshiftdown%d-axisheight%d-rulethickness%d" % (v1, v2, v2),
+ "Copyright (c) 2016 MathML Association")
+f.math.AxisHeight = v2
+f.math.FractionDenominatorDisplayStyleGapMin = 0
+f.math.FractionDenominatorDisplayStyleShiftDown = 0
+f.math.FractionDenominatorGapMin = 0
+f.math.FractionDenominatorShiftDown = v1
+f.math.FractionNumeratorDisplayStyleGapMin = 0
+f.math.FractionNumeratorDisplayStyleShiftUp = 0
+f.math.FractionNumeratorGapMin = 0
+f.math.FractionNumeratorShiftUp = 0
+f.math.FractionRuleThickness = v2
+mathfont.save(f)
+
+v1 = 8 * mathfont.em
+v2 = 1 * mathfont.em
+f = mathfont.create("fraction-numeratordisplaystylegapmin%d-rulethickness%d" % (v1, v2),
+ "Copyright (c) 2016 MathML Association")
+f.math.AxisHeight = 0
+f.math.FractionDenominatorDisplayStyleGapMin = 0
+f.math.FractionDenominatorDisplayStyleShiftDown = 0
+f.math.FractionDenominatorGapMin = 0
+f.math.FractionDenominatorShiftDown = 0
+f.math.FractionNumeratorDisplayStyleGapMin = v1
+f.math.FractionNumeratorDisplayStyleShiftUp = 0
+f.math.FractionNumeratorGapMin = 0
+f.math.FractionNumeratorShiftUp = 0
+f.math.FractionRuleThickness = v2
+mathfont.save(f)
+
+v1 = 2 * mathfont.em
+v2 = 1 * mathfont.em
+f = mathfont.create("fraction-numeratordisplaystyleshiftup%d-axisheight%d-rulethickness%d" % (v1, v2, v2),
+ "Copyright (c) 2016 MathML Association")
+f.math.AxisHeight = v2
+f.math.FractionDenominatorDisplayStyleGapMin = 0
+f.math.FractionDenominatorDisplayStyleShiftDown = 0
+f.math.FractionDenominatorGapMin = 0
+f.math.FractionDenominatorShiftDown = 0
+f.math.FractionNumeratorDisplayStyleGapMin = 0
+f.math.FractionNumeratorDisplayStyleShiftUp = v1
+f.math.FractionNumeratorGapMin = 0
+f.math.FractionNumeratorShiftUp = 0
+f.math.FractionRuleThickness = v2
+mathfont.save(f)
+
+v1 = 9 * mathfont.em
+v2 = 1 * mathfont.em
+f = mathfont.create("fraction-numeratorgapmin%d-rulethickness%d" % (v1, v2),
+ "Copyright (c) 2016 MathML Association")
+f.math.AxisHeight = 0
+f.math.FractionDenominatorDisplayStyleGapMin = 0
+f.math.FractionDenominatorDisplayStyleShiftDown = 0
+f.math.FractionDenominatorGapMin = 0
+f.math.FractionDenominatorShiftDown = 0
+f.math.FractionNumeratorDisplayStyleGapMin = 0
+f.math.FractionNumeratorDisplayStyleShiftUp = 0
+f.math.FractionNumeratorGapMin = v1
+f.math.FractionNumeratorShiftUp = 0
+f.math.FractionRuleThickness = v2
+mathfont.save(f)
+
+v1 = 11 * mathfont.em
+v2 = 1 * mathfont.em
+f = mathfont.create("fraction-numeratorshiftup%d-axisheight%d-rulethickness%d" % (v1, v2, v2),
+ "Copyright (c) 2016 MathML Association")
+f.math.AxisHeight = v2
+f.math.FractionDenominatorDisplayStyleGapMin = 0
+f.math.FractionDenominatorDisplayStyleShiftDown = 0
+f.math.FractionDenominatorGapMin = 0
+f.math.FractionDenominatorShiftDown = 0
+f.math.FractionNumeratorDisplayStyleGapMin = 0
+f.math.FractionNumeratorDisplayStyleShiftUp = 0
+f.math.FractionNumeratorGapMin = 0
+f.math.FractionNumeratorShiftUp = v1
+f.math.FractionRuleThickness = v2
+mathfont.save(f)
+
+v1 = 10 * mathfont.em
+f = mathfont.create("fraction-rulethickness%d" % v1,
+ "Copyright (c) 2016 MathML Association")
+f.math.AxisHeight = 0
+f.math.FractionDenominatorDisplayStyleGapMin = 0
+f.math.FractionDenominatorDisplayStyleShiftDown = 0
+f.math.FractionDenominatorGapMin = 0
+f.math.FractionDenominatorShiftDown = 0
+f.math.FractionNumeratorDisplayStyleGapMin = 0
+f.math.FractionNumeratorDisplayStyleShiftUp = 0
+f.math.FractionNumeratorGapMin = 0
+f.math.FractionNumeratorShiftUp = 0
+f.math.FractionRuleThickness = v1
+mathfont.save(f)