Skip to content

Commit

Permalink
Improve handling of minsize/maxsize (#103)
Browse files Browse the repository at this point in the history
- Make sure the percentages of minsize/maxsize are handled with respect to the unstretched size, as that was the case in MathML 3.
- Make sure minsize/maxsize adjustments preserve symmetry with respect to the math axis.
- Add some notes (non-normative) explaining the symmetric, minsize and maxsize adjustments.
  • Loading branch information
fred-wang committed Apr 3, 2024
1 parent 9b7aaaf commit 5d2bf69
Showing 1 changed file with 39 additions and 18 deletions.
57 changes: 39 additions & 18 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -1827,14 +1827,29 @@ <h4>Layout of operators</h4>
Otherwise set them to
<code>U<sub>ascent</sub></code> and
<code>U<sub>descent</sub></code> respectively.
<div class="note">
The property <code>T<sub>ascent</sub></code><a>AxisHeight</a> = <code>T<sub>descent</sub></code> + <a>AxisHeight</a> means that
an operator stretching exactly
<code>T<sub>ascent</sub></code> above the baseline
and <code>T<sub>descent</sub></code> below the
baseline would actually stretch symmetrically above
and below the <a>math axis</a>.
<code>S<sub>ascent</sub></code> and
<code>S<sub>descent</sub></code> are the minimal
values, that are respectively not less than
<code>U<sub>ascent</sub></code> and
<code>U<sub>descent</sub></code>, which satisfy
this property.
</div>
</li>
<li>
Let <code>minsize</code> and <code>maxsize</code>
be the [=embellished operator/minsize=] and [=embellished operator/maxsize=] properties on the
operator. Percentage values are interpreted relative
to <code>T</code> =
to the height of the glyph for <code>c</code>.
Let <code>T</code> =
<code>T<sub>ascent</sub></code> +
<code>T<sub>descent</sub></code>.
<code>T<sub>descent</sub></code> be the target size.
If <code>minsize</code> &lt; 0 then set <code>minsize</code>
to 0.
If <code>maxsize</code> &lt; <code>minsize</code> then
Expand All @@ -1843,32 +1858,43 @@ <h4>Layout of operators</h4>
<ul>
<li>
If <code>T</code> &le; 0 then set
<code>T<sub>ascent</sub></code> to <code>minsize</code> / 2 and
<code>T<sub>ascent</sub></code> to
<code>minsize</code> / 2 + <a>AxisHeight</a> and
then set <code>T<sub>descent</sub></code>
to <code>minsize</code>
<code>T<sub>ascent</sub></code>.
</li>
<li>
Otherwise, if
0 &lt; <code>T</code> &lt; <code>minsize</code>
then first
multiply
<code>T<sub>ascent</sub></code>
by <code>minsize</code> / <code>T</code>
and then set <code>T<sub>descent</sub></code>
to <code>minsize</code> -
then set <code>T<sub>ascent</sub></code> to
max(0, (<code>T<sub>ascent</sub></code><a>AxisHeight</a>) × <code>minsize</code> / <code>T</code> + <a>AxisHeight</a>) and
<code>T<sub>descent</sub></code>
to <code>minsize</code>
<code>T<sub>ascent</sub></code>.
</li>
<li>
Otherwise, if <code>maxsize</code> &lt; <code>T</code>
then first multiply
<code>T<sub>ascent</sub></code> by
<code>maxsize</code> / <code>T</code> and
then set <code>T<sub>descent</sub></code>
then set <code>T<sub>ascent</sub></code> to
max(0, (<code>T<sub>ascent</sub></code><a>AxisHeight</a>) × <code>maxsize</code> / <code>T</code> + <a>AxisHeight</a>) and
<code>T<sub>descent</sub></code>
to <code>maxsize</code>
<code>T<sub>ascent</sub></code>.
</li>
</ul>
<div class="note">
The default <code>maxsize</code> is value ∞ is
interpreted above as being larger than any other size,
i.e.
<code>minsize ≤ maxsize</code> is always true while
<code>maxsize &lt; minsize</code> and
<code>maxsize &lt; T</code> are always false.
</div>
<div class="note">
This step ensures that the condition <code>minsize</code><code>T</code><code>maxsize</code> holds.
Additionnally, if the target values correspond to symmetric stretching with respect to the <a>math axis</a> then property
<code>T<sub>ascent</sub></code><a>AxisHeight</a> = <code>T<sub>descent</sub></code> + <a>AxisHeight</a> is preserved.
</div>
</li>
<li>
The <a>inline size</a>,
Expand Down Expand Up @@ -1954,11 +1980,6 @@ <h4>Layout of operators</h4>
used for one of the step above, then the <a>italic correction</a>
of the math content is set to the value returned by that algorithm.
</p>
<div class="note">
If <code>maxsize</code> is equal to its default value ∞
then <code>minsize ≤ maxsize</code> is satisfied but
<code>maxsize &lt; T</code> is not.
</div>
</section>
</section>
<section id="space-mspace">
Expand Down

0 comments on commit 5d2bf69

Please sign in to comment.