зеркало из https://github.com/mozilla/gecko-dev.git
Bug 930504 - When possible, use character substitution for basic mathvariants. r=karlt
This commit is contained in:
Родитель
0e3ff19f35
Коммит
2ec405ffcc
|
@ -610,13 +610,27 @@ MathMLTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun,
|
|||
mathVar == NS_MATHML_MATHVARIANT_BOLD_ITALIC ||
|
||||
mathVar == NS_MATHML_MATHVARIANT_ITALIC) {
|
||||
if (ch == ch2 && ch != 0x20 && ch != 0xA0) {
|
||||
// Don't perform the transformation if a character cannot be
|
||||
// Don't apply the CSS style if a character cannot be
|
||||
// transformed. There is an exception for whitespace as it is both
|
||||
// common and innocuous.
|
||||
doMathvariantStyling = false;
|
||||
}
|
||||
// Undo the change as it will be handled as a font styling.
|
||||
ch2 = ch;
|
||||
if (ch2 != ch) {
|
||||
// Bug 930504. Some platforms do not have fonts for Mathematical
|
||||
// Alphanumeric Symbols. Hence we check whether the transformed
|
||||
// character is actually available.
|
||||
uint8_t matchType;
|
||||
nsRefPtr<gfxFont> mathFont = fontGroup->
|
||||
FindFontForChar(ch2, 0, HB_SCRIPT_COMMON, nullptr, &matchType);
|
||||
if (mathFont) {
|
||||
// Don't apply the CSS style if there is a math font for at least one
|
||||
// of the transformed character in this text run.
|
||||
doMathvariantStyling = false;
|
||||
} else {
|
||||
// We fallback to the original character.
|
||||
ch2 = ch;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
deletedCharsArray.AppendElement(false);
|
||||
|
|
|
@ -14,15 +14,52 @@
|
|||
<br>
|
||||
<math>
|
||||
<mrow>
|
||||
<mtext fontstyle="italic">ABCDEFGHIJKLMNOPQRSTUVWXYZ</mtext>
|
||||
<mtext fontstyle="italic">abcdefghijklmnopqrstuvwxyz</mtext>
|
||||
<mtext>
|
||||
𝐀𝐁𝐂𝐃𝐄𝐅
|
||||
𝐆𝐇𝐈𝐉𝐊𝐋
|
||||
𝐌𝐍𝐎𝐏𝐐𝐑
|
||||
𝐒𝐓𝐔𝐕𝐖𝐗
|
||||
𝐘𝐙
|
||||
𝐚𝐛𝐜𝐝𝐞𝐟
|
||||
𝐠𝐡𝐢𝐣𝐤𝐥
|
||||
𝐦𝐧𝐨𝐩𝐪𝐫
|
||||
𝐬𝐭𝐮𝐯𝐰𝐱
|
||||
𝐲𝐳
|
||||
</mtext>
|
||||
</mrow>
|
||||
</math>
|
||||
<br>
|
||||
<math>
|
||||
<mrow>
|
||||
<mtext fontweight="bold" fontstyle="italic">ABCDEFGHIJKLMNOPQRSTUVWXYZ</mtext>
|
||||
<mtext fontweight="bold" fontstyle="italic">abcdefghijklmnopqrstuvwxyz</mtext>
|
||||
<mtext>
|
||||
𝐴𝐵𝐶𝐷𝐸𝐹
|
||||
𝐺𝐻𝐼𝐽𝐾𝐿
|
||||
𝑀𝑁𝑂𝑃𝑄𝑅
|
||||
𝑆𝑇𝑈𝑉𝑊𝑋
|
||||
𝑌𝑍
|
||||
𝑎𝑏𝑐𝑑𝑒𝑓
|
||||
𝑔ℎ𝑖𝑗𝑘𝑙
|
||||
𝑚𝑛𝑜𝑝𝑞𝑟
|
||||
𝑠𝑡𝑢𝑣𝑤𝑥
|
||||
𝑦𝑧
|
||||
</mtext>
|
||||
</mrow>
|
||||
</math>
|
||||
<br>
|
||||
<math>
|
||||
<mrow>
|
||||
<mtext>
|
||||
𝑨𝑩𝑪𝑫𝑬𝑭
|
||||
𝑮𝑯𝑰𝑱𝑲𝑳
|
||||
𝑴𝑵𝑶𝑷𝑸𝑹
|
||||
𝑺𝑻𝑼𝑽𝑾𝑿
|
||||
𝒀𝒁
|
||||
𝒂𝒃𝒄𝒅𝒆𝒇
|
||||
𝒈𝒉𝒊𝒋𝒌𝒍
|
||||
𝒎𝒏𝒐𝒑𝒒𝒓
|
||||
𝒔𝒕𝒖𝒗𝒘𝒙
|
||||
𝒚𝒛
|
||||
</mtext>
|
||||
</mrow>
|
||||
</math>
|
||||
<br>
|
||||
|
|
|
@ -14,15 +14,49 @@
|
|||
<br>
|
||||
<math>
|
||||
<mrow>
|
||||
<mtext mathvariant="italic">ABCDEFGHIJKLMNOPQRSTUVWXYZ</mtext>
|
||||
<mtext mathvariant="italic">abcdefghijklmnopqrstuvwxyz</mtext>
|
||||
<mtext mathvariant="bold">
|
||||
ABCDEF
|
||||
GHIJKL
|
||||
MNOPQR
|
||||
STUVWX
|
||||
YZ
|
||||
abcdef
|
||||
ghijkl
|
||||
mnopqr
|
||||
stuvwx
|
||||
yz</mtext>
|
||||
</mrow>
|
||||
</math>
|
||||
<br>
|
||||
<math>
|
||||
<mrow>
|
||||
<mtext mathvariant="bold-italic">ABCDEFGHIJKLMNOPQRSTUVWXYZ</mtext>
|
||||
<mtext mathvariant="bold-italic">abcdefghijklmnopqrstuvwxyz</mtext>
|
||||
<mtext mathvariant="italic">
|
||||
ABCDEF
|
||||
GHIJKL
|
||||
MNOPQR
|
||||
STUVWX
|
||||
YZ
|
||||
abcdef
|
||||
ghijkl
|
||||
mnopqr
|
||||
stuvwx
|
||||
yz</mtext>
|
||||
</mrow>
|
||||
</math>
|
||||
<br>
|
||||
<math>
|
||||
<mrow>
|
||||
<mtext mathvariant="bold-italic">
|
||||
ABCDEF
|
||||
GHIJKL
|
||||
MNOPQR
|
||||
STUVWX
|
||||
YZ
|
||||
abcdef
|
||||
ghijkl
|
||||
mnopqr
|
||||
stuvwx
|
||||
yz</mtext>
|
||||
</mrow>
|
||||
</math>
|
||||
<br>
|
||||
|
|
|
@ -13,7 +13,10 @@
|
|||
<br>
|
||||
<math>
|
||||
<mrow>
|
||||
<mtext fontweight="bold">0123456789</mtext>
|
||||
<mtext>
|
||||
𝟎𝟏𝟐𝟑𝟒𝟓
|
||||
𝟔𝟕𝟖𝟗
|
||||
</mtext>
|
||||
</mrow>
|
||||
</math>
|
||||
<br>
|
||||
|
|
|
@ -13,7 +13,10 @@
|
|||
<br>
|
||||
<math>
|
||||
<mrow>
|
||||
<mtext mathvariant="bold">0123456789</mtext>
|
||||
<mtext mathvariant="bold">
|
||||
012345
|
||||
6789
|
||||
</mtext>
|
||||
</mrow>
|
||||
</math>
|
||||
<br>
|
||||
|
|
|
@ -24,51 +24,51 @@
|
|||
<br>
|
||||
<math>
|
||||
<mrow>
|
||||
<mtext fontweight="bold">
|
||||
ΑΒΓΔΕΖ
|
||||
ΗΘΙΚΛΜ
|
||||
ΝΞΟΠΡϴ
|
||||
ΣΤΥΦΧΨ
|
||||
Ω∇αβγδ
|
||||
εζηθικ
|
||||
λμνξοπ
|
||||
ρςστυφ
|
||||
χψω∂ϵϑ
|
||||
ϰϕϱϖ
|
||||
<mtext>
|
||||
𝚨𝚩𝚪𝚫𝚬𝚭
|
||||
𝚮𝚯𝚰𝚱𝚲𝚳
|
||||
𝚴𝚵𝚶𝚷𝚸𝚹
|
||||
𝚺𝚻𝚼𝚽𝚾𝚿
|
||||
𝛀𝛁𝛂𝛃𝛄𝛅
|
||||
𝛆𝛇𝛈𝛉𝛊𝛋
|
||||
𝛌𝛍𝛎𝛏𝛐𝛑
|
||||
𝛒𝛓𝛔𝛕𝛖𝛗
|
||||
𝛘𝛙𝛚𝛛𝛜𝛝
|
||||
𝛞𝛟𝛠𝛡
|
||||
</mtext>
|
||||
</mrow>
|
||||
</math>
|
||||
<br>
|
||||
<math>
|
||||
<mrow>
|
||||
<mtext fontstyle="italic">
|
||||
ΑΒΓΔΕΖ
|
||||
ΗΘΙΚΛΜ
|
||||
ΝΞΟΠΡϴ
|
||||
ΣΤΥΦΧΨ
|
||||
Ω∇αβγδ
|
||||
εζηθικ
|
||||
λμνξοπ
|
||||
ρςστυφ
|
||||
χψω∂ϵϑ
|
||||
ϰϕϱϖ
|
||||
<mtext>
|
||||
𝛢𝛣𝛤𝛥𝛦𝛧
|
||||
𝛨𝛩𝛪𝛫𝛬𝛭
|
||||
𝛮𝛯𝛰𝛱𝛲𝛳
|
||||
𝛴𝛵𝛶𝛷𝛸𝛹
|
||||
𝛺𝛻𝛼𝛽𝛾𝛿
|
||||
𝜀𝜁𝜂𝜃𝜄𝜅
|
||||
𝜆𝜇𝜈𝜉𝜊𝜋
|
||||
𝜌𝜍𝜎𝜏𝜐𝜑
|
||||
𝜒𝜓𝜔𝜕𝜖𝜗
|
||||
𝜘𝜙𝜚𝜛
|
||||
</mtext>
|
||||
</mrow>
|
||||
</math>
|
||||
<br>
|
||||
<math>
|
||||
<mrow>
|
||||
<mtext fontweight="bold" fontstyle="italic">
|
||||
ΑΒΓΔΕΖ
|
||||
ΗΘΙΚΛΜ
|
||||
ΝΞΟΠΡϴ
|
||||
ΣΤΥΦΧΨ
|
||||
Ω∇αβγδ
|
||||
εζηθικ
|
||||
λμνξοπ
|
||||
ρςστυφ
|
||||
χψω∂ϵϑ
|
||||
ϰϕϱϖ
|
||||
<mtext>
|
||||
𝜜𝜝𝜞𝜟𝜠𝜡
|
||||
𝜢𝜣𝜤𝜥𝜦𝜧
|
||||
𝜨𝜩𝜪𝜫𝜬𝜭
|
||||
𝜮𝜯𝜰𝜱𝜲𝜳
|
||||
𝜴𝜵𝜶𝜷𝜸𝜹
|
||||
𝜺𝜻𝜼𝜽𝜾𝜿
|
||||
𝝀𝝁𝝂𝝃𝝄𝝅
|
||||
𝝆𝝇𝝈𝝉𝝊𝝋
|
||||
𝝌𝝍𝝎𝝏𝝐𝝑
|
||||
𝝒𝝓𝝔𝝕
|
||||
</mtext>
|
||||
</mrow>
|
||||
</math>
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
<body>
|
||||
<math>
|
||||
<mrow>
|
||||
<mtext fontstyle="italic">ıȷ</mtext>
|
||||
<mtext>𝚤𝚥</mtext>
|
||||
<mtext>ıȷ</mtext>
|
||||
<mtext fontweight="bold">Ϝϝ</mtext>
|
||||
<mtext>𝟊𝟋</mtext>
|
||||
<mtext>Ϝϝ</mtext>
|
||||
</mrow>
|
||||
</math>
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Mathematica Alphanumeric Italic</title>
|
||||
<meta charset="utf-8"/>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<math><mstyle mathbackground="red"><mphantom><mi>X</mi></mphantom></mstyle></math>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,14 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Mathematica Alphanumeric Italic</title>
|
||||
<meta charset="utf-8"/>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- The lowercase italic o should be smaller than the uppercase italic X
|
||||
(this will fail if missing char boxes are used) -->
|
||||
<math><mstyle mathbackground="red"><mphantom><mi>o</mi></mphantom></mstyle></math>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -38,6 +38,7 @@ skip-if(B2G) fails-if(smallScreen&&Android) fuzzy(255,200) == mirror-op-1.html m
|
|||
fails-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) == mfenced-10.html mfenced-10-ref.html # Windows versions without Cambria Math, see bug 670592
|
||||
== mi-mathvariant-1.xhtml mi-mathvariant-1-ref.xhtml
|
||||
== mi-mathvariant-2.xhtml mi-mathvariant-2-ref.xhtml
|
||||
!= mi-mathvariant-3.html mi-mathvariant-3-ref.html
|
||||
!= non-spacing-accent-1.xhtml non-spacing-accent-1-ref.xhtml
|
||||
== overbar-width-1.xhtml overbar-width-1-ref.xhtml
|
||||
skip-if(B2G) == quotes-1.xhtml quotes-1-ref.xhtml
|
||||
|
@ -194,7 +195,7 @@ fails-if(B2G) == menclose-2-roundedbox.html menclose-2-roundedbox-ref.html # B2G
|
|||
== menclose-2-phasorangle.html menclose-2-phasorangle-ref.html
|
||||
== menclose-3-box.html menclose-3-box-ref.html
|
||||
== menclose-3-madruwb.html menclose-3-madruwb-ref.html
|
||||
fails random-if(winWidget) == menclose-3-radical.html menclose-3-radical-ref.html # Bug 973917
|
||||
fails-if(B2G||Android||OSX==10.6) == menclose-3-radical.html menclose-3-radical-ref.html # Bug 973917
|
||||
== menclose-3-default.html menclose-3-default-ref.html
|
||||
== menclose-3-invalid.html menclose-3-invalid-ref.html
|
||||
== menclose-3-multiple.html menclose-3-multiple-ref.html
|
||||
|
@ -235,12 +236,12 @@ fuzzy-if(OSX,1,100) == menclose-5-circle.html menclose-5-circle-ref.html
|
|||
== menclose-6-verticalstrike.html menclose-6-ref.html
|
||||
== menclose-6-phasorangle.html menclose-6-ref.html
|
||||
== mmultiscript-align.html mmultiscript-align-ref.html
|
||||
== subscript-italic-correction.html subscript-italic-correction-ref.html
|
||||
== mathvariant-1a.html mathvariant-1a-ref.html
|
||||
== mathvariant-1b.html mathvariant-1b-ref.html
|
||||
== mathvariant-1c.html mathvariant-1c-ref.html
|
||||
fails-if(winWidget&&!/^Windows\x20NT\x205\.1/.test(http.oscpu)) == subscript-italic-correction.html subscript-italic-correction-ref.html # Windows versions with Cambria Math, bug 961482
|
||||
fails-if(B2G||Android||/^Windows\x20NT\x205\.1/.test(http.oscpu)||OSX==10.6) == mathvariant-1a.html mathvariant-1a-ref.html # Bug 1010679
|
||||
fails-if(B2G||Android||/^Windows\x20NT\x205\.1/.test(http.oscpu)||OSX==10.6) == mathvariant-1b.html mathvariant-1b-ref.html # Bug 1010679
|
||||
fails-if(B2G||Android||/^Windows\x20NT\x205\.1/.test(http.oscpu)||OSX==10.6) == mathvariant-1c.html mathvariant-1c-ref.html # Bug 1010679
|
||||
== mathvariant-1d.html mathvariant-1d-ref.html
|
||||
== mathvariant-2.html mathvariant-2-ref.html
|
||||
fails-if(B2G||Android||/^Windows\x20NT\x205\.1/.test(http.oscpu)||OSX) == mathvariant-2.html mathvariant-2-ref.html # Bugs 1010678, 1010679
|
||||
== mathvariant-3.html mathvariant-3-ref.html
|
||||
== mathvariant-4.html mathvariant-4-ref.html
|
||||
== mathvariant-5.html mathvariant-5-ref.html
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<div>
|
||||
<math>
|
||||
<msubsup>
|
||||
<mi>f</mi>
|
||||
<mi mathbackground="#5f5">f</mi>
|
||||
<mspace id="s0" width="50px" height="50px" mathbackground="blue"/>
|
||||
<mspace id="s1" width="50px" height="50px" mathbackground="blue"/>
|
||||
</msubsup>
|
||||
|
@ -21,7 +21,7 @@
|
|||
<div>
|
||||
<math>
|
||||
<mmultiscripts>
|
||||
<mi>f</mi>
|
||||
<mi mathbackground="#5f5">f</mi>
|
||||
<mspace id="s2" width="50px" height="50px" mathbackground="blue"/>
|
||||
<mspace id="s3" width="50px" height="50px" mathbackground="blue"/>
|
||||
<mspace id="s4" width="50px" height="50px" mathbackground="blue"/>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<script type="text/javascript">
|
||||
function verifyItalicCorrections()
|
||||
{
|
||||
var epsilon = 5;
|
||||
var epsilon = 2;
|
||||
for (var i = 0; i < 8; i += 2) {
|
||||
var sub = document.getElementById("s" + i);
|
||||
var sup = document.getElementById("s" + (i+1));
|
||||
|
@ -34,7 +34,7 @@
|
|||
<div>
|
||||
<math>
|
||||
<msubsup>
|
||||
<mi>f</mi>
|
||||
<mi mathbackground="#5f5">f</mi>
|
||||
<mspace id="s0" width="50px" height="50px" mathbackground="blue"/>
|
||||
<mspace id="s1" width="50px" height="50px" mathbackground="blue"/>
|
||||
</msubsup>
|
||||
|
@ -46,7 +46,7 @@
|
|||
<div>
|
||||
<math>
|
||||
<mmultiscripts>
|
||||
<mi>f</mi>
|
||||
<mi mathbackground="#5f5">f</mi>
|
||||
<mspace id="s2" width="50px" height="50px" mathbackground="blue"/>
|
||||
<mspace id="s3" width="50px" height="50px" mathbackground="blue"/>
|
||||
<mspace id="s4" width="50px" height="50px" mathbackground="blue"/>
|
||||
|
|
Загрузка…
Ссылка в новой задаче