[svgwg] How to lay out ruby-annotations in SVG 2? (#870)

therahedwig has just created a new issue for https://github.com/w3c/svgwg:

== How to lay out ruby-annotations in SVG 2? ==
Hi, we (Krita project) have been looking at the SVG 2 text spec, and there was one thing we were wondering about: Ruby annotations.

So, as quick summary: Ruby annotations consist of small script positioned above CJK characters containing the pronunciation of said character. **It should not be confused with the programming language.** There's [some support for it in HTML](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ruby), and a [w3c spec](https://www.w3.org/TR/css-ruby-1/) that explains it far better than I could.

In theory, we could use the dy and dx positioning of the non-autowrapped text to position text in any way we want. However, [a note](https://www.w3.org/TR/SVG2/text.html#TSpanNotes) in the spec says that these are to be ignored for auto-wrapped/flowed text. Just positioning by itself is also not super-ideal, as it prevents outsiders from understanding that this positioning is happening because it is a Ruby annotation.

There is also an [OpenType way](https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#tag-ruby) of doing it. My problem with this is that it is per-font, and then if certain pronunciations are missing, you'd have to tell someone 'go edit the font', which, licensing issues aside, seems really mean. Like, [this project](https://github.com/ButTaiwan/bpmfvs) seems to be adding Bopomofo to fonts with some programming (and they're literally annotating *every* character). And they're not even using the ruby feature tag, but rather stylistic sets and unicode variation selectors, meaning that the problem is a little bit more complicated than just hardcoding a given annotation for a given character.

So, I've been wondering if someone has an idea of how to approach this?

Please view or discuss this issue at https://github.com/w3c/svgwg/issues/870 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 2 December 2021 16:01:23 UTC