summaryrefslogtreecommitdiff
path: root/vcl/qt5
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/qt5')
-rw-r--r--vcl/qt5/QtGraphics_Text.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/vcl/qt5/QtGraphics_Text.cxx b/vcl/qt5/QtGraphics_Text.cxx
index 37825c970327..02158fca29db 100644
--- a/vcl/qt5/QtGraphics_Text.cxx
+++ b/vcl/qt5/QtGraphics_Text.cxx
@@ -294,11 +294,26 @@ std::unique_ptr<GenericSalLayout> QtGraphics::GetTextLayout(int nFallbackLevel)
return std::make_unique<QtCommonSalLayout>(*m_pTextStyle[nFallbackLevel]);
}
+static QRawFont GetRawFont(const QFont& rFont, bool bWithoutHintingInTextDirection)
+{
+ QFont::HintingPreference eHinting = rFont.hintingPreference();
+ bool bAllowedHintStyle
+ = !bWithoutHintingInTextDirection
+ || (eHinting == QFont::PreferNoHinting || eHinting == QFont::PreferVerticalHinting);
+ if (bWithoutHintingInTextDirection && !bAllowedHintStyle)
+ {
+ QFont aFont(rFont);
+ aFont.setHintingPreference(QFont::PreferVerticalHinting);
+ return QRawFont::fromFont(aFont);
+ }
+ return QRawFont::fromFont(rFont);
+}
+
void QtGraphics::DrawTextLayout(const GenericSalLayout& rLayout)
{
const QtFont* pFont = static_cast<const QtFont*>(&rLayout.GetFont());
assert(pFont);
- QRawFont aRawFont(QRawFont::fromFont(*pFont));
+ QRawFont aRawFont(GetRawFont(*pFont, getTextRenderModeForResolutionIndependentLayoutEnabled()));
QVector<quint32> glyphIndexes;
QVector<QPointF> positions;