summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2016-05-12 14:22:42 +0300
committerTor Lillqvist <tml@collabora.com>2016-05-12 14:26:37 +0300
commit43c95611d2621d1f2f9d60b26c07aad25c62baed (patch)
tree8cb3b6f608e59a3ba0f83d642ee8b6c9f501e998 /vcl/win
parent92c4c76f55049ed888fa9b4c2fba6b88f18e4cc5 (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. Change-Id: Ia88d38010e52ada8193f2b8057d9f3250108e9f1
Diffstat (limited to 'vcl/win')
-rw-r--r--vcl/win/gdi/winlayout.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index 7c217b6d22c7..0e39c121c1c7 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;