[css-ruby] ruby offset affected by font?

Hi,
I believe the offset between the ruby base characters and the ruby annotation characters (between each em-box) should be zero in normal cases.
However I found this offset is affected by font in current browser implementations.

Sample HTML:
https://www.dropbox.com/s/z26h0shnqnpesyu/ruby-fonts.html?dl=0

The result on Windows Chrome/Firefox/IE:
https://www.dropbox.com/s/zui39af3leq5itr/win-chrome-firefox-ie.png?dl=0

A = MS Mincho
B = Meiryo
C = Yu Mincho
D = IPAMincho
E = Arial Unicode MS

MS Mincho and IPAMincho results are good, but other fonts cause big gap between ruby base and ruby annotation.

I guess this gap is caused by the TypoLineGap [1] value of the font metrics.
MS Mincho and IPAMincho's TypoLineGap value is 0 and Meiryo's is 1024 (1/2 of unitsPerEm 2048).

This value is "to compute a typographically correct default line spacing" [1] and should not used for ruby positioning.

I think this is a browser implementation's problem, but it may be necessary to clarify this in CSS Ruby spec.

[1] https://www.microsoft.com/typography/otspec/os2.htm#tlg


--
Shinyu Murakami (ζ‘δΈŠ ηœŸι›„)
CEO & Founder, Vivliostyle Inc.
http://vivliostyle.com
murakami@vivliostyle.com

Received on Wednesday, 20 May 2015 08:50:23 UTC