tdf#150145 text appears to have a row of pixels cropped out

which is very similar sounding to
https://gitlab.freedesktop.org/cairo/cairo/-/issues/390

seems to be a bad interaction of slight hinting and sub pixel positioning
with hints_metrics disabled with CAIRO_HINT_METRICS_OFF.

lets continue to assume we desire CAIRO_HINT_METRICS_OFF most and
disable hinting rather than use slight

Change-Id: Id7b35d0e4f9291987e8ab96814936700374c6e16
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137466
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index 0be33e9..7300562d 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -199,7 +199,7 @@ void CairoTextRender::DrawTextLayout(const GenericSalLayout& rLayout, const SalG
        const bool bResolutionIndependentLayoutEnabled = rGraphics.getTextRenderModeForResolutionIndependentLayoutEnabled();
        cairo_hint_style_t eHintStyle = cairo_font_options_get_hint_style(pFontOptions);
        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 bAllowedHintStyle = !bResolutionIndependentLayoutEnabled || (eHintStyle == CAIRO_HINT_STYLE_NONE);
        bool bAllowedHintMetricStyle = !bResolutionIndependentLayoutEnabled || (eHintMetricsStyle == CAIRO_HINT_METRICS_OFF);

        if (bDisableAA || !bAllowedHintStyle || !bAllowedHintMetricStyle)
@@ -209,10 +209,10 @@ void CairoTextRender::DrawTextLayout(const GenericSalLayout& rLayout, const SalG
            cairo_font_options_t* pOptions = cairo_font_options_copy(pFontOptions);
            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);
            if (!bAllowedHintStyle)
                cairo_font_options_set_hint_style(pOptions, CAIRO_HINT_STYLE_NONE);
            cairo_set_font_options(cr, pOptions);
            cairo_font_options_destroy(pOptions);
        }