MantisBT - NetSurf
View Issue Details
0002120NetSurfLayoutpublic2014-05-10 20:382017-10-16 22:40
ReporterAnthony J. Bentley 
Assigned ToMichael Drake 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformPowerPCOSOpenBSDOS Version5.5
Product Version3.1 
Target Version3.7Fixed in Version3.7 
Fixed in CI build #
Reported in CI build #
URL of problem page
Summary0002120: GTK font rendering broken on non-96dpi desktops
DescriptionSpacing between words seems to be incorrect in NetSurf 3.1 on OpenBSD/macppc. I am not sure of the cause. The effect is clear in the attached screenshot.

Not sure where the problem lies. I have only tested on OpenBSD/amd64 and OpenBSD/i386 (where it doesn't happen), and on OpenBSD/macppc (where I see the effect). Have not tested on other OpenBSD platforms. I'm curious if the effect happens on PowerPC machines not running OpenBSD.
TagsNo tags attached.
has duplicate 0002325closed Michael Drake Text overlap each other 
Attached Filespng powerpc.png (81,177) 2014-05-10 20:38
https://bugs.netsurf-browser.org/mantis/file_download.php?file_id=134&type=bug
png

png amd64.png (81,376) 2014-05-10 20:39
https://bugs.netsurf-browser.org/mantis/file_download.php?file_id=135&type=bug
png

png amiga.png (115,763) 2014-05-11 14:27
https://bugs.netsurf-browser.org/mantis/file_download.php?file_id=136&type=bug
png

png amiga_scaled.png (146,697) 2014-05-11 14:27
https://bugs.netsurf-browser.org/mantis/file_download.php?file_id=137&type=bug
png

Notes
(0000326)
Chris Young   
2014-05-11 14:26   
I can answer the question "Does this happen on other PPC platforms?" with a "No" (at least for AmigaOS 4.1).

However, I have noticed the same problem after scaling, which persists to some extent when the scale is reset. I've attached the normal and a scaled in screenshot. I've never investigated whether scaling causes such problems on other platforms.
(0000327)
Chris Young   
2014-05-11 15:02   
I can reproduce this on i386 GTK after playing with the scaling, leaving that as it is and then moving to this page I'm getting some character overlapping here too. Even worse, when typing in the input box the cursor is 2 characters in front of what I'm typing when I get to the right-hand side of the input box, which I guess is related (at the left it lines up correctly).
(0000405)
Michael Drake   
2014-07-17 06:17   
Scaling is a different issue; we currently expect text size to increase linearly with scale, which is wrong for font renderers that try to minimise blurriness by bodging glyph shapes to fit the pixel grid.

I don't know what the original issue is. Check that scale is 1:1, and experiment with the DPI setting.
(0000430)
Anthony J. Bentley   
2014-08-01 00:45   
Happens with scale 1:1 (and other scales). Will try fiddling with the DPI... based on the GTK widgets that definitely differs from my amd64 setup.
(0000433)
kinnison   
2014-08-03 13:21   
This almost looks like the font width calculator is not producing the same width as when we actually render.
(0000446)
Anthony J. Bentley   
2014-08-08 07:01   
(Last edited: 2014-09-06 05:29)
Confirmed to be a DPI problem: the bad screenshot had a DPI of 86 according to xdpyinfo, while the good screenshot had a DPI of 96. Manually setting the dpi to 86 on the "good" machine results in an identical spacing problem.

Looks like PowerPC was a red herring.

(0000475)
Michael Drake   
2014-09-06 12:49   
(Last edited: 2014-09-06 12:50)
11:57 <@tlsa> the problem is:
11:58 <@tlsa> nsfont_paint creates a PangoLayout from the current_cr
11:58 <@tlsa> which only exists durng redraw
11:59 <@tlsa> the font measuring stuff only calls pango_layout_new
11:59 <@tlsa> to get a PangoLayout
11:59 <@tlsa> and that knows nothing about the DPI
12:01 <@tlsa>     context = gdk_pango_context_get();
12:01 <@tlsa>     layout = pango_layout_new(context);
12:01 <@tlsa> that's for measuring
12:01 <@tlsa>     layout = pango_cairo_create_layout(current_cr);
12:01 <@tlsa> that's for painting


(0000476)
Michael Drake   
2014-09-06 12:54   
Updated title, to reflect the bug.
(0001536)
Michael Drake   
2017-04-11 15:41   
Fixed by: http://source.netsurf-browser.org/netsurf.git/commit/?id=90100bbd45be8e3bc45f258a32a24f433cadbd70
(0001668)
Vincent Sanders   
2017-10-16 22:40   
Thankyou for your report, this has been resolved in the 3.7 release

Issue History
2014-05-10 20:38Anthony J. BentleyNew Issue
2014-05-10 20:38Anthony J. BentleyFile Added: powerpc.png
2014-05-10 20:39Anthony J. BentleyFile Added: amd64.png
2014-05-11 14:26Chris YoungNote Added: 0000326
2014-05-11 14:27Chris YoungFile Added: amiga.png
2014-05-11 14:27Chris YoungFile Added: amiga_scaled.png
2014-05-11 15:02Chris YoungNote Added: 0000327
2014-05-11 15:29Vincent SandersStatusnew => confirmed
2014-07-17 06:17Michael DrakeNote Added: 0000405
2014-08-01 00:45Anthony J. BentleyNote Added: 0000430
2014-08-03 13:21kinnisonNote Added: 0000433
2014-08-08 07:01Anthony J. BentleyNote Added: 0000446
2014-08-08 07:03Anthony J. BentleyNote Edited: 0000446bug_revision_view_page.php?bugnote_id=446#r1316
2014-09-06 05:29Anthony J. BentleyNote Edited: 0000446bug_revision_view_page.php?bugnote_id=446#r1327
2014-09-06 12:49Michael DrakeNote Added: 0000475
2014-09-06 12:50Michael DrakeNote Edited: 0000475bug_revision_view_page.php?bugnote_id=475#r1329
2014-09-06 12:54Michael DrakeNote Added: 0000476
2014-09-06 12:54Michael DrakeSummaryStrange in-text spacing on OpenBSD/PowerPC => GTK font rendering broken on non-96dpi desktops
2015-06-20 13:57Michael DrakeRelationship addedhas duplicate 0002325
2017-04-11 15:41Michael DrakeNote Added: 0001536
2017-04-11 15:41Michael DrakeAssigned To => Michael Drake
2017-04-11 15:41Michael DrakeStatusconfirmed => resolved
2017-04-11 15:41Michael DrakeResolutionopen => fixed
2017-04-11 15:41Michael DrakeFixed in Version => 3.7
2017-04-11 15:41Michael DrakeTarget Version => 3.7
2017-10-16 22:40Vincent SandersStatusresolved => closed
2017-10-16 22:40Vincent SandersNote Added: 0001668