summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2023-09-23 07:16:06 +0100
committerAndras Timar <andras.timar@collabora.com>2023-09-27 21:11:34 +0200
commitc5549584f00363e5f5ef327b18c089b06853c9f1 (patch)
tree5c1be0ca24aee53ec8b11bc40e6d654fb84e0b59 /vcl
parent9f3f385f6b3d2eae07271211c3fea1e4b8df797e (diff)
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.mcnamara@collabora.com> (cherry picked from commit 1dd357ccf7ca9edbe5f2ef60465c2559f678d306) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157126 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/generic/gdi/cairotextrender.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index 9662c3e4bd11..5a54f8c9b08c 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);