GNOME Bugzilla – Bug 125378
Better underline thickness handling
Last modified: 2006-05-30 05:04:49 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.
Problem is not confined to just Yelp.
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
This goes for overstrike too. A reasonable approximation would be to have the width be proportional to the font height.
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.
Apologies for spam-- ensuring Sun a11y team are cc'ed on all current a11y bugs. Filter on "SUN A11Y SPAM" to ignore.
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.
Computing extents - underlines should never affect logical extents and should affect ink extents based on the font metrics.
Apologies for spam... ensuring Sun a11y folks are cc'ed on all current accessibility bugs.
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:
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.
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
The remaining part of this bug is to have underline reflected in ink extents of item, line, layout, ...
Need the underline be included in ink extents or be outside of ink extents?
The ink extents should be extended to include the underline.
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).
Created attachment 66454 [details] [review] My patch Patch that I committed.
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.
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?