зеркало из https://github.com/mozilla/gecko-dev.git
Bug 961365 - Part 6: Add tests for OpenType MATH constants. r=jfkthame
This commit is contained in:
Родитель
08fc27fb9b
Коммит
2d11709d1c
|
@ -6,3 +6,11 @@
|
|||
[test_bug827713-2.html]
|
||||
[test_bug827713.html]
|
||||
[test_bug975681.html]
|
||||
[test_opentype-axis-height.html]
|
||||
[test_opentype-fraction.html]
|
||||
[test_opentype-limits.html]
|
||||
skip-if = os == "win" # Fails on WinXP
|
||||
[test_opentype-radical.html]
|
||||
skip-if = os == "win" # Fails on WinXP
|
||||
[test_opentype-scripts.html]
|
||||
[test_opentype-stack.html]
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Open Type MATH - axis-height</title>
|
||||
<script type="application/javascript"
|
||||
src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<meta charset="utf-8"/>
|
||||
<style type="text/css">
|
||||
math {
|
||||
font-size: 10px;
|
||||
}
|
||||
@font-face {
|
||||
font-family: axis-height-1;
|
||||
src: url(/tests/fonts/math/axis-height-1.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: axis-height-2;
|
||||
src: url(/tests/fonts/math/axis-height-2.otf);
|
||||
}
|
||||
</style>
|
||||
<script type="application/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var epsilon = 5;
|
||||
function almostEqual(x, y) { return Math.abs(x - y) < epsilon; }
|
||||
|
||||
function getBox(aId) {
|
||||
return document.getElementById(aId).getBoundingClientRect();
|
||||
}
|
||||
|
||||
function doTest() {
|
||||
ok(almostEqual(getBox("plus1").top - getBox("plus2").top, 10 * 20),
|
||||
"Bad AxisHeight");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="doTest()">
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=961365">
|
||||
Mozilla Bug 961365
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
|
||||
<p>
|
||||
<math style="font-family: axis-height-1;">
|
||||
<mo id="plus1">+</mo>
|
||||
</math>
|
||||
<math style="font-family: axis-height-2;">
|
||||
<mo id="plus2">+</mo>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,187 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Open Type MATH - fraction</title>
|
||||
<script type="application/javascript"
|
||||
src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<meta charset="utf-8"/>
|
||||
<style type="text/css">
|
||||
math {
|
||||
font-size: 10px;
|
||||
}
|
||||
@font-face {
|
||||
font-family: fraction-1;
|
||||
src: url(/tests/fonts/math/fraction-1.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: fraction-2;
|
||||
src: url(/tests/fonts/math/fraction-2.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: fraction-3;
|
||||
src: url(/tests/fonts/math/fraction-3.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: fraction-4;
|
||||
src: url(/tests/fonts/math/fraction-4.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: fraction-5;
|
||||
src: url(/tests/fonts/math/fraction-5.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: fraction-6;
|
||||
src: url(/tests/fonts/math/fraction-6.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: fraction-7;
|
||||
src: url(/tests/fonts/math/fraction-7.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: fraction-8;
|
||||
src: url(/tests/fonts/math/fraction-8.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: fraction-9;
|
||||
src: url(/tests/fonts/math/fraction-9.otf);
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var epsilon = 5;
|
||||
function almostEqual(x, y) { return Math.abs(x - y) < epsilon; }
|
||||
|
||||
function getBox(aId) {
|
||||
return document.getElementById(aId).getBoundingClientRect();
|
||||
}
|
||||
|
||||
function doTest() {
|
||||
/* inline style */
|
||||
var ref = getBox("ref").height;
|
||||
|
||||
ok(almostEqual(getBox("d1").top - getBox("n1").bottom, ref * 20),
|
||||
"Bad FractionRuleThickness");
|
||||
|
||||
ok(almostEqual(getBox("n1").top, getBox("n2").top) &&
|
||||
almostEqual(getBox("d2").top - getBox("n2").bottom, ref * 10.5),
|
||||
"Bad FractionNumeratorGapMin");
|
||||
|
||||
ok(almostEqual(getBox("d1").bottom, getBox("d3").bottom) &&
|
||||
almostEqual(getBox("d3").top - getBox("n3").bottom, ref * 10.5),
|
||||
"Bad FractionDenominatorGapMin");
|
||||
|
||||
ok(almostEqual(getBox("ref").top - getBox("n4").top, ref*3),
|
||||
"Bad FractionNumeratorShiftUp");
|
||||
|
||||
ok(almostEqual(getBox("d5").bottom - getBox("ref").bottom, ref*3),
|
||||
"Bad FractionDenominatorShiftDown");
|
||||
|
||||
/* display style */
|
||||
ref = getBox("dref").height;
|
||||
|
||||
ok(almostEqual(getBox("dd1").top - getBox("dn1").bottom, ref * 20),
|
||||
"Bad FractionRuleThickness");
|
||||
|
||||
ok(almostEqual(getBox("dn1").top, getBox("n6").top) &&
|
||||
almostEqual(getBox("d6").top - getBox("n6").bottom, ref * 10.5),
|
||||
"Bad FractionNumeratorDisplayStyleGapMin");
|
||||
|
||||
ok(almostEqual(getBox("dd1").bottom, getBox("d7").bottom) &&
|
||||
almostEqual(getBox("d7").top - getBox("n7").bottom, ref * 10.5),
|
||||
"Bad FractionDenominatorDisplayStyleGapMin");
|
||||
|
||||
ok(almostEqual(getBox("dref").top - getBox("n8").top, ref*3),
|
||||
"Bad FractionNumeratorDisplayStyleShiftUp");
|
||||
|
||||
ok(almostEqual(getBox("d9").bottom - getBox("dref").bottom, ref*3),
|
||||
"Bad FractionDenominatorDisplayStyleShiftDown");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="doTest()">
|
||||
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=961365">
|
||||
Mozilla Bug 961365
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
|
||||
<p>
|
||||
<math>
|
||||
<mspace id="ref" height="1em" width="1em" mathbackground="green"/>
|
||||
</math>
|
||||
<math style="font-family: fraction-1;">
|
||||
<mfrac>
|
||||
<mspace id="n1" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="d1" height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
<math style="font-family: fraction-2;">
|
||||
<mfrac>
|
||||
<mspace id="n2" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="d2" height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
<math style="font-family: fraction-3;">
|
||||
<mfrac>
|
||||
<mspace id="n3" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="d3" height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
<math style="font-family: fraction-4;">
|
||||
<mfrac>
|
||||
<mspace id="n4" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="d4" height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
<math style="font-family: fraction-5;">
|
||||
<mfrac>
|
||||
<mspace id="n5" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="d5" height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<math displaystyle="true">
|
||||
<mspace id="dref" height="1em" width="1em" mathbackground="green"/>
|
||||
</math>
|
||||
<math displaystyle="true" style="font-family: fraction-1;">
|
||||
<mfrac>
|
||||
<mspace id="dn1" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="dd1" height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
<math displaystyle="true" style="font-family: fraction-6;">
|
||||
<mfrac>
|
||||
<mspace id="n6" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="d6" height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
<math displaystyle="true" style="font-family: fraction-7;">
|
||||
<mfrac>
|
||||
<mspace id="n7" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="d7" height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
<math displaystyle="true" style="font-family: fraction-8;">
|
||||
<mfrac>
|
||||
<mspace id="n8" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="d8" height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
<math displaystyle="true" style="font-family: fraction-9;">
|
||||
<mfrac>
|
||||
<mspace id="n9" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="d9" height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,172 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Open Type MATH - limits</title>
|
||||
<script type="application/javascript"
|
||||
src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<meta charset="utf-8"/>
|
||||
<style type="text/css">
|
||||
math {
|
||||
font-size: 10px;
|
||||
}
|
||||
@font-face {
|
||||
font-family: limits-1;
|
||||
src: url(/tests/fonts/math/limits-1.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: limits-2;
|
||||
src: url(/tests/fonts/math/limits-2.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: limits-3;
|
||||
src: url(/tests/fonts/math/limits-3.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: limits-4;
|
||||
src: url(/tests/fonts/math/limits-4.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: limits-5;
|
||||
src: url(/tests/fonts/math/limits-5.otf);
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var epsilon = 5;
|
||||
function almostEqual(x, y) { return Math.abs(x - y) < epsilon; }
|
||||
|
||||
function getBox(aId) {
|
||||
return document.getElementById(aId).getBoundingClientRect();
|
||||
}
|
||||
|
||||
function doTest() {
|
||||
ok(almostEqual(getBox("base1").top - getBox("over1").bottom, 7 * 10) &&
|
||||
almostEqual(getBox("base2").top - getBox("over2").bottom, 7 * 10),
|
||||
"Bad UpperLimitGapMin");
|
||||
|
||||
ok(almostEqual(getBox("under3").top - getBox("base3").bottom, 5 * 10) &&
|
||||
almostEqual(getBox("under4").top - getBox("base4").bottom, 5 * 10),
|
||||
"Bad LowerLimitGapMin");
|
||||
|
||||
ok(almostEqual(getBox("ref3").top - getBox("over5").bottom, 9 * 10) &&
|
||||
almostEqual(getBox("ref3").top - getBox("over6").bottom, 9 * 10),
|
||||
"UpperLimitBaselineRiseMin");
|
||||
|
||||
ok(almostEqual(getBox("under7").top - getBox("ref4").bottom, 2 * 10) &&
|
||||
almostEqual(getBox("under8").top - getBox("ref4").bottom, 2 * 10),
|
||||
"LowerLimitBaselineDropMin");
|
||||
|
||||
ok(almostEqual(getBox("base9").top - getBox("over9").bottom,
|
||||
(6 - 2) * 10) &&
|
||||
almostEqual(getBox("base10").top - getBox("over10").bottom,
|
||||
(6 - 2) * 10),
|
||||
"Bad AccentBaseHeight");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="doTest()">
|
||||
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=961365">
|
||||
Mozilla Bug 961365
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
|
||||
<p>
|
||||
<math style="font-family: limits-1;" displaystyle="true">
|
||||
<mover>
|
||||
<mo id="base1">∑</mo>
|
||||
<mspace id="over1" height="1em" width="1em" mathbackground="red"/>
|
||||
</mover>
|
||||
</math>
|
||||
<math style="font-family: limits-1;" displaystyle="true">
|
||||
<munderover>
|
||||
<mo id="base2">∑</mo>
|
||||
<mspace id="under2" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="over2" height="1em" width="1em" mathbackground="red"/>
|
||||
</munderover>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<math style="font-family: limits-2;" displaystyle="true">
|
||||
<munder>
|
||||
<mo id="base3">∑</mo>
|
||||
<mspace id="under3" height="1em" width="1em" mathbackground="red"/>
|
||||
</munder>
|
||||
</math>
|
||||
<math style="font-family: limits-2;" displaystyle="true">
|
||||
<munderover>
|
||||
<mo id="base4">∑</mo>
|
||||
<mspace id="under4" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="over4" height="1em" width="1em" mathbackground="red"/>
|
||||
</munderover>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<math style="font-family: limits-3;" displaystyle="true">
|
||||
<mspace id="ref3" height="1em" width="1em" mathbackground="green"/>
|
||||
</math>
|
||||
<math style="font-family: limits-3;" displaystyle="true">
|
||||
<mover>
|
||||
<mo id="base5">∑</mo>
|
||||
<mspace id="over5" height="1em" width="1em" mathbackground="red"/>
|
||||
</mover>
|
||||
</math>
|
||||
<math style="font-family: limits-3;" displaystyle="true">
|
||||
<munderover>
|
||||
<mo id="base6">∑</mo>
|
||||
<mspace id="under6" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="over6" height="1em" width="1em" mathbackground="red"/>
|
||||
</munderover>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<math style="font-family: limits-4;" displaystyle="true">
|
||||
<mspace id="ref4" height="1em" width="1em" mathbackground="green"/>
|
||||
</math>
|
||||
<math style="font-family: limits-4;" displaystyle="true">
|
||||
<munder>
|
||||
<mo id="base7">∑</mo>
|
||||
<mspace id="under7" height="1em" width="1em" mathbackground="red"/>
|
||||
</munder>
|
||||
</math>
|
||||
<math style="font-family: limits-4;" displaystyle="true">
|
||||
<munderover>
|
||||
<mo id="base8">∑</mo>
|
||||
<mspace id="under8" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="over8" height="1em" width="1em" mathbackground="red"/>
|
||||
</munderover>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<math style="font-family: limits-5;" displaystyle="true">
|
||||
<mspace id="ref5" height="1em" width="1em" mathbackground="green"/>
|
||||
</math>
|
||||
<math style="font-family: limits-5;" displaystyle="true">
|
||||
<mover>
|
||||
<mspace id="base9" height="2em" width="2em" mathbackground="blue"/>
|
||||
<mo id="over9" stretchy="false">~</mo>
|
||||
</mover>
|
||||
</math>
|
||||
<math style="font-family: limits-5;" displaystyle="true">
|
||||
<munderover>
|
||||
<mspace id="base10" height="2em" width="2em" mathbackground="blue"/>
|
||||
<mspace id="under10" height="1em" width="1em" mathbackground="red"/>
|
||||
<mo id="over10" stretchy="false">~</mo>
|
||||
</munderover>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,196 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Open Type MATH - radical</title>
|
||||
<script type="application/javascript"
|
||||
src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<meta charset="utf-8"/>
|
||||
<style type="text/css">
|
||||
math {
|
||||
font-size: 10px;
|
||||
}
|
||||
@font-face {
|
||||
font-family: radical-1;
|
||||
src: url(/tests/fonts/math/radical-1.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: radical-2;
|
||||
src: url(/tests/fonts/math/radical-2.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: radical-3;
|
||||
src: url(/tests/fonts/math/radical-3.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: radical-4;
|
||||
src: url(/tests/fonts/math/radical-4.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: radical-5;
|
||||
src: url(/tests/fonts/math/radical-5.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: radical-6;
|
||||
src: url(/tests/fonts/math/radical-6.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: radical-7;
|
||||
src: url(/tests/fonts/math/radical-7.otf);
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var epsilon = 5;
|
||||
function almostEqual(x, y) { return Math.abs(x - y) < epsilon; }
|
||||
|
||||
function getBox(aId) {
|
||||
return document.getElementById(aId).getBoundingClientRect();
|
||||
}
|
||||
|
||||
function doTest() {
|
||||
ok(almostEqual(getBox("inner1").top -
|
||||
getBox("outer1").top, 5*10) &&
|
||||
almostEqual(getBox("inner2").top -
|
||||
getBox("outer2").top, 5*10) &&
|
||||
almostEqual(getBox("inner3").top -
|
||||
getBox("outer3").top, 5*10),
|
||||
"Bad RadicalRuleThickness");
|
||||
|
||||
ok(almostEqual(getBox("inner4").top -
|
||||
getBox("outer4").top, (7+1)*10) &&
|
||||
almostEqual(getBox("inner5").top -
|
||||
getBox("outer5").top, (7+1)*10) &&
|
||||
almostEqual(getBox("inner6").top -
|
||||
getBox("outer6").top, (7+1)*10),
|
||||
"Bad RadicalExtraAscender");
|
||||
|
||||
ok(almostEqual(getBox("inner7").top -
|
||||
getBox("outer7").top, (3+1)*10) &&
|
||||
almostEqual(getBox("inner7").top -
|
||||
getBox("outer8").top, (3+1)*10) &&
|
||||
almostEqual(getBox("inner8").top -
|
||||
getBox("outer9").top, (3+1)*10),
|
||||
"Bad RadicalVerticalGap");
|
||||
|
||||
ok(almostEqual(getBox("inner10").top -
|
||||
getBox("outer10").top, (9+1)*10) &&
|
||||
almostEqual(getBox("inner11").top -
|
||||
getBox("outer11").top, (9+1)*10) &&
|
||||
almostEqual(getBox("inner12").top -
|
||||
getBox("outer12").top, (9+1)*10),
|
||||
"Bad RadicalDisplayStyleVerticalGap");
|
||||
|
||||
ok(almostEqual(getBox("base5").bottom - getBox("index5").bottom,
|
||||
(getBox("base5").bottom - getBox("root5").top) * .25),
|
||||
"Bad RadicalDegreeBottomRaisePercent")
|
||||
|
||||
ok(almostEqual(getBox("index6").left - getBox("root6").left, 10 * 5),
|
||||
"Bad RadicalKernBeforeDegree")
|
||||
|
||||
ok(almostEqual(getBox("base7").left -
|
||||
getBox("index7").right, 10 * (7+1)),
|
||||
"Bad RadicalKernAfterDegree")
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="doTest()">
|
||||
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=961365">
|
||||
Mozilla Bug 961365
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
|
||||
<p>
|
||||
<math style="font-family: radical-1;">
|
||||
<msqrt id="outer1" mathbackground="green">
|
||||
<mspace id="inner1" width="1em" height="1em" mathbackground="red"/>
|
||||
</msqrt>
|
||||
<menclose id="outer2" notation="radical" mathbackground="green">
|
||||
<mspace id="inner2" width="1em" height="1em" mathbackground="red"/>
|
||||
</menclose>
|
||||
<mroot id="outer3" mathbackground="green">
|
||||
<mspace id="inner3" width="1em" height="1em" mathbackground="red"/>
|
||||
<mspace/>
|
||||
</mroot>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math style="font-family: radical-2;">
|
||||
<msqrt id="outer4" mathbackground="green">
|
||||
<mspace id="inner4" width="1em" height="1em" mathbackground="red"/>
|
||||
</msqrt>
|
||||
<menclose id="outer5" notation="radical" mathbackground="green">
|
||||
<mspace id="inner5" width="1em" height="1em" mathbackground="red"/>
|
||||
</menclose>
|
||||
<mroot id="outer6" mathbackground="green">
|
||||
<mspace id="inner6" width="1em" height="1em" mathbackground="red"/>
|
||||
<mspace/>
|
||||
</mroot>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math style="font-family: radical-3;">
|
||||
<msqrt id="outer7" mathbackground="green">
|
||||
<mspace id="inner7" width="1em" height="1em" mathbackground="red"/>
|
||||
</msqrt>
|
||||
<menclose id="outer8" notation="radical" mathbackground="green">
|
||||
<mspace id="inner8" width="1em" height="1em" mathbackground="red"/>
|
||||
</menclose>
|
||||
<mroot id="outer9" mathbackground="green">
|
||||
<mspace id="inner9" width="1em" height="1em" mathbackground="red"/>
|
||||
<mspace/>
|
||||
</mroot>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math style="font-family: radical-4;" displaystyle="true">
|
||||
<msqrt id="outer10" mathbackground="green">
|
||||
<mspace id="inner10" width="1em" height="1em" mathbackground="red"/>
|
||||
</msqrt>
|
||||
<menclose id="outer11" notation="radical" mathbackground="green">
|
||||
<mspace id="inner11" width="1em" height="1em" mathbackground="red"/>
|
||||
</menclose>
|
||||
<mroot id="outer12" mathbackground="green">
|
||||
<mspace id="inner12" width="1em" height="1em" mathbackground="red"/>
|
||||
<mspace/>
|
||||
</mroot>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<math style="font-family: radical-5;">
|
||||
<mroot id="root5" mathbackground="green">
|
||||
<mspace id="base5" width="1em" height="10em" mathbackground="red"/>
|
||||
<mspace id="index5" width="1em" height="1em" mathbackground="blue"/>
|
||||
</mroot>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<math style="font-family: radical-6;">
|
||||
<mroot id="root6" mathbackground="green">
|
||||
<mspace id="base6" width="1em" height="10em" mathbackground="red"/>
|
||||
<mspace id="index6" width="1em" height="1em" mathbackground="blue"/>
|
||||
</mroot>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<math style="font-family: radical-7;">
|
||||
<mroot id="root7" mathbackground="green">
|
||||
<mspace id="base7" width="1em" height="10em" mathbackground="red"/>
|
||||
<mspace id="index7" width="1em" height="1em" mathbackground="blue"/>
|
||||
</mroot>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,268 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Open Type MATH - scripts</title>
|
||||
<script type="application/javascript"
|
||||
src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<meta charset="utf-8"/>
|
||||
<style type="text/css">
|
||||
math {
|
||||
font-size: 10px;
|
||||
}
|
||||
@font-face {
|
||||
font-family: scripts-1;
|
||||
src: url(/tests/fonts/math/scripts-1.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: scripts-2;
|
||||
src: url(/tests/fonts/math/scripts-2.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: scripts-3;
|
||||
src: url(/tests/fonts/math/scripts-3.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: scripts-4;
|
||||
src: url(/tests/fonts/math/scripts-4.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: scripts-5;
|
||||
src: url(/tests/fonts/math/scripts-5.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: scripts-6;
|
||||
src: url(/tests/fonts/math/scripts-6.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: scripts-7;
|
||||
src: url(/tests/fonts/math/scripts-7.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: scripts-8;
|
||||
src: url(/tests/fonts/math/scripts-8.otf);
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function doTest() {
|
||||
var epsilon = 5;
|
||||
function almostEqual(x, y) { return Math.abs(x - y) < epsilon; }
|
||||
|
||||
function getBox(aId) {
|
||||
return document.getElementById(aId).getBoundingClientRect();
|
||||
}
|
||||
|
||||
ok(almostEqual(getBox("ref1").left - getBox("sub1").right, 3*10) &&
|
||||
almostEqual(getBox("ref2").left - getBox("sup2").right, 3*10) &&
|
||||
almostEqual(getBox("sup32").left - getBox("sup31").right, 3*10) &&
|
||||
almostEqual(getBox("ref3").left - getBox("sup32").right, 3*10),
|
||||
"SpaceAfterScript");
|
||||
|
||||
ok(almostEqual(getBox("ref4").bottom -
|
||||
getBox("sup41").bottom, 7 * 10) &&
|
||||
almostEqual(getBox("ref4").bottom -
|
||||
getBox("sup42").bottom, 7 * 10) &&
|
||||
almostEqual(getBox("ref4").bottom -
|
||||
getBox("sup43").bottom, 7 * 10) &&
|
||||
almostEqual(getBox("ref4").bottom -
|
||||
getBox("sup44").bottom, 7 * 10),
|
||||
"Bad SuperscriptShiftUp")
|
||||
ok(almostEqual(getBox("ref5").bottom -
|
||||
getBox("sup51").bottom, 5 * 10) &&
|
||||
almostEqual(getBox("ref5").bottom -
|
||||
getBox("sup52").bottom, 5 * 10) &&
|
||||
almostEqual(getBox("ref5").bottom -
|
||||
getBox("sup53").bottom, 5 * 10) &&
|
||||
almostEqual(getBox("ref5").bottom -
|
||||
getBox("sup54").bottom, 5 * 10),
|
||||
"Bad SuperscriptShiftUpCramped")
|
||||
|
||||
ok(almostEqual(getBox("ref6").bottom -
|
||||
getBox("sub61").bottom, -6 * 10) &&
|
||||
almostEqual(getBox("ref6").bottom -
|
||||
getBox("sub62").bottom, -6 * 10) &&
|
||||
almostEqual(getBox("ref6").bottom -
|
||||
getBox("sub63").bottom, -6 * 10) &&
|
||||
almostEqual(getBox("ref6").bottom -
|
||||
getBox("sub64").bottom, -6 * 10),
|
||||
"Bad SubscriptShiftDown")
|
||||
|
||||
ok(almostEqual(getBox("sub7").top -
|
||||
getBox("sup7").bottom, 11 * 10),
|
||||
"Bad SubSuperscriptGapMin");
|
||||
|
||||
ok(almostEqual(getBox("sub8").top -
|
||||
getBox("sup8").bottom, 11 * 10) &&
|
||||
almostEqual(getBox("ref8").bottom -
|
||||
getBox("sup8").bottom, 3 * 10),
|
||||
"Bad SuperscriptBottomMaxWithSubscript");
|
||||
|
||||
ok(almostEqual(getBox("ref9").top, getBox("sub9").top),
|
||||
"Bad SubscriptTopMax");
|
||||
|
||||
ok(almostEqual(getBox("ref10").bottom - getBox("sup10").bottom, 9 * 10),
|
||||
"Bad SuperscriptBottomMin");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="doTest()">
|
||||
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=961365">
|
||||
Mozilla Bug 961365
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
|
||||
<p>
|
||||
<math style="font-family: scripts-1;">
|
||||
<msub>
|
||||
<mspace height="2em" width="2em" mathbackground="blue"/>
|
||||
<mspace id="sub1" height="1em" width="1em" mathbackground="red"/>
|
||||
</msub>
|
||||
<mspace id="ref1" height="1em" width="1em" mathbackground="green"/>
|
||||
</math>
|
||||
<math style="font-family: scripts-1;">
|
||||
<msup>
|
||||
<mspace height="2em" width="2em" mathbackground="blue"/>
|
||||
<mspace id="sup2" height="1em" width="1em" mathbackground="red"/>
|
||||
</msup>
|
||||
<mspace id="ref2" height="1em" width="1em" mathbackground="green"/>
|
||||
</math>
|
||||
<math style="font-family: scripts-1;">
|
||||
<mmultiscripts>
|
||||
<mspace height="2em" width="2em" mathbackground="blue"/>
|
||||
<none/>
|
||||
<mspace id="sup31" height="1em" width="1em" mathbackground="red"/>
|
||||
<none/>
|
||||
<mspace id="sup32" height="1em" width="1em" mathbackground="red"/>
|
||||
</mmultiscripts>
|
||||
<mspace id="ref3" height="1em" width="1em" mathbackground="green"/>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<math style="font-family: scripts-2;">
|
||||
<mspace id="ref4" height="1em" width="1em" mathbackground="green"/>
|
||||
<msup>
|
||||
<mspace height="2em" width="2em" mathbackground="blue"/>
|
||||
<mspace id="sup41" height="1em" width="1em" mathbackground="red"/>
|
||||
</msup>
|
||||
<msubsup>
|
||||
<mspace height="2em" width="2em" mathbackground="blue"/>
|
||||
<mspace height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="sup42" height="1em" width="1em" mathbackground="red"/>
|
||||
</msubsup>
|
||||
<mmultiscripts>
|
||||
<mspace height="2em" width="2em" mathbackground="blue"/>
|
||||
<none/>
|
||||
<mspace id="sup43" height="1em" width="1em" mathbackground="red"/>
|
||||
<none/>
|
||||
<mspace id="sup44" height="1em" width="1em" mathbackground="red"/>
|
||||
</mmultiscripts>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<math style="font-family: scripts-3;">
|
||||
<msqrt>
|
||||
<mspace id="ref5" height="1em" width="1em" mathbackground="green"/>
|
||||
<msup>
|
||||
<mspace height="2em" width="2em" mathbackground="blue"/>
|
||||
<mspace id="sup51" height="1em" width="1em" mathbackground="red"/>
|
||||
</msup>
|
||||
<msubsup>
|
||||
<mspace height="2em" width="2em" mathbackground="blue"/>
|
||||
<mspace height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="sup52" height="1em" width="1em" mathbackground="red"/>
|
||||
</msubsup>
|
||||
<mmultiscripts>
|
||||
<mspace height="2em" width="2em" mathbackground="blue"/>
|
||||
<mspace height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="sup53" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="sup54" height="1em" width="1em" mathbackground="red"/>
|
||||
</mmultiscripts>
|
||||
</msqrt>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<math style="font-family: scripts-4;">
|
||||
<mspace id="ref6" height="1em" width="1em" mathbackground="green"/>
|
||||
<msub>
|
||||
<mspace height="2em" width="2em" mathbackground="blue"/>
|
||||
<mspace id="sub61" height="1em" width="1em" mathbackground="red"/>
|
||||
</msub>
|
||||
<msubsup>
|
||||
<mspace height="2em" width="2em" mathbackground="blue"/>
|
||||
<mspace id="sub62" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace height="1em" width="1em" mathbackground="red"/>
|
||||
</msubsup>
|
||||
<mmultiscripts>
|
||||
<mspace height="2em" width="2em" mathbackground="blue"/>
|
||||
<mspace id="sub63" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="sub64" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace height="1em" width="1em" mathbackground="red"/>
|
||||
</mmultiscripts>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<math style="font-family: scripts-5;">
|
||||
<msubsup>
|
||||
<mspace height="2em" width="2em" mathbackground="blue"/>
|
||||
<mspace id="sub7" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="sup7" height="1em" width="1em" mathbackground="red"/>
|
||||
</msubsup>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<math style="font-family: scripts-6;">
|
||||
<mspace id="ref8" height="1em" width="1em" mathbackground="green"/>
|
||||
<msubsup>
|
||||
<mspace height="2em" width="2em" mathbackground="blue"/>
|
||||
<mspace id="sub8" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="sup8" height="1em" width="1em" mathbackground="red"/>
|
||||
</msubsup>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<math style="font-family: scripts-7;">
|
||||
<msub>
|
||||
<mspace height="2em" width="2em" mathbackground="blue"/>
|
||||
<mspace id="ref9" height="5em"
|
||||
width="1em" mathbackground="green"/>
|
||||
</msub>
|
||||
<msub>
|
||||
<mspace height="2em" width="2em" mathbackground="blue"/>
|
||||
<mspace id="sub9" height="9em"
|
||||
width="1em" mathbackground="red"/>
|
||||
</msub>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<math style="font-family: scripts-8;">
|
||||
<mspace id="ref10" height="1em"
|
||||
width="1em" mathbackground="green"/>
|
||||
<msup>
|
||||
<mspace id="base10" height="2em"
|
||||
width="2em" mathbackground="blue"/>
|
||||
<mspace id="sup10" height="1em"
|
||||
width="1em" mathbackground="red"/>
|
||||
</msup>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,137 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Open Type MATH - stack</title>
|
||||
<script type="application/javascript"
|
||||
src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<meta charset="utf-8"/>
|
||||
<style type="text/css">
|
||||
math {
|
||||
font-size: 10px;
|
||||
}
|
||||
@font-face {
|
||||
font-family: stack-1;
|
||||
src: url(/tests/fonts/math/stack-1.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: stack-2;
|
||||
src: url(/tests/fonts/math/stack-2.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: stack-3;
|
||||
src: url(/tests/fonts/math/stack-3.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: stack-4;
|
||||
src: url(/tests/fonts/math/stack-4.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: stack-5;
|
||||
src: url(/tests/fonts/math/stack-5.otf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: stack-6;
|
||||
src: url(/tests/fonts/math/stack-6.otf);
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function doTest() {
|
||||
var epsilon = 5;
|
||||
function almostEqual(x, y) { return Math.abs(x - y) < epsilon; }
|
||||
|
||||
function getBox(aId) {
|
||||
return document.getElementById(aId).getBoundingClientRect();
|
||||
}
|
||||
|
||||
/* inline style */
|
||||
var ref = getBox("ref").height;
|
||||
|
||||
ok(almostEqual(getBox("d1").top - getBox("n1").bottom, ref * 20),
|
||||
"Bad StackGapMin");
|
||||
|
||||
ok(almostEqual(getBox("ref").top - getBox("n2").top, ref*3),
|
||||
"Bad StackTopShiftMin");
|
||||
|
||||
ok(almostEqual(getBox("d3").bottom - getBox("ref").bottom, ref*3),
|
||||
"Bad StackBottomShiftDown");
|
||||
|
||||
/* display style */
|
||||
ref = getBox("ref").height;
|
||||
|
||||
ok(almostEqual(getBox("d4").top - getBox("n4").bottom, ref * 20),
|
||||
"Bad StackGapDisplayStyleMin");
|
||||
|
||||
ok(almostEqual(getBox("dref").top - getBox("n5").top, ref*3),
|
||||
"Bad StackTopDisplayStyleShiftMin");
|
||||
|
||||
ok(almostEqual(getBox("d6").bottom - getBox("dref").bottom, ref*3),
|
||||
"Bad StackDisplayStyleBottomShiftDown");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="doTest()">
|
||||
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=961365">
|
||||
Mozilla Bug 961365
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
|
||||
<p>
|
||||
<math>
|
||||
<mspace id="ref" height="1em" width="1em" mathbackground="green"/>
|
||||
</math>
|
||||
<math style="font-family: stack-1;">
|
||||
<mfrac linethickness="0">
|
||||
<mspace id="n1" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="d1" height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
<math style="font-family: stack-2;">
|
||||
<mfrac linethickness="0">
|
||||
<mspace id="n2" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="d2" height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
<math style="font-family: stack-3;">
|
||||
<mfrac linethickness="0">
|
||||
<mspace id="n3" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="d3" height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<math displaystyle="true">
|
||||
<mspace id="dref" height="1em" width="1em" mathbackground="green"/>
|
||||
</math>
|
||||
<math displaystyle="true" style="font-family: stack-4;">
|
||||
<mfrac linethickness="0">
|
||||
<mspace id="n4" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="d4" height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
<math displaystyle="true" style="font-family: stack-5;">
|
||||
<mfrac linethickness="0">
|
||||
<mspace id="n5" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="d5" height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
<math displaystyle="true" style="font-family: stack-6;">
|
||||
<mfrac linethickness="0">
|
||||
<mspace id="n6" height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace id="d6" height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -31,8 +31,9 @@ if CONFIG['MOZ_DEBUG']:
|
|||
TEST_DIRS += ['tools/layout-debug']
|
||||
|
||||
MOCHITEST_MANIFESTS += [
|
||||
'reftests/fonts/math/mochitest.ini',
|
||||
'reftests/fonts/mochitest.ini',
|
||||
'reftests/fonts/mplus/mochitest.ini',
|
||||
'reftests/fonts/mplus/mochitest.ini'
|
||||
]
|
||||
|
||||
REFTEST_MANIFESTS += ['reftests/reftest.list']
|
||||
|
|
|
@ -3,4 +3,4 @@ script generate.py. See the comments in that file for more information on how
|
|||
to run the script.
|
||||
|
||||
These fonts are intended to test the The MATH table and OpenType Features used
|
||||
in MathML. See layout/reftests/mathml/
|
||||
in MathML. See layout/reftests/mathml/ and layout/mathml/tests.
|
||||
|
|
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
|
@ -56,6 +56,15 @@ def saveMathFont(aFont):
|
|||
aFont.generate(aFont.fontname + ".otf")
|
||||
print(" done.")
|
||||
|
||||
def createSquareGlyph(aFont, aCodePoint):
|
||||
g = aFont.createChar(aCodePoint)
|
||||
p = g.glyphPen()
|
||||
p.moveTo(0, 0)
|
||||
p.lineTo(em, 0)
|
||||
p.lineTo(em, em)
|
||||
p.lineTo(0, em)
|
||||
p.closePath();
|
||||
|
||||
################################################################################
|
||||
# Glyph variants and constructions
|
||||
f = newMathFont("stretchy")
|
||||
|
@ -229,3 +238,262 @@ f[largeop[0]].verticalVariants = "uni2A1B L7 L8 L9"
|
|||
f[largeop[1]].verticalVariants = "uni2A1C L8"
|
||||
|
||||
saveMathFont(f)
|
||||
|
||||
################################################################################
|
||||
# Testing AxisHeight
|
||||
f = newMathFont("axis-height-1")
|
||||
f.math.AxisHeight = 0
|
||||
createSquareGlyph(f, ord("+"))
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("axis-height-2")
|
||||
f.math.AxisHeight = 20 * em
|
||||
createSquareGlyph(f, ord("+"))
|
||||
saveMathFont(f)
|
||||
|
||||
################################################################################
|
||||
# Testing Fraction Parameters
|
||||
f = newMathFont("fraction-1")
|
||||
f.math.FractionRuleThickness = 20 * em
|
||||
f.math.FractionNumeratorShiftUp = 0
|
||||
f.math.FractionNumeratorDisplayStyleShiftUp = 0
|
||||
f.math.FractionDenominatorShiftDown = 0
|
||||
f.math.FractionNumeratorGapMin = 0
|
||||
f.math.FractionDenominatorGapMin = 0
|
||||
f.math.FractionNumeratorDisplayStyleShiftUp = 0
|
||||
f.math.FractionDenominatorDisplayStyleShiftDown = 0
|
||||
f.math.FractionNumeratorDisplayStyleGapMin = 0
|
||||
f.math.FractionDenominatorDisplayStyleGapMin = 0
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("fraction-2")
|
||||
f.math.FractionRuleThickness = 1 * em
|
||||
f.math.FractionNumeratorShiftUp = 0
|
||||
f.math.FractionDenominatorShiftDown = 0
|
||||
f.math.FractionNumeratorGapMin = 9.5 * em
|
||||
f.math.FractionDenominatorGapMin = 0
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("fraction-3")
|
||||
f.math.FractionRuleThickness = 1 * em
|
||||
f.math.FractionNumeratorShiftUp = 0
|
||||
f.math.FractionDenominatorShiftDown = 0
|
||||
f.math.FractionNumeratorGapMin = 0
|
||||
f.math.FractionDenominatorGapMin = 9.5 * em
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("fraction-4")
|
||||
f.math.FractionRuleThickness = 1 * em
|
||||
f.math.FractionNumeratorShiftUp = 3 * em
|
||||
f.math.FractionDenominatorShiftDown = 0
|
||||
f.math.FractionNumeratorGapMin = 0
|
||||
f.math.FractionDenominatorGapMin = 0
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("fraction-5")
|
||||
f.math.FractionRuleThickness = 1 * em
|
||||
f.math.FractionNumeratorShiftUp = 0
|
||||
f.math.FractionDenominatorShiftDown = 3 * em
|
||||
f.math.FractionNumeratorGapMin = 0
|
||||
f.math.FractionDenominatorGapMin = 0
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("fraction-6")
|
||||
f.math.FractionRuleThickness = 1 * em
|
||||
f.math.FractionNumeratorDisplayStyleShiftUp = 0
|
||||
f.math.FractionDenominatorDisplayStyleShiftDown = 0
|
||||
f.math.FractionNumeratorDisplayStyleGapMin = 9.5 * em
|
||||
f.math.FractionDenominatorDisplayStyleGapMin = 0
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("fraction-7")
|
||||
f.math.FractionRuleThickness = 1 * em
|
||||
f.math.FractionNumeratorDisplayStyleShiftUp = 0
|
||||
f.math.FractionDenominatorDisplayStyleShiftDown = 0
|
||||
f.math.FractionNumeratorDisplayStyleGapMin = 0
|
||||
f.math.FractionDenominatorDisplayStyleGapMin = 9.5 * em
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("fraction-8")
|
||||
f.math.FractionRuleThickness = 1 * em
|
||||
f.math.FractionNumeratorDisplayStyleShiftUp = 3 * em
|
||||
f.math.FractionDenominatorDisplayStyleShiftDown = 0
|
||||
f.math.FractionNumeratorDisplayStyleGapMin = 0
|
||||
f.math.FractionDenominatorDisplayStyleGapMin = 0
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("fraction-9")
|
||||
f.math.FractionRuleThickness = 1 * em
|
||||
f.math.FractionNumeratorDisplayStyleShiftUp = 0
|
||||
f.math.FractionDenominatorDisplayStyleShiftDown = 3 * em
|
||||
f.math.FractionNumeratorDisplayStyleGapMin = 0
|
||||
f.math.FractionDenominatorDisplayStyleGapMin = 0
|
||||
saveMathFont(f)
|
||||
|
||||
################################################################################
|
||||
# Testing Stack Parameters
|
||||
f = newMathFont("stack-1")
|
||||
f.math.StackTopShiftUp = 0
|
||||
f.math.StackBottomShiftDown = 0
|
||||
f.math.StackGapMin = 20 * em
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("stack-2")
|
||||
f.math.StackTopShiftUp = 3 * em
|
||||
f.math.StackBottomShiftDown = 0
|
||||
f.math.StackGapMin = 0
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("stack-3")
|
||||
f.math.StackTopShiftUp = 0
|
||||
f.math.StackBottomShiftDown = 3 * em
|
||||
f.math.StackGapMin = 0
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("stack-4")
|
||||
f.math.StackTopDisplayStyleShiftUp = 0
|
||||
f.math.StackBottomDisplayStyleShiftDown = 0
|
||||
f.math.StackDisplayStyleGapMin = 20 * em
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("stack-5")
|
||||
f.math.StackTopDisplayStyleShiftUp = 3 * em
|
||||
f.math.StackBottomDisplayStyleShiftDown = 0
|
||||
f.math.StackDisplayStyleGapMin = 0
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("stack-6")
|
||||
f.math.StackTopDisplayStyleShiftUp = 0
|
||||
f.math.StackBottomDisplayStyleShiftDown = 3 * em
|
||||
f.math.StackDisplayStyleGapMin = 0
|
||||
saveMathFont(f)
|
||||
|
||||
################################################################################
|
||||
# Testing Radical Parameters
|
||||
f = newMathFont("radical-1")
|
||||
f.math.RadicalExtraAscender = 0
|
||||
f.math.RadicalRuleThickness = 5 * em
|
||||
f.math.RadicalVerticalGap = 0
|
||||
createSquareGlyph(f, 0x221a)
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("radical-2")
|
||||
f.math.RadicalExtraAscender = 7 * em
|
||||
f.math.RadicalRuleThickness = 1 * em
|
||||
f.math.RadicalVerticalGap = 0
|
||||
createSquareGlyph(f, 0x221a)
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("radical-3")
|
||||
f.math.RadicalExtraAscender = 0
|
||||
f.math.RadicalRuleThickness = 1 * em
|
||||
f.math.RadicalVerticalGap = 3 * em
|
||||
createSquareGlyph(f, 0x221a)
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("radical-4")
|
||||
f.math.RadicalExtraAscender = 0
|
||||
f.math.RadicalRuleThickness = 1 * em
|
||||
f.math.RadicalDisplayStyleVerticalGap = 9 * em
|
||||
createSquareGlyph(f, 0x221a)
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("radical-5")
|
||||
f.math.RadicalExtraAscender = 0
|
||||
f.math.RadicalRuleThickness = 1 * em
|
||||
f.math.RadicalVerticalGap = 0
|
||||
f.math.RadicalDegreeBottomRaisePercent = 25
|
||||
createSquareGlyph(f, 0x221a)
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("radical-6")
|
||||
f.math.RadicalKernBeforeDegree = 5 * em
|
||||
f.math.RadicalKernAfterDegree = 0
|
||||
createSquareGlyph(f, 0x221a)
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("radical-7")
|
||||
f.math.RadicalKernBeforeDegree = 0
|
||||
f.math.RadicalKernAfterDegree = 7 * em
|
||||
createSquareGlyph(f, 0x221a)
|
||||
saveMathFont(f)
|
||||
|
||||
################################################################################
|
||||
# Testing Scripts Parameters
|
||||
f = newMathFont("scripts-1")
|
||||
f.math.SpaceAfterScript = 3 * em
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("scripts-2")
|
||||
f.math.SuperscriptShiftUp = 7 * em
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("scripts-3")
|
||||
f.math.SuperscriptShiftUpCramped = 5 * em
|
||||
createSquareGlyph(f, 0x221a)
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("scripts-4")
|
||||
f.math.SubscriptShiftDown = 6 * em
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("scripts-5")
|
||||
f.math.SubSuperscriptGapMin = 11 * em
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("scripts-6")
|
||||
f.math.SubSuperscriptGapMin = 11 * em
|
||||
f.math.SuperscriptBottomMaxWithSubscript = 3 * em
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("scripts-7")
|
||||
f.math.SubscriptTopMax = 5 * em
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("scripts-8")
|
||||
f.math.SuperscriptBottomMin = 9 * em
|
||||
saveMathFont(f)
|
||||
|
||||
################################################################################
|
||||
# Testing Limits Parameters
|
||||
f = newMathFont("limits-1")
|
||||
f.math.UpperLimitGapMin = 7 * em
|
||||
f.math.UpperLimitBaselineRiseMin = 0
|
||||
f.math.LowerLimitGapMin = 0
|
||||
f.math.LowerLimitBaselineDropMin = 0
|
||||
createSquareGlyph(f, 0x2211)
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("limits-2")
|
||||
f.math.UpperLimitGapMin = 0
|
||||
f.math.UpperLimitBaselineRiseMin = 0
|
||||
f.math.LowerLimitGapMin = 5 * em
|
||||
f.math.LowerLimitBaselineDropMin = 0
|
||||
createSquareGlyph(f, 0x2211)
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("limits-3")
|
||||
f.math.UpperLimitGapMin = 0
|
||||
f.math.UpperLimitBaselineRiseMin = 9 * em
|
||||
f.math.LowerLimitGapMin = 0
|
||||
f.math.LowerLimitBaselineDropMin = 0
|
||||
createSquareGlyph(f, 0x2211)
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("limits-4")
|
||||
f.math.UpperLimitGapMin = 0
|
||||
f.math.UpperLimitBaselineRiseMin = 0
|
||||
f.math.LowerLimitGapMin = 0
|
||||
f.math.LowerLimitBaselineDropMin = 2 * em
|
||||
createSquareGlyph(f, 0x2211)
|
||||
saveMathFont(f)
|
||||
|
||||
f = newMathFont("limits-5")
|
||||
f.math.UpperLimitGapMin = 0
|
||||
f.math.UpperLimitBaselineRiseMin = 0
|
||||
f.math.LowerLimitGapMin = 0
|
||||
f.math.LowerLimitBaselineDropMin = 0
|
||||
f.math.AccentBaseHeight = 6 * em
|
||||
f.math.FlattenedAccentBaseHeight = 3 * em
|
||||
createSquareGlyph(f, ord("~"))
|
||||
saveMathFont(f)
|
||||
|
|
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
|
@ -0,0 +1,39 @@
|
|||
[DEFAULT]
|
||||
support-files =
|
||||
/tests/fonts/math/axis-height-1.otf
|
||||
/tests/fonts/math/axis-height-2.otf
|
||||
/tests/fonts/math/fraction-1.otf
|
||||
/tests/fonts/math/fraction-2.otf
|
||||
/tests/fonts/math/fraction-3.otf
|
||||
/tests/fonts/math/fraction-4.otf
|
||||
/tests/fonts/math/fraction-5.otf
|
||||
/tests/fonts/math/fraction-6.otf
|
||||
/tests/fonts/math/fraction-7.otf
|
||||
/tests/fonts/math/fraction-8.otf
|
||||
/tests/fonts/math/fraction-9.otf
|
||||
/tests/fonts/math/limits-1.otf
|
||||
/tests/fonts/math/limits-2.otf
|
||||
/tests/fonts/math/limits-3.otf
|
||||
/tests/fonts/math/limits-4.otf
|
||||
/tests/fonts/math/limits-5.otf
|
||||
/tests/fonts/math/radical-1.otf
|
||||
/tests/fonts/math/radical-2.otf
|
||||
/tests/fonts/math/radical-3.otf
|
||||
/tests/fonts/math/radical-4.otf
|
||||
/tests/fonts/math/radical-5.otf
|
||||
/tests/fonts/math/radical-6.otf
|
||||
/tests/fonts/math/radical-7.otf
|
||||
/tests/fonts/math/scripts-1.otf
|
||||
/tests/fonts/math/scripts-2.otf
|
||||
/tests/fonts/math/scripts-3.otf
|
||||
/tests/fonts/math/scripts-4.otf
|
||||
/tests/fonts/math/scripts-5.otf
|
||||
/tests/fonts/math/scripts-6.otf
|
||||
/tests/fonts/math/scripts-7.otf
|
||||
/tests/fonts/math/scripts-8.otf
|
||||
/tests/fonts/math/stack-1.otf
|
||||
/tests/fonts/math/stack-2.otf
|
||||
/tests/fonts/math/stack-3.otf
|
||||
/tests/fonts/math/stack-4.otf
|
||||
/tests/fonts/math/stack-5.otf
|
||||
/tests/fonts/math/stack-6.otf
|
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>mfrac linethickness</title>
|
||||
<style type="text/css">
|
||||
math {
|
||||
font-size: 10px;
|
||||
}
|
||||
@font-face {
|
||||
font-family: fraction-1;
|
||||
src: url(../fonts/math/fraction-1.otf);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<math style="font-family: fraction-1;">
|
||||
<mfrac>
|
||||
<mspace height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
<math displaystyle="true" style="font-family: fraction-1;">
|
||||
<mfrac>
|
||||
<mspace height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,38 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<title>mfrac linethickness</title>
|
||||
<style type="text/css">
|
||||
math {
|
||||
font-size: 10px;
|
||||
}
|
||||
@font-face {
|
||||
font-family: fraction-1;
|
||||
src: url(../fonts/math/fraction-1.otf);
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doTest() {
|
||||
var mfracs = document.getElementsByTagName("mfrac");
|
||||
mfracs[0].removeAttribute("linethickness");
|
||||
mfracs[1].removeAttribute("linethickness");
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
window.addEventListener("MozReftestInvalidate", doTest, false);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<math style="font-family: fraction-1;">
|
||||
<mfrac linethickness="200%">
|
||||
<mspace height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
<math displaystyle="true" style="font-family: fraction-1;">
|
||||
<mfrac linethickness="200%">
|
||||
<mspace height="1em" width="1em" mathbackground="red"/>
|
||||
<mspace height="1em" width="1em" mathbackground="red"/>
|
||||
</mfrac>
|
||||
</math>
|
||||
</body>
|
||||
</html>
|
|
@ -155,6 +155,7 @@ skip-if(B2G) == maction-dynamic-3.html maction-dynamic-3-ref.html # bug 773482
|
|||
fails == whitespace-trim-4.html whitespace-trim-4-ref.html # Bug 787215
|
||||
== whitespace-trim-5.html whitespace-trim-5-ref.html
|
||||
random-if(winWidget&&!d2d) == opentype-stretchy.html opentype-stretchy-ref.html
|
||||
== opentype-fraction-dynamic-linethickness.html opentype-fraction-dynamic-linethickness-ref.html
|
||||
== operator-1.xhtml operator-1-ref.xhtml
|
||||
== scriptshift-1.xhtml scriptshift-1-ref.xhtml
|
||||
== number-size-1.xhtml number-size-1-ref.xhtml
|
||||
|
@ -302,18 +303,18 @@ fails-if(B2G||Android||/^Windows\x20NT\x205\.1/.test(http.oscpu)||OSX) == mathva
|
|||
== mfrac-A-7.html mfrac-A-7-ref.html
|
||||
== mfrac-A-8.html mfrac-A-8-ref.html
|
||||
== mfrac-B-1.html mfrac-B-1-ref.html
|
||||
== mfrac-B-2.html mfrac-B-2-3-ref.html
|
||||
== mfrac-B-3.html mfrac-B-2-3-ref.html
|
||||
random-if(winWidget&&!/^Windows\x20NT\x205\.1/.test(http.oscpu)) == mfrac-B-2.html mfrac-B-2-3-ref.html
|
||||
random-if(winWidget&&!/^Windows\x20NT\x205\.1/.test(http.oscpu)) == mfrac-B-3.html mfrac-B-2-3-ref.html
|
||||
== mfrac-B-4.html mfrac-B-4-5-ref.html
|
||||
== mfrac-B-5.html mfrac-B-4-5-ref.html
|
||||
== mfrac-B-6.html mfrac-B-6-7-ref.html
|
||||
== mfrac-B-7.html mfrac-B-6-7-ref.html
|
||||
fuzzy-if(OSX,1,100) == mfrac-C-1.html mfrac-C-1-ref.html
|
||||
== mfrac-C-2.html mfrac-C-2-ref.html
|
||||
random-if(winWidget&&!/^Windows\x20NT\x205\.1/.test(http.oscpu)) == mfrac-C-2.html mfrac-C-2-ref.html
|
||||
== mfrac-C-3.html mfrac-C-3-ref.html
|
||||
== mfrac-C-4.html mfrac-C-4-ref.html
|
||||
fuzzy-if(OSX,1,100) == mfrac-D-1.html mfrac-D-1-ref.html
|
||||
== mfrac-D-2.html mfrac-D-2-ref.html
|
||||
random-if(winWidget&&!/^Windows\x20NT\x205\.1/.test(http.oscpu)) == mfrac-D-2.html mfrac-D-2-ref.html
|
||||
== mfrac-D-3.html mfrac-D-3-ref.html
|
||||
== mfrac-D-4.html mfrac-D-4-ref.html
|
||||
== mfrac-E-1.html mfrac-E-1-ref.html
|
||||
|
|
Загрузка…
Ссылка в новой задаче