After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 708780 - <sup>/<sub> should use font-size-relative vertical displacement
<sup>/<sub> should use font-size-relative vertical displacement
Status: RESOLVED OBSOLETE
Product: pango
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
: 519146 (view as bug list)
Depends on: 708778
Blocks:
 
 
Reported: 2013-09-25 19:18 UTC by Carl Worth
Modified: 2018-05-22 13:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example program showing too-small rise with a large font (1.24 KB, text/x-csrc)
2013-09-25 19:18 UTC, Carl Worth
Details
Output from example program (7.45 KB, image/png)
2013-09-25 19:20 UTC, Carl Worth
Details

Description Carl Worth 2013-09-25 19:18:51 UTC
Created attachment 255717 [details]
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.
Comment 1 Carl Worth 2013-09-25 19:20:55 UTC
Created attachment 255718 [details]
Output from example program

This is the output from the pango-sup-bug.c program previously attached.

It shows that the result of the <sup> tag looks nothing like a superscript
when used with a large font size, (the rise value is extremely small).
Comment 2 Behdad Esfahbod 2013-09-25 19:51:34 UTC
*** Bug 519146 has been marked as a duplicate of this bug. ***
Comment 3 Behdad Esfahbod 2013-09-29 20:28:40 UTC
Owen, any idea how to address this?
Comment 4 Owen Taylor 2013-10-02 13:42:08 UTC
PANGO_ATTR_RELATIVE_RISE in comment #1 was an idea that I suggested to Carl on IRC - I don't think it's possible without a new attribute handled in the Pango core, since the pango-markup doesn't always know the base font size.
Comment 5 GNOME Infrastructure Team 2018-05-22 13:10:42 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pango/issues/224.