summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2016-05-12 14:22:42 +0300
committerJan Holesovsky <kendy@collabora.com>2016-05-13 07:18:45 +0000
commitdd8319479fe3863324c27407625fe5e6ba759f17 (patch)
tree5dfb633fd1460245f604d098288404c5d35e38d9 /vcl
parent02af67f6e43fa86e7e6faed7eaec4178396e36a3 (diff)
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. (cherry-picked from the commit 43c95611d2621d1f2f9d60b26c07aad25c62baed) Change-Id: Ia88d38010e52ada8193f2b8057d9f3250108e9f1 Reviewed-on: https://gerrit.libreoffice.org/24929 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/win/source/gdi/winlayout.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 360a3d35b85f..4dc79ea12943 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -370,17 +370,21 @@ bool ImplWinFontEntry::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;