W3C home > Mailing lists > Public > www-style@w3.org > December 2010

[CSS3-text] pixel positioning of underline (was text-underline-position and superscript

From: Koji Ishii <kojiishi@gluesoft.co.jp>
Date: Sun, 26 Dec 2010 06:23:44 -0500
To: Ambrose LI <ambrose.li@gmail.com>, "Belov, Charles" <Charles.Belov@sfmta.com>
CC: "www-style@w3.org" <www-style@w3.org>
Message-ID: <A592E245B36A8949BDB0A302B375FB4E0AA8B1C04F@MAILR001.mail.lan>
Since you raised yet another topic, I'm separating the thread.

> The underlines are often, if not always, too close to the baseline,
> causing the underline to intersect with the Chinese characters.
> So "pixel positioning" would be a good idea since
> it would be a way to correct this typographical error.

The issue you're talking about is because most CJK fonts have wrong information for the underline position, and browsers use that information (I suppose). 10 years ago, I investigated several Japanese fonts and none of them had correct information. Today, I can see some recent Japanese fonts have good information in 'post' header. One thing you could do in long term is to talk to font vendors and let them fix it. You will get the correct underline automatically then.

If recent Chinese fonts are still wrong, next thing you could do is to talk to browser vendors and let them implement a hack--that is, not to trust the font information and use hard-coded value for CJK fonts. It works in most cases because CJK fonts do not need to change underline position as often as Latin fonts does. It's a hack, most browser vendors might hate it though.

The last resolution for you is to use text-underline-position:under[1]. This is already spec'ed, so you will be able to use it when the spec goes to CR or REC and browsers support it.

[1] http://dev.w3.org/csswg/css3-text/#text-underline-position


Regards,
Koji
Received on Sunday, 26 December 2010 11:27:07 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:35 GMT