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 125378 - Better underline thickness handling
Better underline thickness handling
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: Small fix
Assigned To: Behdad Esfahbod
pango-maint
AP3
Depends on: 332656
Blocks:
 
 
Reported: 2003-10-24 10:33 UTC by Patrick Wade
Modified: 2006-05-30 05:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The resulting image of the newest pango (59.96 KB, image/png)
2006-05-15 08:34 UTC, LingNing Zhang
  Details
the image of pango-1.6.0 (60.06 KB, image/png)
2006-05-15 08:37 UTC, LingNing Zhang
  Details
fix the bug of underline (5.26 KB, patch)
2006-05-24 09:10 UTC, LingNing Zhang
none Details | Review
My patch (3.43 KB, patch)
2006-05-30 04:25 UTC, Behdad Esfahbod
committed Details | Review

Description Patrick Wade 2003-10-24 10:33:35 UTC
Using a theme 'HighContrastLargePrintInverse' and an application font 'Sans
28' :-

- Launch Yelp.


For users relying on large print theming, it is apparent that the
underlining of text in menus and menuitems is too thin, too indistinct, and
the underline is too close to the bottom of the characters.
Comment 1 Patrick Wade 2003-10-24 10:47:27 UTC
Problem is not confined to just Yelp.
Comment 2 Owen Taylor 2003-10-28 15:50:39 UTC
This is basically all in Pango, though Pango would have
to export the underline thickness as API so 
gdk_draw_pango_layout() would have access to it.

Underline position and thickness probably belongs in
PangoFontMetrics ... some font formats actually have
this information int them
Comment 3 Morten Welinder 2004-03-09 19:28:15 UTC
This goes for overstrike too.

A reasonable approximation would be to have the width be proportional
to the font height.
Comment 4 Owen Taylor 2004-08-31 20:51:42 UTC
This is mostly done in Pango-1.5.x:

int               pango_font_metrics_get_underline_position (PangoFontMetrics
*metrics);
int               pango_font_metrics_get_underline_thickness (PangoFontMetrics
*metrics);
int               pango_font_metrics_get_strikethrough_position
(PangoFontMetrics *metrics);
int               pango_font_metrics_get_strikethrough_thickness
(PangoFontMetrics *metrics);

What's missing is a) drawing the underline wide for Win32 and (in GDK)
for X b) taking the wide underlines into account when computing extents.
Comment 5 Calum Benson 2004-10-21 16:49:52 UTC
Apologies for spam-- ensuring Sun a11y team are cc'ed on all current a11y bugs.
 Filter on "SUN A11Y SPAM" to ignore.
Comment 6 Owen Taylor 2004-11-23 15:54:32 UTC
Drawing underline wide is now done (for Xft, and for Win32 when rendering
via GDK, but not when rendering through the Pango Win2 API directly)
Computing extents isn't yet done.
Comment 7 Owen Taylor 2004-12-13 23:30:46 UTC
Computing extents - underlines should never affect logical extents and
should affect ink extents based on the font metrics.
Comment 8 Calum Benson 2006-04-26 17:15:33 UTC
Apologies for spam... ensuring Sun a11y folks are cc'ed on all current accessibility bugs.
Comment 9 LingNing Zhang 2006-05-15 08:32:38 UTC
I have tested this bug in the newest pango of CVS( > pango-1.13.0).
And I found that this bug was not exist and was fixed.
The resulting images are below:
Comment 10 LingNing Zhang 2006-05-15 08:34:37 UTC
Created attachment 65478 [details]
The resulting image of the newest pango

The resulting image of the newest pango of CVS( > pango-1.13.0).
The underline is OK.
Comment 11 LingNing Zhang 2006-05-15 08:37:10 UTC
Created attachment 65479 [details]
the image of pango-1.6.0

The resulting image of pango-1.6.0
This bug is exist in pango-1.6.0
Comment 12 Behdad Esfahbod 2006-05-15 20:58:39 UTC
The remaining part of this bug is to have underline reflected in ink extents of item, line, layout, ...
Comment 13 LingNing Zhang 2006-05-16 06:51:20 UTC
Need the underline be included in ink extents or be outside of ink extents?
Comment 14 Behdad Esfahbod 2006-05-16 06:55:19 UTC
The ink extents should be extended to include the underline.
Comment 15 LingNing Zhang 2006-05-24 09:10:37 UTC
Created attachment 66114 [details] [review]
fix the bug of underline

I wrote a patch for fixing this bug.
Then the ink extents can include the underline (single, double, low, error).
Comment 16 Behdad Esfahbod 2006-05-30 04:25:44 UTC
Created attachment 66454 [details] [review]
My patch

Patch that I committed.
Comment 17 Behdad Esfahbod 2006-05-30 04:26:05 UTC
2006-05-30  Behdad Esfahbod  <behdad@gnome.org>

        Bug 125378 – Better underline thickness handling

        * pango/pango-layout.c (pango_layout_run_get_extents): Include
        underline in ink extents.

Comment 18 Behdad Esfahbod 2006-05-30 05:04:49 UTC
The only remaining issues is with x extents of error underlines.  Error underlines are draw in an integral number of zigzag parts, so they actually go a bit out of their box, and that's not reflected in ink extents.  Not that it's important, but I don't mind changing the cairo error underline to crop at the boundaries.  Owen, what do you think?