summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2017-03-03 05:15:14 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2017-03-03 13:22:53 +0000
commita51b7a1c3a7e7cf7b0c733e1dec40288278c1884 (patch)
tree6452088195b6c0ad617e7a6b9f97ecc8672d321e /vcl/source
parent5742868ccf030b2c0f03538d030bd18bd5666bdb (diff)
tdf#103831, tdf#100986: Force using GDI when needed
Our DirectWrite renderer is incomplete and can’t handle rotated text or text with horizontal scaling, so route these two through GDI for now. Change-Id: I87b85796a29e3acce782e01b4c629fec6f1a9e25 Reviewed-on: https://gerrit.libreoffice.org/34848 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/gdi/CommonSalLayout.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index 220b3b107284..af79404ba979 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -38,11 +38,6 @@ T lround(T x)
}
#endif
-#ifdef _WIN32
-# include <vcl/opengl/OpenGLHelper.hxx>
-#endif
-
-
static hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData)
{
char pTagName[5];
@@ -189,7 +184,7 @@ CommonSalLayout::CommonSalLayout(HDC hDC, WinFontInstance& rWinFontInstance, con
}
// Calculate the mnAveWidthFactor, see the comment where it is used.
- if (mrFontSelData.mnWidth && ! OpenGLHelper::isVCLOpenGLEnabled())
+ if (mrFontSelData.mnWidth)
{
double nUPEM = hb_face_get_upem(hb_font_get_face(mpHbFont));
@@ -213,6 +208,13 @@ CommonSalLayout::CommonSalLayout(HDC hDC, WinFontInstance& rWinFontInstance, con
}
}
+bool CommonSalLayout::hasHScale() const
+{
+ int nHeight(mrFontSelData.mnHeight);
+ int nWidth(mrFontSelData.mnWidth ? mrFontSelData.mnWidth * mnAveWidthFactor : nHeight);
+ return nWidth != nHeight;
+}
+
#elif defined(MACOSX) || defined(IOS)
CommonSalLayout::CommonSalLayout(const CoreTextStyle& rCoreTextStyle)
: mrFontSelData(rCoreTextStyle.maFontSelData)