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
How to lay out ruby-annotations in SVG 2? #870
Comments
The problem with using 'dx' and 'dy' in flowed text is that it moves characters (actually clusters) after they have been positioned by flowing into a shape. The ruby text could be moved with 'dx' and 'dy' above other characters but that would leave holes. |
Oh, wow, I hadn't even realized that... So we need a completely different solution? |
Reading through the ruby css spec, it seems that there might be a solution in using specific values for display on a text-span.
This could look like...
The only thing I am missing here is a way to define There might be more issues with the spec. What I think might be a good next step is to try and make a script that tries to consume tspans with the ruby css values and outputs SVG 1.1 (or non-autowrapped) text, as a prototype. |
Ok, I managed to get parsing of most of the typical cases done: Some problems:
Other notes:
Anyway, please check out the samples and whether they're acceptable. I'll wait with providing feedback to the CSS issue tracker until people have had a chance to think about this here. |
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, and a w3c spec 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 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 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 seems to be adding Bopomofo Ruby 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?
More links
The text was updated successfully, but these errors were encountered: