cairo/cairo-1.17.8-ft-font-missing-glyph.patch
Dominique Leuenberger 279a1a0bbb Accepting request 1072675 from GNOME:Next
- Update to version 1.17.8:
  + In a continuing effort to reduce the amount of legacy code, and
    increase the long-term maintainability of cairo, the following
    backends have been removed:
    - GL and GLES drawing
  + Additionally, cairo's Autotools build system has been removed;
    from now on, cairo will only support the Meson build system.
    While the end result should be identical, further testing is
    appreciated.
  + In this snapshot, cairo gained support for rendering COLRv1
    fonts, and rendering SVG and COLRv1 fonts with custom palettes.
  + Support for macOS and Windows has been improved, with lots of
    build and bug fixes.
  + Lots of safety issues have been fixed, with array bounds
    checking and plugging memory leaks, as well as fixes for bugs
    identified via fuzzying.
  + This is going to be the last snapshot of the 1.17 development
    cycle; we only expect minor bug fixing and improvements until
    the 1.18.0 release.
- Switch to meson buildsystem: Add meson BuildRequires and macros.
- Update Source Url to new home.
- Drop build_gl_backend define and conditional pkgconfig(egl) and
  pkgconfig(gl) BuildRequires: No longer supported.
- Add generic c++_compiler and c_compiler BuildRequires: New
  dependencies.
- Drop 0001-Set-default-LCD-filter-to-FreeType-s-default.patch:
  Fixed upstream.
- Add upstream bug fix patches:
  + cairo-1.17.8-fix-tee-compilation.patch
  + cairo-1.17.8-ft-font-missing-glyph.patch

OBS-URL: https://build.opensuse.org/request/show/1072675
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/cairo?expand=0&rev=154
2023-03-20 12:46:47 +00:00

63 lines
2.0 KiB
Diff

From 2766d9feeccd5d66e346b0abab38726b8e0aa1e9 Mon Sep 17 00:00:00 2001
From: Adrian Johnson <ajohnson@redneon.com>
Date: Tue, 7 Mar 2023 19:40:21 +1030
Subject: [PATCH] ft: Use normal font size when detecting the format
The format may depend on the font size.
Fixes #643
---
src/cairo-ft-font.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 22a6a622b..89af6193d 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -3314,11 +3314,13 @@ _cairo_ft_scaled_glyph_init_metrics (cairo_ft_scaled_font_t *scaled_font,
if (scaled_font->unscaled->have_color && scaled_font->base.options.color_mode != CAIRO_COLOR_MODE_NO_COLOR)
color_flag = FT_LOAD_COLOR;
#endif
+ /* Ensure use_em_size = FALSE as the format (bitmap or outline)
+ * may change with the size. */
status = _cairo_ft_scaled_glyph_load_glyph (scaled_font,
scaled_glyph,
face,
load_flags | color_flag,
- !hint_metrics,
+ FALSE,
vertical_layout);
if (unlikely (status))
return status;
@@ -3344,6 +3346,18 @@ _cairo_ft_scaled_glyph_init_metrics (cairo_ft_scaled_font_t *scaled_font,
glyph_priv->format = CAIRO_FT_GLYPH_TYPE_BITMAP;
}
+ /* If hinting is off, load the glyph with font size set the the em size. */
+ if (!hint_metrics) {
+ status = _cairo_ft_scaled_glyph_load_glyph (scaled_font,
+ scaled_glyph,
+ face,
+ load_flags | color_flag,
+ TRUE,
+ vertical_layout);
+ if (unlikely (status))
+ return status;
+ }
+
_cairo_ft_scaled_glyph_get_metrics (scaled_font,
face,
vertical_layout,
@@ -3369,6 +3383,7 @@ _cairo_ft_scaled_glyph_init_metrics (cairo_ft_scaled_font_t *scaled_font,
}
if (glyph_priv->format == CAIRO_FT_GLYPH_TYPE_COLR_V1) {
+ /* Restore font size if previously loaded at em_size. */
if (!hint_metrics) {
status = _cairo_ft_scaled_glyph_load_glyph (scaled_font,
scaled_glyph,
--
GitLab