vcl/unx/generic/gdi/cairotextrender.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
New commits: commit 1dd357ccf7ca9edbe5f2ef60465c2559f678d306 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sat Sep 23 07:16:06 2023 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sat Sep 23 11:28:07 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> diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx index 38bece7af54d..2394c33b0c82 100644 --- a/vcl/unx/generic/gdi/cairotextrender.cxx +++ b/vcl/unx/generic/gdi/cairotextrender.cxx @@ -435,14 +435,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 (bSubpixelPositioning) { + // 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);