Skip to content

Fix steps ascent/paint adjustment for stretchy operators #200

Closed

Description

@fred-wang

cc @faceless2

From https://mathml-refresh.github.io/mathml-core/#layout-of-operators

  1. The inline size, ink line-ascent, ink line-descent, line-ascent and line-descent of the content are obtained from the box metrics of a stretchy glyph stretched to block dimension Tascent + Tdescent. The inline size is the stretchy glyph width returned. If Δ = Tascent + Tdescent − (stretchy glyph ascent + stretchy glyph descent) then the ink ascent of the content is Tascent + Δ/2 and the ink descent of the content is Tdescent + Δ/2.

  2. The painting of the operator is performed by the algorithm to shape a stretchy glyph stretched to block dimension T and at position determined by the previous box metrics shifted by Δ/2 towards the line-over.

  3. is not correct, we don't want to shift Tdescent by half the error, but want to ensure the centers align.

Δ = [Tascent - Tdescent − (stretchy glyph ascent - stretchy glyph descent)] / 2

Also it should then be

Tascent - Δ and the ink descent of the content is Tdescent + Δ.

  1. Should become Δ. But it's probably better to modify https://mathml-refresh.github.io/mathml-core/#dfn-shape-a-stretchy-glyph so that the offset refers to the top of the bounding box (I'll open a separate issue for that)

Activity

  1. NSoiffer commented on Mar 23, 2020

    @NSoiffer
    Contributor

    At one of the MathML Core meetings, we discussed the shift amount and agreed that you shouldn't use Δ for both ascent and descent because of rounding problems. I.e, if Tascent - Tdescent − (stretchy glyph ascent - stretchy glyph descent) is odd, then Δ + Δ will be off by one when the spec says " the ink ascent of the content is the ascent of the stretchy glyph − Δ and the ink descent of the content is the descent of the stretchy glyph + Δ."

    I'm also a little concerned that the spec talks about "the center of the target". They should be centered on the math axis. Is centering on math axis baked into this somehow?

    I know this last point is a bit of nit picking, but we should still get this right... step 3 says "If there is not any block stretch size constraint (Tascent, Tdescent)...". If there is not any block stretch size constraint, then (Tascent, Tdescent) is not defined. I think their definition/reference should be in step 4.

  2. fred-wang commented on Mar 23, 2020

    @fred-wang
    Author

    The math axis centering is handled somewhere else. See #202 for the issue.

    About rounding, yes we need to fixup this and probably others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions