[Libreoffice-commits] core.git: vcl/win

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 23 08:26:52 UTC 2019


 vcl/win/gdi/winlayout.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4657335fa5bcbe7980f229ca41ddd82d93c355eb
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Apr 18 18:03:36 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Apr 23 10:26:16 2019 +0200

    tdf#113076 vcl windows opengl: specific italic set font was clipped on ...
    
    ... right edge in presentation mode.
    
    This seems to be a problem since commit
    a51b7a1c3a7e7cf7b0c733e1dec40288278c1884 (tdf#103831, tdf#100986: Force
    using GDI when needed, 2017-03-03), which blacklisted DirectWrite in the
    OpenGL case for both vertical text and horizontally stretched text.
    
    I tested that the overlapping characters problem from tdf#103831 is not
    re-introduced, and switching to DW (in the horizontal stretching &&
    OpenGL case) fixes the unwanted clipping of glyphs for the tdf#113076
    bugdoc.
    
    This also simplifies the situation, since the general rule since commit
    d436065bc1c68fc2d90e73253d8c00503c72dfd0 (tdf#103725: Default to GDI
    even with the new layout engine, 2016-11-15) is that non-OpenGL defaults
    to GDI rendering and OpenGL defaults to DirectWrite rendering.
    
    Change-Id: I44d035ab0890614be393599a5492e42e09231d86
    Reviewed-on: https://gerrit.libreoffice.org/70945
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index 797ce2eb8ffc..b3fe0132b7df 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -458,12 +458,12 @@ void WinSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout)
 
     const WinFontInstance* pWinFont = static_cast<const WinFontInstance*>(&rLayout.GetFont());
     const HFONT hLayoutFont = pWinFont->GetHFONT();
+    bool bUseOpenGL = OpenGLHelper::isVCLOpenGLEnabled() && !mbPrinter;
 
     // Our DirectWrite renderer is incomplete, skip it for non-horizontal or
     // stretched text.
-    bool bForceGDI = rLayout.GetOrientation() || pWinFont->hasHScale();
+    bool bForceGDI = rLayout.GetOrientation() || (pWinFont->hasHScale() && !bUseOpenGL);
 
-    bool bUseOpenGL = OpenGLHelper::isVCLOpenGLEnabled() && !mbPrinter;
     if (!bUseOpenGL)
     {
         // no OpenGL, just classic rendering


More information about the Libreoffice-commits mailing list