-
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
vertical writing mode support #175
Comments
This is for MathML Core, but I guess the general MathML 4 spec will have to be reworded to take vertical mode into account too. |
Quoting @bgeek:
|
So far, the only vertical real-world use case I found was Mongolian (see mozilla bug above). They use vertical-lr for text and math: https://bug1077525.bmoattachments.org/attachment.cgi?id=8733228 Speaking to people writing CJK text, the reply I get is that in practice they often use horizontal-tb fo text and so a fortiori the same is true for math. For example the Korea SAT exam: https://semosu.com/data/exam/379/ab001.gif However, someone else commented on that the Mozilla bug that even if not used in practice, it should be possible to have vertical MathML. Additionally, the CSS spec ( https://drafts.csswg.org/css-writing-modes-4/#block-flow ) says writing mode should be taken into account for MathML if the UA supports it: "The content of replaced elements do not rotate due to the writing mode: images and external content such as from <iframe>s, for example, remain upright, and the default object size of 300px×150px does not re-orient. However embedded replaced content involving text (such as MathML content or form elements) should match the replaced element’s writing mode and line orientation if the UA supports such a vertical writing mode for the replaced content. " (BTW it seems MathML has been mentioned for a while, @kojiishi is the one who added that 9 years ago) So I would discard option (1). It seems we should definitely support at least option (2) proposed by @bgeek Regarding (3), I don't think there is any use case to mix vertical and horizontal writing mode in math, so I would prefer to forbid this as that can lead to weird edge cases and complicate things. Even the orthogonal flow section of the CSS spec acknowledges this is tricky aspect: https://drafts.csswg.org/css-writing-modes-4/#orthogonal-flows From the above examples, it seems the CSS writing-mode property should be inherited on the I would leave the possibility for people to use a different writing-mode inside foreign markup (in token or annotation-xml elements). I think we could even allow changing the writing-mode on the MathML elements used as integration point, for example the following already works in Gecko, WebKit and Igalia's chromium-mathml:
We still need to rewrite the section for mtext ( #139 ) to specify the bounding box calculation. However, I think for the (ink) line-ascent and line-descent when mtext is in an orthogonal writing mode, it makes sense to say that they are equal to half the inline size of the mtext ± AxisHeight so that middle of the text is aligned with the math axis (middle of the vertical brace, of the fraction bar etc). |
For Japanese, a colleague of mine pointed out to http://blog.cas-ub.com/?p=1233 Apparently http://blog.cas-ub.com/wp-content/uploads/2012/03/5funMath1-u.png is an excerpt from a real book and shows we need to support both horizontal and vertical for the math root. It seems we also have case mixing vertical / horizontal inside formulas like in http://blog.cas-ub.com/wp-content/uploads/2012/03/edonosusiki.png but they seem pretty simple and could be handled by just allowing writing-mode change on token elements as I previously proposed (or alternatively by just using text layout only). |
The spec is now written to not be specific of writing mode. I think we need to:
|
With the huge caveat that I know almost nothing about vertical writing and math, I want to caution about putting a lot of faith in examples people can find, even if they are in a published book. In English, it is not too hard to find examples of terrible math typesetting, even in published books. Sometimes, people/publishers take the easy route based on what their software supports. In some of the examples, they seem self-conflicting. E.g., in http://blog.cas-ub.com/wp-content/uploads/2012/03/edonosusiki.png, ÷ is not rotated, but = is. Is ÷ not rotated because they didn't have a rotated ÷ or is that what is correct? There are other things that seem strange to me in that example: 15 is rotated in (4) but not in (3) and I think that's a rotated square root symbol in (4) but a regular one is used in (7). In http://blog.cas-ub.com/?p=1233, the math in the first block is always enclosed in a box, but shorter examples are horizontal and bigger ones rotated 90 degrees clockwise (in a td-rtl context, are they mirrored?). I think we need someone who knows math in some of these Asian scripts to give us some help and tell us what is good typographic practice and what isn't. It could be that software support has been so bad for so long that an "anything goes" approach is accepted practice. |
Not a math expert but as one of Asian typography experts:
|
Given the latest comments, my proposal is
Note that some MathML elements can contain foreign markup e.g.
so it would still be possible to have orthogonal flow inside MathML. However, the layout of such element defer to other CSS box layout so we don't need to define that case. |
The orientation of objects and flow are different things, and People here are defining the full layout algorithm, correct? Then the algorithm should ignore |
@kojiishi: Thanks, as I commented on the other channel I'm leaning toward postponing this now until we have a clearer understanding. Relying on writing-mode is easier to get something working "for free" when working with LayoutNG / CSS layout API. However, it's true that relying on flow might be wrong. For example with tables:
I'm not sure the layout of matrice rows in Mongolian math should follow the flow direction or just be the "rotated by 90°" rule. Similarly, if we ever implement linebreaking in Mongolian math (something like "if x > 0 and y < 0"), should we follow the flow direction or the "rotated by 90°" rule? If at the end the right thing is to introduce a new CSS property and implement things without relying on existing LayoutNG / CSS layout API, I suspect it's going to be more spec/test/implementation work. So I'd prefer not to deal with it for now. So to address the original request (interop concern), I would for now force horizontal-tb in MathML (as firefox currently does). And keep existing "Issue" label and tentative WPT tests for the vertical case, until things are clarified. |
…o .tentative.html for now., a=testonly Automatic update from web-platform-tests MathML: Move tests for vertical math into .tentative.html for now. (#18253) https://github.com/mathml-refresh/mathml/issues/18 -- wpt-commits: 8da4c04051c2e456398448b9a5b758c666688474 wpt-pr: 18253
…o .tentative.html for now., a=testonly Automatic update from web-platform-tests MathML: Move tests for vertical math into .tentative.html for now. (#18253) https://github.com/mathml-refresh/mathml/issues/18 -- wpt-commits: 8da4c04051c2e456398448b9a5b758c666688474 wpt-pr: 18253
…how that feature will be implemented at the end. https://github.com/mathml-refresh/mathml/issues/18
…how that feature will be implemented at the end. (#18748) https://github.com/mathml-refresh/mathml/issues/18
…for now since it's not clear …, a=testonly Automatic update from web-platform-tests Remove tentative test for vertical math for now since it's not clear how that feature will be implemented at the end. (#18748) https://github.com/mathml-refresh/mathml/issues/18 -- wpt-commits: d0b506880be16b818d9f6721eb3eb862b404f9fb wpt-pr: 18748
…for now since it's not clear …, a=testonly Automatic update from web-platform-tests Remove tentative test for vertical math for now since it's not clear how that feature will be implemented at the end. (#18748) https://github.com/mathml-refresh/mathml/issues/18 -- wpt-commits: d0b506880be16b818d9f6721eb3eb862b404f9fb wpt-pr: 18748
…o .tentative.html for now., a=testonly Automatic update from web-platform-tests MathML: Move tests for vertical math into .tentative.html for now. (#18253) https://github.com/mathml-refresh/mathml/issues/18 -- wpt-commits: 8da4c04051c2e456398448b9a5b758c666688474 wpt-pr: 18253 UltraBlame original commit: 0b23e5302fce2092217a9b8662a3eaa0fe7979c3
…for now since it's not clear …, a=testonly Automatic update from web-platform-tests Remove tentative test for vertical math for now since it's not clear how that feature will be implemented at the end. (#18748) https://github.com/mathml-refresh/mathml/issues/18 -- wpt-commits: d0b506880be16b818d9f6721eb3eb862b404f9fb wpt-pr: 18748 UltraBlame original commit: 918e781c1d6a73fc90057a367bd61e3a62e34e1a
…o .tentative.html for now., a=testonly Automatic update from web-platform-tests MathML: Move tests for vertical math into .tentative.html for now. (#18253) https://github.com/mathml-refresh/mathml/issues/18 -- wpt-commits: 8da4c04051c2e456398448b9a5b758c666688474 wpt-pr: 18253 UltraBlame original commit: 0b23e5302fce2092217a9b8662a3eaa0fe7979c3
…o .tentative.html for now., a=testonly Automatic update from web-platform-tests MathML: Move tests for vertical math into .tentative.html for now. (#18253) https://github.com/mathml-refresh/mathml/issues/18 -- wpt-commits: 8da4c04051c2e456398448b9a5b758c666688474 wpt-pr: 18253 UltraBlame original commit: 0b23e5302fce2092217a9b8662a3eaa0fe7979c3
…for now since it's not clear …, a=testonly Automatic update from web-platform-tests Remove tentative test for vertical math for now since it's not clear how that feature will be implemented at the end. (#18748) https://github.com/mathml-refresh/mathml/issues/18 -- wpt-commits: d0b506880be16b818d9f6721eb3eb862b404f9fb wpt-pr: 18748 UltraBlame original commit: 918e781c1d6a73fc90057a367bd61e3a62e34e1a
…for now since it's not clear …, a=testonly Automatic update from web-platform-tests Remove tentative test for vertical math for now since it's not clear how that feature will be implemented at the end. (#18748) https://github.com/mathml-refresh/mathml/issues/18 -- wpt-commits: d0b506880be16b818d9f6721eb3eb862b404f9fb wpt-pr: 18748 UltraBlame original commit: 918e781c1d6a73fc90057a367bd61e3a62e34e1a
It will only be necessary when/if we support different writing modes in https://github.com/mathml-refresh/mathml/issues/18 but it's safe to add it to the UA sheet. closes w3c/mathml#35
consensus from 2020/06/23: postpone to a future version |
@davidcarlisle Can this be imported moved to the MathML Core repo? Currently, Chromium forces horizontal-tb in the style adjuster, but that does not work well with logical properties ( see https://phabricator.services.mozilla.com/D48279 ), so let's add a universal rule. |
@fred-wang moved |
See https://bugzilla.mozilla.org/show_bug.cgi?id=1077525 and https://bugs.webkit.org/show_bug.cgi?id=48951
Original report: https://gitlab.com/mathml/MathMLinHTML5/issues/21
The text was updated successfully, but these errors were encountered: