@@ -1738,13 +1738,21 @@ <h4>Layout of operators</h4>
1738
1738
< a data-xref-type ="css-property "> color</ a >
1739
1739
of the < code > <mo></ code > element.
1740
1740
</ p >
1741
+ < p >
1742
+ Let < code > dir</ code > be the element's computed
1743
+ < a data-xref-type ="css-property "> direction</ a > .
1744
+ </ p >
1741
1745
< p > Operators are laid out as follows:</ p >
1742
1746
< ol class ="algorithm ">
1743
1747
< li >
1744
1748
If the content of the < code > <mo></ code > element is not
1745
1749
made
1746
1750
of a single character < code > c</ code > then fall back to the
1747
- layout algorithm of < a href ="#layout-of-mtext "> </ a > .
1751
+ layout algorithm of < a href ="#layout-of-mtext "> </ a >
1752
+ and return.
1753
+ Otherwise, let < code > g</ code > be the result of running
1754
+ < a > get a glyph</ a > corresponding to < code > c</ code >
1755
+ with directionality < code > dir</ code > .
1748
1756
</ li >
1749
1757
< li >
1750
1758
If the operator has the [=embellished operator/stretchy=] property:
@@ -1754,11 +1762,10 @@ <h4>Layout of operators</h4>
1754
1762
< ol >
1755
1763
< li >
1756
1764
If it is not possible to < a > shape a stretchy glyph</ a >
1757
- corresponding to < code > c</ code > in the inline direction
1758
- with the
1759
- < a > first available font</ a >
1760
- then fall back to the
1761
- layout algorithm of < a href ="#layout-of-mtext "> </ a > .
1765
+ < code > g</ code > in the inline direction with the
1766
+ < a > first available font</ a > then fall back to the
1767
+ layout algorithm of < a href ="#layout-of-mtext "> </ a >
1768
+ and return.
1762
1769
</ li >
1763
1770
< li >
1764
1771
The < a > min-content inline size</ a > and
@@ -1772,18 +1779,19 @@ <h4>Layout of operators</h4>
1772
1779
< code > T< sub > inline</ sub > </ code >
1773
1780
then
1774
1781
fall back to the
1775
- layout algorithm of < a href ="#layout-of-mtext "> </ a > .
1782
+ layout algorithm of < a href ="#layout-of-mtext "> </ a >
1783
+ and return.
1776
1784
</ li >
1777
1785
< li >
1778
1786
The < a > inline size</ a > and (ink) block metrics of the math content
1779
1787
are given by algorithm to
1780
- < a > shape a stretchy glyph</ a > to < a > inline dimension </ a >
1781
- < code > T< sub > inline</ sub > </ code > .
1788
+ < a > shape a stretchy glyph</ a > < code > g </ code > to
1789
+ < a > inline dimension </ a > < code > T< sub > inline</ sub > </ code > .
1782
1790
</ li >
1783
1791
< li >
1784
1792
The painting of the operator is performed by the
1785
1793
algorithm
1786
- to < a > shape a stretchy glyph</ a >
1794
+ to < a > shape a stretchy glyph</ a > < code > g </ code >
1787
1795
stretched to < a > inline dimension</ a >
1788
1796
< code > T< sub > inline</ sub > </ code > and
1789
1797
at position determined by the previous box metrics.
@@ -1796,11 +1804,10 @@ <h4>Layout of operators</h4>
1796
1804
< ol >
1797
1805
< li >
1798
1806
If it is not possible to < a > shape a stretchy glyph</ a >
1799
- corresponding to < code > c</ code > in the block direction
1800
- with the
1801
- < a > first available font</ a >
1802
- then fall back to the
1803
- layout algorithm of < a href ="#layout-of-mtext "> </ a > .
1807
+ < code > g</ code > in the block direction with the
1808
+ < a > first available font</ a > then fall back to the
1809
+ layout algorithm of < a href ="#layout-of-mtext "> </ a >
1810
+ and return.
1804
1811
</ li >
1805
1812
< li >
1806
1813
The < a > min-content inline size</ a > and
@@ -1815,7 +1822,8 @@ <h4>Layout of operators</h4>
1815
1822
< code > (U< sub > ascent</ sub > , U< sub > descent</ sub > )</ code >
1816
1823
then
1817
1824
fall back to the
1818
- layout algorithm of < a href ="#layout-of-mtext "> </ a > .
1825
+ layout algorithm of < a href ="#layout-of-mtext "> </ a >
1826
+ and return.
1819
1827
</ li >
1820
1828
< li > If the operator has the [=embellished operator/symmetric=] property
1821
1829
then set the target sizes
@@ -1920,7 +1928,7 @@ <h4>Layout of operators</h4>
1920
1928
< a > line-descent</ a >
1921
1929
of the math content
1922
1930
are obtained by the algorithm to
1923
- < a > shape a stretchy glyph</ a >
1931
+ < a > shape a stretchy glyph</ a > < code > g </ code >
1924
1932
to < a > block dimension</ a >
1925
1933
< code > T< sub > ascent</ sub > </ code > +
1926
1934
< code > T< sub > descent</ sub > </ code > .
@@ -1937,7 +1945,7 @@ <h4>Layout of operators</h4>
1937
1945
</ li >
1938
1946
< li >
1939
1947
The painting of the operator is performed by the
1940
- algorithm to < a > shape a stretchy glyph</ a >
1948
+ algorithm to < a > shape a stretchy glyph</ a > < code > g </ code >
1941
1949
stretched to < a > block dimension</ a >
1942
1950
< code > T< sub > ascent</ sub > </ code > +
1943
1951
< code > T< sub > descent</ sub > </ code >
@@ -1962,11 +1970,10 @@ <h4>Layout of operators</h4>
1962
1970
< ol >
1963
1971
< li >
1964
1972
If it is not possible to < a > shape a stretchy glyph</ a >
1965
- corresponding to < code > c</ code > in the block direction
1966
- with the
1967
- < a > first available font</ a >
1968
- then fall back to the
1969
- layout algorithm of < a href ="#layout-of-mtext "> </ a > .
1973
+ < code > g</ code > in the block direction with the
1974
+ < a > first available font</ a > then fall back to the
1975
+ layout algorithm of < a href ="#layout-of-mtext "> </ a >
1976
+ and return.
1970
1977
< div class ="note ">
1971
1978
Here we treat a non-[=embellished operator/stretchy=] [=embellished operator/largeop=]
1972
1979
glyph as stretchy with target dimension < a > DisplayOperatorMinHeight</ a > .
@@ -1986,7 +1993,7 @@ <h4>Layout of operators</h4>
1986
1993
< a > line-descent</ a >
1987
1994
of the math content
1988
1995
are obtained by the algorithm to
1989
- < a > shape a stretchy glyph</ a >
1996
+ < a > shape a stretchy glyph</ a > < code > g </ code >
1990
1997
to < a > block dimension</ a >
1991
1998
< a > DisplayOperatorMinHeight</ a > .
1992
1999
The < a > inline size</ a > of the math content is the width of
@@ -2015,7 +2022,7 @@ <h4>Layout of operators</h4>
2015
2022
</ li >
2016
2023
< li >
2017
2024
The painting of the operator is performed by the
2018
- algorithm to < a > shape a stretchy glyph</ a >
2025
+ algorithm to < a > shape a stretchy glyph</ a > < code > g </ code >
2019
2026
stretched to < a > block dimension</ a >
2020
2027
< a > DisplayOperatorMinHeight</ a >
2021
2028
and at position determined by the previous box metrics
@@ -2878,8 +2885,11 @@ <h5>Radical symbol</h5>
2878
2885
of that element.
2879
2886
</ p >
2880
2887
< p >
2881
- The < dfn > radical glyph</ dfn > is the glyph obtained for the
2882
- character U+221A SQUARE ROOT.
2888
+ Let < code > dir</ code > be the computed < a data-xref-type ="css-property "> direction</ a >
2889
+ of the < code > <msqrt></ code > or < code > <mroot></ code > element.
2890
+ The < dfn > radical glyph</ dfn > is the glyph obtained as a result of running
2891
+ < a > get a glyph</ a > corresponding to the U+221A SQUARE ROOT character
2892
+ given < code > dir</ code > .
2883
2893
</ p >
2884
2894
< p >
2885
2895
The < dfn > radical gap</ dfn > is given by
@@ -2896,8 +2906,8 @@ <h5>Radical symbol</h5>
2896
2906
< p >
2897
2907
The < dfn > box metrics of the radical glyph</ dfn >
2898
2908
and < dfn > painting of the surd</ dfn > are given by the algorithm to
2899
- < a > shape a stretchy glyph</ a > to < a > block dimension </ a > the
2900
- target size for the radical glyph.
2909
+ < a > shape a stretchy glyph</ a > to the
2910
+ target size for the radical glyph in the < a > block dimension </ a > .
2901
2911
</ p >
2902
2912
</ section >
2903
2913
< section >
@@ -5679,6 +5689,52 @@ <h4>Algorithms for glyph stretching</h4>
5679
5689
such as
5680
5690
the one suggested in < a href ="#unicode-based-glyph-assemblies "> </ a > .
5681
5691
</ div >
5692
+ < p >
5693
+ The algorithm to < dfn > get a glyph</ dfn > corresponding to a character < code > c</ code > given a directionality < code > dir</ code >
5694
+ is the following:
5695
+ </ p >
5696
+ < ul class ="algorithm ">
5697
+ < li >
5698
+ Let < code > g</ code > be the glyph corresponding to < code > c</ code > .
5699
+ </ li >
5700
+ < li >
5701
+ If < code > dir</ code > is < code > rtl</ code > :
5702
+ < ul >
5703
+ < li >
5704
+ If there exists an OpenType rtlm variant of
5705
+ < code > g</ code > , then return it. [[OPEN-FONT-FORMAT]]
5706
+ </ li >
5707
+ < li >
5708
+ Otherwise, if < code > c</ code > has the Bidi_Mirrored property [[BIDI]]:
5709
+ < ul >
5710
+ < li >
5711
+ If < code > c</ code > has a corresponding codepoint, < code > c'</ code > ,
5712
+ for which its glyph is typically the mirror image of < code > g</ code > ,
5713
+ then return the glyph corresponding to < code > c'</ code > .
5714
+ </ li >
5715
+ < li >
5716
+ Otherwise, transform < code > g</ code > by scaling it by a factor
5717
+ of -1 horizontally and return the result.
5718
+ < div class ="note ">
5719
+ This exists as a fallback for when a character should be mirrored
5720
+ according to its Bidi_Mirrored property, but no corresponding codepoint
5721
+ or glyph exists.
5722
+ </ div >
5723
+ </ li >
5724
+ </ ul >
5725
+ </ li >
5726
+ < li >
5727
+ Otherwise, return < code > g</ code > .
5728
+ </ li >
5729
+ </ ul >
5730
+ </ li >
5731
+ < li class ="assert ">
5732
+ Assert: < code > dir</ code > is < code > ltr</ code > .
5733
+ </ li >
5734
+ < li >
5735
+ Return < code > g</ code > .
5736
+ </ li >
5737
+ </ ul >
5682
5738
</ section >
5683
5739
</ section >
5684
5740
</ section >
0 commit comments