W3C home > Mailing lists > Public > www-style@w3.org > May 2015

[css-ruby] ruby offset affected by font?

From: Shinyu Murakami <murakami@vivliostyle.com>
Date: Wed, 20 May 2015 17:49:38 +0900
To: www-style@w3.org
Message-Id: <20150520174935.51B8.3B6C55AB@vivliostyle.com>
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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:54 UTC