diff --git a/testing/web-platform/tests/fonts/math/radical-negativekernbeforedegree1000-rulethickness1000.woff b/testing/web-platform/tests/fonts/math/radical-negativekernbeforedegree1000-rulethickness1000.woff new file mode 100644 index 000000000000..ed6ce88c39e2 --- /dev/null +++ b/testing/web-platform/tests/fonts/math/radical-negativekernbeforedegree1000-rulethickness1000.woff @@ -0,0 +1,319 @@ +wOFFOTTO +d +CFF +t +) +9 +FFTM +7W +MATH +9 +eOS +/ +2 +\ +2 +cmap +C +JD +( +head +. +6 +9hhea +8 += +hmtx +T +maxp +T +P +name +{ +) +ypost +\ +3x +c +d +b +| +6_ +_ +E +n +L3 +_ +8 +< +ET +^ +x +c +d +~ +& +AlF +T +P +2 +P +x +c +a +~ +8 +a +fr +f4 +0 +AAI +w +\ +x +Mj +0 +M +I +Fv +P +V +[ +Av +9 +C +8 +G +r +Z +X +7 +7 +w +' +b +- +W +! +n ++ +< +5 +M +f +5V +] +8 +e +j +| +[ +a +[ +Q +D +2 +1 +h +- +\ +a +n +J +e +F +E +< +lV +L +" +" +2 +0B += ++ +2E +k +7T +> +7 +> +BJ +O +) +^ +e +: +jg +4 +YZ +( +^ +E +% +T +V +\ +J +s +] +- +RfU +# +N +o +i1 +% +lH01 +K +2F +V +E +g +s +} +f +. +M ++ +bF +4Ws +: +d +0 +2 +z +x +c +f +F +p +| +w_ +# +& +x +c +f +F +( +U +x +cd +aa +dd4 +/ +JL +LN +KMO +K +N +- +KJM +/ +JMIM +/ +JM5400 +- +* +I +- +L +K +- +. +002102 +g +! +C +" +_52 +Xe +5 +e +d +e +d +1 +p0 +2 +1 +3 +2d3 +Z +^ +Y +j +" +s +~ +AeQfzF +F +gzbNf +B +y +& +l +{ +y +/ +z +# +- +N +C +Y +~ +W +. +~ +] +{ +n +n +_5 +H +s2 +R +x +c +d +k +_A +? +4 +M +x +c +d +bx +z +4p +Jk +v +c +j +4 +d +8 +/ +T +> +# +T +A +A +A +* +j +K +f +; +X +" +a +{ +/ +_ +_ +1A1 diff --git a/testing/web-platform/tests/mathml/presentation-markup/radicals/root-parameters-2.html b/testing/web-platform/tests/mathml/presentation-markup/radicals/root-parameters-2.html new file mode 100644 index 000000000000..165941561f5c --- /dev/null +++ b/testing/web-platform/tests/mathml/presentation-markup/radicals/root-parameters-2.html @@ -0,0 +1,675 @@ +< +! +DOCTYPE +html +> +< +html +> +< +head +> +< +meta +charset += +" +utf +- +8 +" +> +< +title +> +Radical +parameters +< +/ +title +> +< +link +rel += +" +help +" +href += +" +https +: +/ +/ +mathml +- +refresh +. +github +. +io +/ +mathml +- +core +/ +# +radicals +- +msqrt +- +mroot +" +> +< +meta +name += +" +assert +" +content += +" +Test +edge +kerning +values +for +radicals +. +" +> +< +script +src += +" +/ +resources +/ +testharness +. +js +" +> +< +/ +script +> +< +script +src += +" +/ +resources +/ +testharnessreport +. +js +" +> +< +/ +script +> +< +script +src += +" +/ +mathml +/ +support +/ +feature +- +detection +. +js +" +> +< +/ +script +> +< +style +> +font +- +face +{ +font +- +family +: +radical +- +negativekernbeforedegree1000 +- +rulethickness1000 +; +src +: +url +( +" +/ +fonts +/ +math +/ +radical +- +negativekernbeforedegree1000 +- +rulethickness1000 +. +woff +" +) +; +} +font +- +face +{ +font +- +family +: +radical +- +kernafterdegreeminus5000 +- +rulethickness1000 +; +src +: +url +( +" +/ +fonts +/ +math +/ +radical +- +kernafterdegreeminus5000 +- +rulethickness1000 +. +woff +" +) +; +} +math +mspace +{ +font +- +size +: +10px +; +} +mspace +{ +opacity +: +. +5 +; +} +< +/ +style +> +< +script +> +var +emToPx += +10 +/ +1000 +; +/ +/ +font +- +size +: +10px +font +. +em += +1000 +var +epsilon += +1 +; +function +getBox +( +aId +) +{ +return +document +. +getElementById +( +aId +) +. +getBoundingClientRect +( +) +; +} +function +runTests +( +) +{ +test +( +function +( +) +{ +assert_true +( +MathMLFeatureDetection +. +has_mspace +( +) +) +; +assert_approx_equals +( +getBox +( +" +index001 +" +) +. +left +- +getBox +( +" +mroot001 +" +) +. +left +0 +epsilon +" +should +be +clamped +to +0 +" +) +; +} +" +RadicalKernBeforeDegree += +- +1em +< +0 +" +) +; +test +( +function +( +) +{ +assert_true +( +MathMLFeatureDetection +. +has_mspace +( +) +) +; +var +radicalSymbolWidth += +1000 +* +emToPx +; +var +radicalLeft += +getBox +( +" +base002 +" +) +. +left +- +radicalSymbolWidth +; +assert_approx_equals +( +getBox +( +" +index002 +" +) +. +right +- +radicalLeft +30 +epsilon +" +should +be +clamped +to +3em +" +) +; +} +" +RadicalKernBeforeAfterDegree += +- +5em +< +- +3em += +- +degree +' +s +inline +size +" +) +; +done +( +) +; +} +setup +( +{ +explicit_done +: +true +} +) +; +window +. +addEventListener +( +" +load +" +( +) += +> +{ +document +. +fonts +. +ready +. +then +( +runTests +) +; +} +) +; +< +/ +script +> +< +/ +head +> +< +body +> +< +div +id += +" +log +" +> +< +/ +div +> +< +p +> +< +math +style += +" +font +- +family +: +radical +- +negativekernbeforedegree1000 +- +rulethickness1000 +" +> +< +mroot +id += +" +mroot001 +" +> +< +mspace +id += +" +base001 +" +height += +" +6em +" +width += +" +6em +" +style += +" +background +: +blue +" +/ +> +< +mspace +id += +" +index001 +" +height += +" +6em +" +width += +" +6em +" +style += +" +background +: +green +" +/ +> +< +/ +mroot +> +< +/ +math +> +< +/ +p +> +< +hr +/ +> +< +p +> +< +math +style += +" +font +- +family +: +radical +- +kernafterdegreeminus5000 +- +rulethickness1000 +" +> +< +mroot +id += +" +mroot002 +" +> +< +mspace +id += +" +base002 +" +height += +" +3em +" +width += +" +3em +" +style += +" +background +: +blue +" +/ +> +< +mspace +id += +" +index002 +" +height += +" +3em +" +width += +" +3em +" +style += +" +background +: +green +" +/ +> +< +/ +mroot +> +< +/ +math +> +< +/ +p +> +< +/ +body +> +< +/ +html +> diff --git a/testing/web-platform/tests/mathml/tools/radicals.py b/testing/web-platform/tests/mathml/tools/radicals.py index 715f8700045a..f3667616f7d2 100644 --- a/testing/web-platform/tests/mathml/tools/radicals.py +++ b/testing/web-platform/tests/mathml/tools/radicals.py @@ -902,3 +902,112 @@ ( f ) +v1 += +1 +* +mathfont +. +em +v2 += +1 +* +mathfont +. +em +f += +mathfont +. +create +( +" +radical +- +negativekernbeforedegree +% +d +- +rulethickness +% +d +" +% +( +v1 +v2 +) +" +Copyright +( +c +) +2020 +Igalia +S +. +L +. +" +) +createStretchyRadical +( +f +) +f +. +math +. +RadicalDegreeBottomRaisePercent += +0 +f +. +math +. +RadicalDisplayStyleVerticalGap += +0 +f +. +math +. +RadicalExtraAscender += +0 +f +. +math +. +RadicalKernAfterDegree += +0 +f +. +math +. +RadicalKernBeforeDegree += +- +v1 +f +. +math +. +RadicalRuleThickness += +v2 +f +. +math +. +RadicalVerticalGap += +0 +mathfont +. +save +( +f +)