[css-ruby] Tone mark of bopomofo in ruby

Hi,

The current CSS Ruby spec requires UAs to position the tone marks in ruby
annotation properly in the note below "ruby-position: inter-character;" [1]
and I was trying to implement this during the last few days. But it then
makes me wonder whether it is worth to implement this in layout engine.

The first reason made me think about this was the fact told by Bobby that
the tone marks are always positioned in a separate column for vertical
bopomofo in all contexts, not only when they are inside ruby annotation.
Which means, the tone mark positioning is not limited to inter-character
ruby; it also covers ruby and non-ruby text in vertical text. It is
definitely what fonts should handle.

The other potential problem for this is that, it will never be
interoperable until all UAs implement this in the same way. There are a lot
of details need to be considered, for example, what tone marks should be
repositioned? Only trailing ones, or every one? What exactly position the
tone mark should be placed when font or font size vary? It would be hard
for author to detect whether a UA support the tone mark positioning, and
how it is implemented.

In conclusion, I don't think it is a good idea to implement tone mark
positioning in layout engine. It would affect interoperability and
complicate the impls. The positioning should be handled by fonts.

However, we know that no fonts seem to support this currently. They even
display a rotated tone mark in vertical text. For this, I suggest we use
polyfiller to do the positioning. It would be easier to implement this in
JavaScript and DOM, a polyfiller also provides more flexiblilty for authors
to control over the behavior. Once the fonts start supporting this, authors
can simply remove the polyfiller.

The attachment is a simple polyfill demo for tone mark positioning. It
seems to work almost fine with Trident and WebKit (with a little problem
with Gecko, though, because of the incomplete ruby impl)

- Xidorn

[1]: http://dev.w3.org/csswg/css-ruby/#valdef-ruby-position-inter-character

Received on Friday, 16 January 2015 00:39:09 UTC