summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-01-13 17:27:20 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-01-13 20:24:47 +0100
commitb589fc5a8d1124b81ac75dfac972c1036ae55477 (patch)
tree9aa847324eb79412775d0daa19680edc45224e1f /vcl
parenta02faeade844050d1235588093c13024bb2cdeed (diff)
set hint_metrics seperately from hint_style
I unsure hint_metrics makes any difference to our use case, but probably won't hurt Change-Id: I82a4ff0d3a05e50ec30e878363e0c24a438c96cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128389 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/generic/gdi/cairotextrender.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index 7d24dce1e09f..c403c2f3246b 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -174,11 +174,13 @@ void CairoTextRender::DrawTextLayout(const GenericSalLayout& rLayout, const SalG
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
bool bDisableAA = !rStyleSettings.GetUseFontAAFromSystem() && !rGraphics.getAntiAlias();
- bool bWithoutHintingInTextDirection = rGraphics.getTextRenderModeForResolutionIndependentLayoutEnabled();
+ const bool bResolutionIndependentLayoutEnabled = rGraphics.getTextRenderModeForResolutionIndependentLayoutEnabled();
cairo_hint_style_t eHintStyle = cairo_font_options_get_hint_style(pFontOptions);
- bool bAllowedHintStyle = !bWithoutHintingInTextDirection || (eHintStyle == CAIRO_HINT_STYLE_NONE || eHintStyle == CAIRO_HINT_STYLE_SLIGHT);
+ cairo_hint_metrics_t eHintMetricsStyle = cairo_font_options_get_hint_metrics(pFontOptions);
+ bool bAllowedHintStyle = !bResolutionIndependentLayoutEnabled || (eHintStyle == CAIRO_HINT_STYLE_NONE || eHintStyle == CAIRO_HINT_STYLE_SLIGHT);
+ bool bAllowedHintMetricStyle = !bResolutionIndependentLayoutEnabled || (eHintMetricsStyle == CAIRO_HINT_METRICS_OFF);
- if (bDisableAA || !bAllowedHintStyle)
+ if (bDisableAA || !bAllowedHintStyle || !bAllowedHintMetricStyle)
{
// Disable font AA in case global AA setting is supposed to affect
// font rendering (not the default) and AA is disabled.
@@ -186,10 +188,9 @@ void CairoTextRender::DrawTextLayout(const GenericSalLayout& rLayout, const SalG
if (bDisableAA)
cairo_font_options_set_antialias(pOptions, CAIRO_ANTIALIAS_NONE);
if (!bAllowedHintStyle)
- {
cairo_font_options_set_hint_style(pOptions, CAIRO_HINT_STYLE_SLIGHT);
+ if (!bAllowedHintMetricStyle)
cairo_font_options_set_hint_metrics(pOptions, CAIRO_HINT_METRICS_OFF);
- }
cairo_set_font_options(cr, pOptions);
cairo_font_options_destroy(pOptions);
}