<sup>/<sub> should use font-size-relative vertical displacement
Submitted by Carl Worth
Link to original bug (#708780)
Description
Created attachment 255717 Example program showing too-small rise with a large font
Current pango uses an absolute vertical displacement to implement the
<sup>
and <sub>
tags in pango markup, (such as rise="5000" for
<sup). This value is only close to correct for a limited range of font
sizes. For very small fonts, the superscript glyphs will be displaced
too far, and for large font sizes, the displacement will be far too
small.
If there were a new attribute available, such as PANGO_ATTR_RELATIVE_RISE,
then it would be straightforward to use that for <sup>
/<sub>
.
There seems to be some consensus around using 33% for the displacement in cases like this, though some software uses smaller values:
http://en.wikipedia.org/wiki/Subscript_and_superscript#Desktop_publishing
Of course, that page also demonstrates that a single relative value is not correct in all cases, (a suffix such as "th" should have a rise that's smaller than a numerical exponent, for example). So allowing for things like rise="25%" would also give the user some good flexibility to control this.
Attachment 255717, "Example program showing too-small rise with a large font":
pango-sup-bug.c