@@ -1738,13 +1738,23 @@ <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
1751
layout algorithm of < a href ="#layout-of-mtext "> </ a > .
1752
+ If it is not possible to < a > get a glyph</ a > corresponding to
1753
+ < code > c</ code > given directionality < code > dir</ code > , then
1754
+ fall back to the layout algorithm of < a href ="#layout-of-mtext "> </ a > .
1755
+ Otherwise, let < code > g</ code > be the result of running
1756
+ < a > get a glyph</ a > corresponding to < code > c</ code >
1757
+ given directionality < code > dir</ code > .
1748
1758
</ li >
1749
1759
< li >
1750
1760
If the operator has the [=embellished operator/stretchy=] property:
@@ -1754,10 +1764,8 @@ <h4>Layout of operators</h4>
1754
1764
< ol >
1755
1765
< li >
1756
1766
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
1767
+ < code > g</ code > in the inline direction with the
1768
+ < a > first available font</ a > then fall back to the
1761
1769
layout algorithm of < a href ="#layout-of-mtext "> </ a > .
1762
1770
</ li >
1763
1771
< li >
@@ -1777,13 +1785,13 @@ <h4>Layout of operators</h4>
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,10 +1804,8 @@ <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
1807
+ < code > g</ code > in the block direction with the
1808
+ < a > first available font</ a > then fall back to the
1803
1809
layout algorithm of < a href ="#layout-of-mtext "> </ a > .
1804
1810
</ li >
1805
1811
< li >
@@ -1862,7 +1868,7 @@ <h4>Layout of operators</h4>
1862
1868
Let < code > minsize</ code > and < code > maxsize</ code >
1863
1869
be the [=embellished operator/minsize=] and [=embellished operator/maxsize=] properties on the
1864
1870
operator. Percentage values are interpreted relative
1865
- to the height of the glyph for < code > c </ code > .
1871
+ to the height of < code > g </ code > .
1866
1872
Let < code > T</ code > =
1867
1873
< code > T< sub > ascent</ sub > </ code > +
1868
1874
< code > T< sub > descent</ sub > </ code > be the target size.
@@ -1920,7 +1926,7 @@ <h4>Layout of operators</h4>
1920
1926
< a > line-descent</ a >
1921
1927
of the math content
1922
1928
are obtained by the algorithm to
1923
- < a > shape a stretchy glyph</ a >
1929
+ < a > shape a stretchy glyph</ a > < code > g </ code >
1924
1930
to < a > block dimension</ a >
1925
1931
< code > T< sub > ascent</ sub > </ code > +
1926
1932
< code > T< sub > descent</ sub > </ code > .
@@ -1937,7 +1943,7 @@ <h4>Layout of operators</h4>
1937
1943
</ li >
1938
1944
< li >
1939
1945
The painting of the operator is performed by the
1940
- algorithm to < a > shape a stretchy glyph</ a >
1946
+ algorithm to < a > shape a stretchy glyph</ a > < code > g </ code >
1941
1947
stretched to < a > block dimension</ a >
1942
1948
< code > T< sub > ascent</ sub > </ code > +
1943
1949
< code > T< sub > descent</ sub > </ code >
@@ -1962,10 +1968,8 @@ <h4>Layout of operators</h4>
1962
1968
< ol >
1963
1969
< li >
1964
1970
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
1971
+ < code > g</ code > in the block direction with the
1972
+ < a > first available font</ a > then fall back to the
1969
1973
layout algorithm of < a href ="#layout-of-mtext "> </ a > .
1970
1974
< div class ="note ">
1971
1975
Here we treat a non-[=embellished operator/stretchy=] [=embellished operator/largeop=]
@@ -1986,7 +1990,7 @@ <h4>Layout of operators</h4>
1986
1990
< a > line-descent</ a >
1987
1991
of the math content
1988
1992
are obtained by the algorithm to
1989
- < a > shape a stretchy glyph</ a >
1993
+ < a > shape a stretchy glyph</ a > < code > g </ code >
1990
1994
to < a > block dimension</ a >
1991
1995
< a > DisplayOperatorMinHeight</ a > .
1992
1996
The < a > inline size</ a > of the math content is the width of
@@ -2015,7 +2019,7 @@ <h4>Layout of operators</h4>
2015
2019
</ li >
2016
2020
< li >
2017
2021
The painting of the operator is performed by the
2018
- algorithm to < a > shape a stretchy glyph</ a >
2022
+ algorithm to < a > shape a stretchy glyph</ a > < code > g </ code >
2019
2023
stretched to < a > block dimension</ a >
2020
2024
< a > DisplayOperatorMinHeight</ a >
2021
2025
and at position determined by the previous box metrics
@@ -2878,8 +2882,11 @@ <h5>Radical symbol</h5>
2878
2882
of that element.
2879
2883
</ p >
2880
2884
< p >
2881
- The < dfn > radical glyph</ dfn > is the glyph obtained for the
2882
- character U+221A SQUARE ROOT.
2885
+ Let < code > dir</ code > be the computed < a data-xref-type ="css-property "> direction</ a >
2886
+ of the < code > <msqrt></ code > or < code > <mroot></ code > element.
2887
+ The < dfn > radical glyph</ dfn > is the glyph obtained as a result of running
2888
+ < a > get a glyph</ a > corresponding to the U+221A SQUARE ROOT character
2889
+ given < code > dir</ code > .
2883
2890
</ p >
2884
2891
< p >
2885
2892
The < dfn > radical gap</ dfn > is given by
@@ -2896,8 +2903,8 @@ <h5>Radical symbol</h5>
2896
2903
< p >
2897
2904
The < dfn > box metrics of the radical glyph</ dfn >
2898
2905
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.
2906
+ < a > shape a stretchy glyph</ a > to the
2907
+ target size for the radical glyph in the < a > block dimension </ a > .
2901
2908
</ p >
2902
2909
</ section >
2903
2910
< section >
@@ -5679,6 +5686,55 @@ <h4>Algorithms for glyph stretching</h4>
5679
5686
such as
5680
5687
the one suggested in < a href ="#unicode-based-glyph-assemblies "> </ a > .
5681
5688
</ div >
5689
+ < p >
5690
+ The algorithm to < dfn > get a glyph</ dfn > corresponding to a character < code > c</ code > given a directionality < code > dir</ code >
5691
+ is the following:
5692
+ </ p >
5693
+ < ul class ="algorithm ">
5694
+ < li >
5695
+ Let < code > g</ code > be the glyph corresponding to < code > c</ code >
5696
+ in the < a > first available font</ a > .
5697
+ If it is not possible to find such a glyph, then exit with failure.
5698
+ </ li >
5699
+ < li >
5700
+ If < code > dir</ code > is < code > rtl</ code > :
5701
+ < ul >
5702
+ < li >
5703
+ If there exists an OpenType rtlm variant of
5704
+ < code > g</ code > in the < a > first available font</ a > ,
5705
+ then return it and exit with success. [[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 mirrored codepoint,
5712
+ < code > c'</ code > , then return the glyph corresponding
5713
+ to < code > c'</ code > and exit with success.
5714
+ If it is not possible to find such a glyph, then exit with failure.
5715
+ </ li >
5716
+ < li >
5717
+ Otherwise, exit with failure.
5718
+ </ li >
5719
+ </ ul >
5720
+ < div class ="note ">
5721
+ These failure cases are for when a character should be mirrored
5722
+ according to its Bidi_Mirrored property, but no corresponding codepoint
5723
+ or glyph exists.
5724
+ </ div >
5725
+ </ li >
5726
+ < li >
5727
+ Otherwise, return < code > g</ code > and exit with success.
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 > and exit with success.
5736
+ </ li >
5737
+ </ ul >
5682
5738
</ section >
5683
5739
</ section >
5684
5740
</ section >
0 commit comments