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

[css3-fonts][css-text-decor] Decorating superscripts/subscripts

From: fantasai <fantasai.lists@inkedblade.net>
Date: Fri, 10 May 2013 21:15:40 -0700
Message-ID: <518DC5EC.6020701@inkedblade.net>
To: "www-style@w3.org" <www-style@w3.org>
The CSS3 Fonts module offers a 'font-variant-position' property as an
improved substitute for superscripts and subscripts. The goal is, I
hope, that going forward, authors would use this mechanism to produce
"real" superscripts and subscripts, using correctly-adjusted glyphs
from the font rather than manually synthesizing them by means of
'vertical-align' and 'font-size' adjustments.

There's a problem with this however, which is that, since it's now
just done by glyph substitution, the text-decoration code doesn't
know about it, and can't draw underlines, strike-throughs, or
overlines correctly.

To clarify, if we are decorating a span of text that contains
superscripts or subscripts, then the decorations should not be
paying any attention to the superscripting/subscripting.

However, if we are decorating a span of text that *is* the superscript
or subscript (or within it), then the decorations should be adjusted
to match the resulting size and position of the text.

That is, in this example, you really want the first effect, not the
second one:
   data:text/html;charset=utf-8,<!DOCTYPE html>%0D%0A<style>%0D%0A  body { font-size%3A 1.5em%3B }%0D%0A  big { font-size%3A 
130%25%3B }%0D%0A<%2Fstyle>%0D%0A<big>1<%2Fbig><sup style%3D"text-decoration%3A 
underline">st<%2Fsup>%0D%0A%0D%0A<big>2<%2Fbig><span style%3D"border-bottom%3A 1px solid"><sup>st<%2Fsup><%2Fspan>

So, somehow, we need to have a concept of the synthesized text's
size and baseline, and be keying the decorations off of that.

~fantasai
Received on Saturday, 11 May 2013 04:16:07 UTC

This archive was generated by hypermail 2.3.1 : Saturday, 11 May 2013 04:16:08 UTC