-
Notifications
You must be signed in to change notification settings - Fork 711
[css-text-4] [text-autospace] Spacing across element boundaries for BiDi content #10803
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
Comments
An example of this would be something like
In visual order it would be
If we insert the spaces before reordering, we get
instead of
I think visual-order separation is the right answer, but I'm not sure how important it is to get it right: it'll feel a bit weird either way since we're not setting apart the whole phrase, only half of it. (The autospace rules currently let symbols attach to both CJK and non-CJK contexts, but in this example it's clearly associated with the non-CJK context.) Curious if i18n has realistic examples. I think the main things we need to ensure are:
|
The CSS Working Group just discussed
The full IRC log of that discussion<TabAtkins> fantasai: so text-autospace inserts spaces between "changes" in a script<TabAtkins> fantasai: if you ahve chinese with a little englihs, there should be some gap around the english otherwise it feels cramped <TabAtkins> fantasai: q is what to do with bidi text <TabAtkins> fantasai: we dont' insert space between chinese text and a *symbol*, only between chinese text and a letter <TabAtkins> fantasai: so if you had a stretch of rtl text, like hebrew that ends with a symbol <TabAtkins> fantasai: and you give it a direction so it all flips <TabAtkins> fantasai: so symbol is on the left, hebrew letters on the right <TabAtkins> fantasai: chinese text before and after <TabAtkins> fantasai: if you insert space before reordering, you'll put it on the left side, which ends up between the chinese text and the symbol, while the hebrew and chinese dont' get a space <TabAtkins> fantasai: so correct answer is to manage the sapce in visual order, after bidi reordering <TabAtkins> fantasai: this is challenging, it interacts with linebreaking in awkward ways. hard to get perfectly right without maybe some backtracking <TabAtkins> fantasai: so i think th e correct answer is visual spacing <TabAtkins> fantasai: for practicual purposes, might tolerate getting it wrong in some complex cases <TabAtkins> florian: do we need to spec the allowance for getting it wrong? <TabAtkins> florian: or jsut spec the right thing and expect people to get it wrong sometimes, but they should still try? <TabAtkins> fantasai: i'm not sure <TabAtkins> fantasai: i think it's important to maek sure we get right - if both sides require spacing, it's done correctly, never get double space on one side <TabAtkins> fantasai: that's minimum bar <TabAtkins> astearns: I think we should specify what we want to see, without allowance, and only do that "getting it wrong is allowed" part if we have to <TabAtkins> fantasai: i think that's reasonable. <TabAtkins> fantasai: if authors are running into problems with certain cases, they can complain, and then we'll know those cases matter. <TabAtkins> astearns: so proposed resolution is we specify that autospacing is done after bidi reordering <TabAtkins> astearns: and you should never double auto-space any side <TabAtkins> fantasai: yeah, that's implied <TabAtkins> florian: do we want to add a note about it being hard? <fantasai> Scribe+ <fantasai> TabAtkins: Useful to acknowledge if something is significantly difficult <fantasai> TabAtkins: Here be dragons, when implementing <TabAtkins> fantasai: i think they'll notice <TabAtkins> astearns: would be good to have at least one example, hopefully we can find a real-world example <TabAtkins> florian: could have a note which is less silly than my earlier phrasing. "CSSWG acknowledge that the interactino of this with line-breaking may be challenging to implement" <TabAtkins> fantasai: or literally say "here be dragons" <fantasai> s/or literally/or, as bkardell suggests, literally/ <TabAtkins> astearns: [restates proposed reoslution] <TabAtkins> RESOLVED: autospacing happens *after* bidi-reordering, and we'll add a complex example to the spec |
Spec says:
We need to calculate such spacing before line-breaking as the extra spaces between relevant elements affect the available space for composing a line. At this point visual re-ordering hasn't occurred and ordering is considered logical (we process text in the order it is stored).
After layout, for actually displaying text, if content requires visual re-ordering due to BiDi content, what should the engine do regarding the extra spaces?
The text was updated successfully, but these errors were encountered: