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

Tor Lillqvist tml at collabora.com
Thu May 12 11:27:40 UTC 2016


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

New commits:
commit 43c95611d2621d1f2f9d60b26c07aad25c62baed
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu May 12 14:22:42 2016 +0300

    tdf#99369: Try harder to bail out for non-horizontal text
    
    Look not only for fonts with rotated glyphs (where the first character
    of the face name is '@') but also for font objects with non-zero
    orientation or escapement in general.
    
    Change-Id: Ia88d38010e52ada8193f2b8057d9f3250108e9f1

diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index 7c217b6..0e39c12 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -383,17 +383,21 @@ bool WinFontInstance::CacheGlyphToAtlas(bool bRealGlyphIndices, int nGlyphIndex,
 
     pTxt->BindFont(hDC);
 
-    // Bail for vertical text.
+    // Bail for non-horizontal text.
     {
         wchar_t sFaceName[200];
         int nFaceNameLen = GetTextFaceW(hDC, SAL_N_ELEMENTS(sFaceName), sFaceName);
-        SelectObject(hDC, hOrigFont);
-        DeleteDC(hDC);
 
         if (!nFaceNameLen)
             SAL_WARN("vcl.gdi", "GetTextFace failed: " << WindowsErrorString(GetLastError()));
 
-        if (sFaceName[0] == '@')
+        LOGFONTW aLogFont;
+        GetObjectW(rLayout.mhFont, sizeof(LOGFONTW), &aLogFont);
+
+        SelectObject(hDC, hOrigFont);
+        DeleteDC(hDC);
+
+        if (sFaceName[0] == '@' || aLogFont.lfOrientation != 0 || aLogFont.lfEscapement != 0)
         {
             pTxt->ReleaseFont();
             return false;


More information about the Libreoffice-commits mailing list