summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Eves <tim_eves@sil.org>2016-03-14 17:04:29 +0700
committerTor Lillqvist <tml@collabora.com>2016-03-14 12:26:11 +0200
commitaf6205c30ea899da4a489f8be47bc3c4c0225ba5 (patch)
tree8ebfb1e719704356b1def572f38309b52e924685
parentf771b7ac219ccb6eea4afc94445ab2702f6cd4e6 (diff)
Make AddChunkOfGlyphs() bail when CJK text is requested
Change-Id: I4374c809014ac618d5b701752e6bb6b9a196fe8d
-rw-r--r--vcl/win/gdi/winlayout.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index a5d810caff34..9cd70d0932b3 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -425,6 +425,22 @@ bool WinFontInstance::AddChunkOfGlyphs(bool bRealGlyphIndices, int nGlyphIndex,
pTxt->BindFont(hDC);
+ // Bail for vertical 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] == '@')
+ {
+ pTxt->ReleaseFont();
+ return false;
+ }
+ }
// Fetch the ink boxes and calculate the size of the atlas.
if (!bRealGlyphIndices)
{