Re: [svgwg] Text with multiple x="" values should be shaped as if it was not broken (#631)

The SVG Working Group just discussed `Text i18n issues`.

<details><summary>The full IRC log of that discussion</summary>
&lt;heycam> Topic: Text i18n issues<br>
&lt;heycam> AmeliaBR: if you're using SVG attributes to lay out individual characters, many browsers create the effect that these are the isolated character forms, which are not useful if tweaking individual characters in a word<br>
&lt;emilio> ScribeNick: emilio<br>
&lt;r12a> q+<br>
&lt;emilio> AmeliaBR: resolution was that the desired behavior is that if you have a text element the shaping of the letter forms should behave as if it was a paragraphs or text even if you tweak the character positions with svg<br>
&lt;emilio> ... so for actually rendering it you need to actually do some tweaks<br>
&lt;emilio> ... most text rendering you do it by a zwj on the other side of the shaper<br>
&lt;emilio> myles: that's not quite how it works but what you describe is ok<br>
&lt;emilio> heycam: what gecko does and I wrote in the spec is that each &lt;text> is a &lt;div> and the &lt;textSpan> are &lt;span> is shaped as if a &lt;div><br>
&lt;emilio> s/textspan/tspan<br>
&lt;emilio> ... then you lay them out, and all the positioning stuff is applied to individual grapheme clusters<br>
&lt;emilio> ... we only apply the positioning it is the first dom character of a grapheme cluster<br>
&lt;emilio> addison: so you're positioning the grapheme clusters individually right?<br>
&lt;emilio> myles: after shaping<br>
&lt;emilio> heycam: yes<br>
&lt;emilio> AmeliaBR: so you can separate the clusters into the screen after shaping?<br>
&lt;emilio> myles: yes<br>
&lt;emilio> AmeliaBR: so for impls that don't do that and pretend that the different chunks are independent<br>
&lt;emilio> q?<br>
&lt;emilio> ack r12a<br>
&lt;emilio> r12a: today I asked 3 iranian people and 2 arabic speakers what to do here<br>
&lt;emilio> ... [whiteboard time]<br>
&lt;emilio> ... I asked whether they would ever put a joint word aligning each of them vertically differently<br>
&lt;emilio> ... and their answer was yes<br>
&lt;emilio> ... but that they would show up in isolated form, not joint<br>
&lt;emilio> ... that's the opposite of what behnam (?) said<br>
&lt;emilio> ... because that's what you'd do in crosswords and games<br>
&lt;emilio> ... one of the iranian people referred me to a persian professor in iran<br>
&lt;emilio> myles: are you confident enough on this data or should we wait more<br>
&lt;emilio> r12a: the people I spoke with seemed pretty confident<br>
&lt;emilio> addison: does this also position multi-character segments?<br>
&lt;emilio> AmeliaBR: yes, you can do that<br>
&lt;emilio> nmccully: when they're joint in arabic you stretch when you go in the inline direction<br>
&lt;emilio> ... but it seems you're confident that if you move them vertically you shape them separately?<br>
&lt;emilio> ... anyhow there is a place for automatic place shaping<br>
&lt;emilio> r12a: this is like letter-spacing if you only do it at the horizontal boundary so that may be appropriate<br>
&lt;emilio> AmeliaBR: it puts the same spacing between every glyph pair but not for stuff in between<br>
&lt;emilio> r12a: so I didn't ask for this use case...<br>
&lt;emilio> heycam: my feeling is that this feature is poorly thought-out<br>
&lt;emilio> ... and I was introduced into svg because you could do the same on postcript<br>
&lt;emilio> ... where it is simple because that works on glyph<br>
&lt;emilio> ... so when I thought about it and wrote the spec I tried to do the simple thing that did some amount of sense<br>
&lt;emilio> ... so the question is is this feature as specified sufficient for the use cases?<br>
&lt;emilio> r12a: it'd depend on the authors in the end<br>
&lt;emilio> AmeliaBR: sounds like what we need is some sort of property to toggle "use isolated forms vs. connected forms"<br>
&lt;emilio> r12a: even with the joining forms if you tear them apart enough without a proper kashida you're going to get gaps which is undesirable<br>
&lt;emilio> heycam: so there's no existing css feature for that<br>
&lt;emilio> ... even required ligature<br>
&lt;emilio> AmeliaBR: you can't turn of required ligatures<br>
&lt;emilio> addison: you could use zws or something<br>
&lt;emilio> r12a: and you may need to do it even in actual cases like the ?? and the 5, where you use a joining form even at the end of the sentence<br>
&lt;emilio> myles: so we have two use cases, one is for kerning between letters for which we don't want the isolated form, another is for crossword like stuff for which we do<br>
&lt;emilio> ... I don't think people are doing this right now<br>
&lt;emilio> ... so we could advocate for new content to use different &lt;text> elements<br>
&lt;emilio> addison: then they'd draw as isolated regardless of vertical spacing<br>
&lt;emilio> AmeliaBR: a11y would read them as separate letters...<br>
&lt;emilio> myles: that's what you want for the crossword stuff<br>
&lt;emilio> r12a: given the current state I don't think we have a clear answer<br>
&lt;emilio> ... for the case of vertical differences what I'm hearing we should use isolated forms<br>
&lt;emilio> ... except behnam which says the opposite<br>
&lt;emilio> myles: So if I have &lt;text> with 5 chars and x="1 2 3"<br>
&lt;emilio> ... the proposal would be that for the character that have specific x position (the first three)<br>
&lt;emilio> ... you'd have isolated forms<br>
&lt;emilio> ... the rest would join<br>
&lt;emilio> heycam: my concern implementation wise is that now I need to resolve the positions before shaping<br>
&lt;emilio> ... and tell the shaper whether to use isolated form which would not be very easy<br>
&lt;emilio> ... I wonder if there's context other than svg where you want to get the isolated forms<br>
&lt;emilio> ... so you can add a css property or something<br>
&lt;emilio> ... and the author could opt-into it<br>
&lt;emilio> AmeliaBR: that'd be my preference<br>
&lt;emilio> ... but I don't know if there's enough use cases to get implementors on board<br>
&lt;emilio> r12a: I don't see the use case for such a property for horizontal text<br>
&lt;emilio> ... for vertical text... it depends<br>
&lt;emilio> ... for arabic layout requirements there's behdam's example about first letter, but there's people I've talked with which have never seen that (not clear if due to technology limitations)<br>
&lt;emilio> AmeliaBR: so are we likely to get any resolution? If not? more feedback and from who?<br>
&lt;emilio> r12a: yes<br>
&lt;emilio> addison: this is something we'd want to continue to study<br>
&lt;emilio> ... there's more people we need to ask<br>
&lt;emilio> krit: so unspecified for svg2 until we have a solution for it?<br>
&lt;emilio> AmeliaBR: I think we should try to make the edits<br>
&lt;emilio> myles: for what?<br>
&lt;emilio> r12a: this works fine for latin so maybe drop a note that it may misbehave in arabic?<br>
&lt;emilio> AmeliaBR: it may also be a problem with cursive latin fonts<br>
&lt;emilio> ... where it's not clear if the context remains there<br>
&lt;emilio> heycam: you can control it with opentype features<br>
&lt;emilio> AmeliaBR: for non-required ligatures you can turn it off<br>
&lt;emilio> heycam: I think we should add a "beware" note to the spec for arabic<br>
&lt;emilio> r12a: more than one<br>
&lt;emilio> (more than one script)<br>
&lt;emilio> myles: they should talk to us if they have use cases<br>
&lt;emilio> ... another option is to say that this only works in some languages<br>
&lt;emilio> heycam: so letter-spacing does cause isolated forms to be used?<br>
&lt;emilio> AmeliaBR: I don't think it affects glyph selection<br>
&lt;emilio> r12a: csswg also throws up their hands up abut how that should work<br>
&lt;AmeliaBR> CSS advice on letter-spacing and cursive scripts: https://drafts.csswg.org/css-text-3/#cursive-tracking<br>
&lt;emilio> ... you usually don't do same spacing for all glyphs<br>
&lt;emilio> ... use-cases are justifications<br>
&lt;emilio> [side conversations about how to justify text in svg]<br>
&lt;emilio> github: https://github.com/w3c/svgwg/issues/631<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/631#issuecomment-532990014 using your GitHub account

Received on Thursday, 19 September 2019 06:39:45 UTC