-
Notifications
You must be signed in to change notification settings - Fork 17
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
Language and direction metadata #36
Comments
PR #39 includes lang metadata as recommended for string annotations in the link you provided. For 'dir', I'm confident that relying on CSS |
#39 has landed. I think we are covered from the dir/lang side of things. |
In reviewing the above thread, I find the text here, which says:
This is not correct: the bidi algorithm needs help from content authors in order to produce the correct results. I do agree that CSS In addition, runs of text within a paragraph often need to be "spanned" with a direction in order to get the right results. This doesn't appear to be accounted for in I'll also paste a couple of screenshots to exemplify the need for direction in-line. These are using HTML to mark up the text, but you can imagine how Here's the "badly styled" paragraph (no added direction): Here's the fixed version: |
In addition to Addison's comments above, the W3C Internationalization WG found some of the terminologies in the documents here to be inaccurate. What would be the best way to engage you? Would you prefer PRs? Or issues? |
@aphillips thanks so much for the review and your comments. I'm looking forward to making these explainers so much better as a result. Sounds like an example would be good to add to reflect the importance of needing to help the Bidi algorithm as needed, and emphasizing the use of CSS direction (and maybe unicode-bidi properties?) as important components of that. I think the spanning you describe is fully possible with this proposal--i.e., I should be able to translate your above example into the Formatted Text input in roughly the same way (and it should produce the same result, given it's ultimately processed by the same layout/rendering pipeline). I would like to know more about how the "base paragraph direction" is established. In HTML Canvas, for example, when a JavaScript string is rendered to the canvas with fillText() how is this base paragraph direction chosen? Is it inherited into the Canvas from elsewhere in the DOM? For the HTML parser, how does it establish it? Does it ultimately derive from language or network hints. I'm very curious. This seems related to #49 as another default we need to think about. @xfq I would welcome any help you can offer on improving terminologies. PRs will be the fastest ways to suggest the improvements. Looking forward to any help you can provide. |
See
The directionality of an element, as established by HTML, gets mapped to the Wrt specifying direction, btw, I think it would be better to have a
|
I just read the three documents of this incubation experiment. Leveraging the power of the CSS layout engine sounds like a useful way to style text in Canvas.
I wonder if there is a way to associate language and direction metadata with
FormattedText
and/orFormattedTextRun
? See string-meta for more information.The text was updated successfully, but these errors were encountered: