Description: With the new HarfBuzz common text layout on Windows, glyphs rendered with OpenGL and positioned on the left margin of menu entries are being clipped. The default GDI rendering, and the old GDI or DirectWrite rendering does not affect the glyphs. In the attached screen clip new layout on left old layout on right. OpenGL rendering on top, GDI rendering on bottom. In the top-left clip (of Tools -> Options at 300%) glyphs with round left edge "O" "C" are being clipped/poorly smoothed. The same glyphs away from the edge are nicely aliased. Steps to Reproduce: On Windows 10 Pro 64-bit en-US Open LibreOffice enable new HarfBuzz layout engine (default) enable OpenGL rendering (default) Open Tools -> Option dialog inspect glyphs on the left edge of the menu Actual Results: Glyphs with wide shadowing/smoothing "O" & "C" are clipped when positioned against left margin of menu. Expected Results: Glyphs for "O" and "C" should match the rendering of the same elsewhere in the menu entries. Reproducible: Always User Profile Reset: Yes Additional Info: On Windows 10 Pro 64-bit (1607) en-US with nVidia GTX 750ti 372.70 driver Version: 5.3.0.0.alpha1+ Build ID: 43b5ca69aa545cf93eded55258d92d651917815f CPU Threads: 8; OS Version: Windows 6.2; UI Render: GL; Layout Engine: new; TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2016-11-18_05:27:05 Locale: en-US (en_US); Calc: CL User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0
Created attachment 128849 [details] screen clip of layouts --- OpenGL rendering w HarfBuzz top left
@Khaled, this one sure seems HarfBuzz layout related. Differences between OpenGL rendering on old layout and new layout, and manifests depending on the placement of the glyph for layout.
Not just when positioned on left edge of a menu entry, but the strings "Ctrl+..." for the short-cuts being appended to the menu entries loose the left edge of pixels also with OpenGL rendering and the new layout engine.
Confirmed in Windows 7 with daily build from 2016-11-17_00:29:08.
Created attachment 128890 [details] Screenshot, no clipping I can’t reproduce this, with or without DirectWrite (manually enabling it). I don’t have OpenGL enabled, though.
(In reply to Khaled Hosny from comment #5) > Created attachment 128890 [details] > Screenshot, no clipping > > I can’t reproduce this, with or without DirectWrite (manually enabling it). > I don’t have OpenGL enabled, though. I'd expect that, because as in the clip in comment 1, it is just with our OpenGL with new HarfBuzz layout that we see left alligned glyphs being clipped. And for me on same system running CentOS 7.2 with GTK2 on a VMWare guest--no issues then for leading glyphs with OpenGL rendering enabled. So this is Windows only with new HarfBuzz layout and only with our OpenGL rendering.
*** Bug 104196 has been marked as a duplicate of this bug. ***
Something like this should fix the issue: diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index 19ab9ae..e3366d4 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -3427,6 +3427,11 @@ bool D2DWriteTextOutRenderer::GetDWriteInkBox(SalLayout const &rLayout, Rectangl rOut.Union(b); } + // The clipping rectangle is sometimes overzealous, add an extra pixel to + // remedy this. + if (!rOut.IsEmpty) + rOut.expand(1); + return true; } But since I can’t reproduce, I feel uneasy about applying such a fix a blindly. If someone who is able to reproduce can build with this patch and verify it fixes the issue, I’ll happily push it.
Khaled Hosny, I can't test your patch to see if it fixes this or Bug 104196. Any idea what's causing this? [build CXX] vcl/win/window/salmenu.cxx C:/lode/dev/core/vcl/win/gdi/winlayout.cxx(3431): error C2276: '!': illegal operation on bound member function expression C:/lode/dev/core/solenv/gbuild/LinkTarget.mk:189: recipe for target 'C:/lode/dev/core/workdir/CxxObject/vcl/win/gdi/winlayout.o' failed make[1]: *** [C:/lode/dev/core/workdir/CxxObject/vcl/win/gdi/winlayout.o] Error 2 make[1]: *** Waiting for unfinished jobs.... Makefile:266: recipe for target 'build' failed make: *** [build] Error 2
(In reply to Luke from comment #9) > Khaled Hosny, > I can't test your patch to see if it fixes this or Bug 104196. > > Any idea what's causing this? > > [build CXX] vcl/win/window/salmenu.cxx > C:/lode/dev/core/vcl/win/gdi/winlayout.cxx(3431): error C2276: '!': illegal > operation on bound member function expression > C:/lode/dev/core/solenv/gbuild/LinkTarget.mk:189: recipe for target > 'C:/lode/dev/core/workdir/CxxObject/vcl/win/gdi/winlayout.o' failed > make[1]: *** [C:/lode/dev/core/workdir/CxxObject/vcl/win/gdi/winlayout.o] > Error 2 > make[1]: *** Waiting for unfinished jobs.... > Makefile:266: recipe for target 'build' failed > make: *** [build] Error 2 My bad, should be IsEmpty() not IsEmpty, it is a method not a variable.
Khaled, Your patch fixes the Calc '5' and '7' glyph in Bug 104196. I not sure about the "O" "C" in Tools->Option.
Khaled Hosny committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=ba3e52699bc05911bc1f9e3cbd5d1332902c736a tdf#104013: Band aid for overzealous clipping It will be available in 5.4.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Please test and close if the commit above fixes both issues.
(In reply to Luke from comment #11) > Khaled, > Your patch fixes the Calc '5' and '7' glyph in Bug 104196. I not sure about > the "O" "C" in Tools->Option. Thanks for testing this.
Created attachment 129168 [details] Screenshot before/after patch Does it fix the Option->Tools bug? Seems the same on my system.
Khaled Hosny committed a patch related to this issue. It has been pushed to "libreoffice-5-3": http://cgit.freedesktop.org/libreoffice/core/commit/?id=c7e7a634cf5941fffd97102fe4252aee7445e36b&h=libreoffice-5-3 tdf#104013: Band aid for overzealous clipping It will be available in 5.3.0.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to Luke from comment #15) > Created attachment 129168 [details] > Screenshot before/after patch > > Does it fix the Option->Tools bug? Seems the same on my system. So they weren’t duplicates after all. I guess we should de-duplicate them then, close the other as fixed and leave this one open.
The left edge clipping on menus is gone now, between 2016-12-16 and 2016-12-17 builds. https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=0c565095983b0cc8b96a78012c611b7a03962204..1427817a944f3cf1020b2f06a2ca934847b56ba8