-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
largeop ascent/descent when using a vertical glyph assembly #55
Comments
To summarize:
|
Doesn't the quoted section only say that the descent is 0 for a horizontal GlyphAssembly? |
Fred can probably weigh in later, but our current internal branch code follows this algorithm: |
I would need to check again the code & spec, but I think we use ascent/descent for horizontal assembly and align glyphs on their baseline. Probably quoted section is about vertical assembly.... |
Fred can probably weigh in later, but our current internal branch code follows this algorithm: |
Nm my last comment.... |
From the April 6 meeting, three alternatives:
|
@davidcarlisle checked the font table for some font and eventually the OpenType math spec and that rules out the first option above. Still options 2 and 3 seem preferable to using '0', and in any case, |
It seems there is a lot of confusion here. As a reminder: this issue is about largeop where stretchy="false" (in particular symmetric is not involved at all here) AND a glyph assembly is used (i.e. all available glyph variants have size less than DisplayOperatorMinHeight). If a single glyph is used for the largeop OR if stretchy="true" then we already have an ascent/descent, so there is no problem at all, it's already well-specified. Has anyone been able to provide a concrete use case for that since I raised it? I'm not sure there is any real OpenType MATH font in the world that has both a largeop with a glyph assembly but no corresponding glyph variant of height at least DisplayOperatorMinHeight. So I still lean toward the simplest option of choosing 0. |
I think the case is more general than the title implies; the discussions on this issue in the meetings were about the more general case. From the OpenType description quoted when the issue was opened, this is about any glyph, not just large operators. The table almost certainly exists only for stretchy glyphs (not just operators), but non-stretchy ones that don't have a fixed size character potentially could be a problem (although I think we all agree that this is highly unlikely to occur inthe real world). I don't understand why the issue brings DisplayOperatorMinHeight this is problem is far more general than what the OpenType spec says it is meant for. If the glyph is part of an mrow, then the non-stretchy elements will determine the height/depth. If there are no non-stretchy elements, then there is no forced height+depth other than The core spec current says the ascent/descent for the assembly is given by:
Determining the ascent/descent by taking the max of the ascent/decent of the pieces doesn't make sense because the ascent+descent of the resulting glyph would not be its height. Perhaps this is a copy/paste error and it should be the sum of the ascents/depths? What @davidcarlisle found was there is not ascent/decent specified for the assembled pieces, so the piece's ascent/decent can't be used to compute the assembled ascent/decent. I think the current options are:
If |
In MathML Core, this MathVariant table for vertical stretching is only used in two cases: (1) When operator is a vertical stretchy operator. For (1), the spec says that the target ascent/descent is determined from the non-stretchy siblings, minsize, and symmetric properties (layout code). The glyph is stretched to at least the target ascent+descent size (by the low-level font API) and then positioned vertically so that the vertical centers of the target box and actual picked glyph/assembly aligns (by the layout code). For (2), the spec says to that the layout code should tell the low-level code to return a glyph/assembly of at least DisplayOperatorMinHeight. If the result is a single glyph, the layout code also get the ascent/descent and can position it vertically. If it is a glyph assembly, it does not know how to do that. This is what the issue is about.
This is where I was raising the issue for (2) in the initial comment.
From this side comment, I meant to say we don't care about (1) as it's already completely specified. |
This issue is only about non-stretchy displaystyle largeop. The other situation (stretchy) is already completely specified.
Text that is not stretchy or displaystyle largeop is not laid out by this table. Only the latter is incomplete.
displaystyle largeop operators use DisplayOperatorMinHeight as the min target size.
The spec says: "If T = 0 then set Tascent and Tdescent to minsize/2.". This means the glyph will be center with respect to the baseline. We can change if we prefer to make it symmetric with respect to the math axis, for now it's already specified and again that's not what this issue is about.
No, the issue is about non-stretchy displaystyle largeop using a glyph assembly. For stretchy operator with siblings of zero size, target ascent/descent is minsize/2 and minsize/2 so they are aligned with respect to the baseline.
This is what Bruce was mentioning. vertical and horizontal are switched here. I'll fix that.
I'm not sure what you mean here. But the low-level API calculate the stretch size for the assembly, which is used for the ascent while the descent is currently always 0 as I said in the first comment. This is only a problem for largeop since stretchy op are latter vertically positioned by the layout code using target stretch constraints. |
Fixed by c53555c and in the issue description. |
I need to check the status of this... |
From https://docs.microsoft.com/en-us/typography/opentype/spec/math:
"Note that for assemblies growing in the vertical direction, the distribution of height between ascent and descent is not defined. The math-layout engine is responsible for positioning the resulting assembly relative to the baseline."
Per https://mathml-refresh.github.io/mathml-core/#the-glyphassembly-table there are two cases:
(1) "Set B to the advanced width, ascent and descent of the glyph of id MathGlyphVariantRecord.variantGlyph. "
(2) "If there is valid GlyphAssembly subtable then set B to the glyph assembly width, glyph assembly ascent and glyph assembly descent for the target size T." which is itself "If GlyphAssembly is vertical, the width is the maximum advance width of the glyphs of id GlyphPartRecord.glyphID for all the GlyphPartRecord in GlyphAssembly.partRecords, the ascent is the glyph assembly stretch size for a given target size T and the descent is 0."
So in case of a largeop glyph assembly, the descent is always 0. I don't think people care about this case, but just opening to be sure...
(For stretchy glyph assembly the ascent/descent of the mo is later calculated from the non-stretchy siblings)
The text was updated successfully, but these errors were encountered: