vcl/unx/generic/gdi/cairotextrender.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 865893432c4037f534ee28ea794e888e5ce7702b
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sat Sep 23 07:16:06 2023 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Sep 25 13:35:54 2023 +0200

    tdf#152675 treat all cairo versions <= 1.17.8 the same
    
    wrt unwanted sideeffects of CAIRO_HINT_METRICS_OFF seen
    in https://gitlab.freedesktop.org/cairo/cairo/-/issues/643
    and https://bugs.documentfoundation.org/show_bug.cgi?id=152675
    
    Change-Id: Ib3f43fd3832083f1768b737e3a5fb28063c0ae23
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157177
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    (cherry picked from commit 1dd357ccf7ca9edbe5f2ef60465c2559f678d306)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157126
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx 
b/vcl/unx/generic/gdi/cairotextrender.cxx
index 0a10f6708faf..9c8b3b6563de 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -311,14 +311,17 @@ void CairoTextRender::DrawTextLayout(const 
GenericSalLayout& rLayout, const SalG
                 cairo_font_options_set_antialias(pOptions, 
CAIRO_ANTIALIAS_NONE);
             if (!bAllowedHintStyle)
                 cairo_font_options_set_hint_style(pOptions, 
CAIRO_HINT_STYLE_SLIGHT);
-            // Disable private CAIRO_ROUND_GLYPH_POS_ON by merging with font 
options known to have
-            // CAIRO_ROUND_GLYPH_POS_OFF
             if (bResolutionIndependentLayoutEnabled)
             {
+                // Disable private CAIRO_ROUND_GLYPH_POS_ON by merging with
+                // font options known to have CAIRO_ROUND_GLYPH_POS_OFF
                 cairo_font_options_merge(pOptions, CairoFontOptions::get());
-                // tdf#153699 skip this with cairo 1.17.8 as it has a problem
+
+                // a) tdf#153699 skip this with cairo 1.17.8 as it has a 
problem
                 // See: https://gitlab.freedesktop.org/cairo/cairo/-/issues/643
-                if (cairo_version() != CAIRO_VERSION_ENCODE(1,17,8))
+                // b) tdf#152675 a similar report for cairo: 1.16.0-4ubuntu1,
+                // assume that everything <= 1.17.8 is unsafe to disable this
+                if (cairo_version() <= CAIRO_VERSION_ENCODE(1, 17, 8))
                     cairo_font_options_set_hint_metrics(pOptions, 
CAIRO_HINT_METRICS_OFF);
             }
             cairo_set_font_options(cr, pOptions);

Reply via email to