diff --git a/0001-Set-default-LCD-filter-to-FreeType-s-default.patch b/0001-Set-default-LCD-filter-to-FreeType-s-default.patch deleted file mode 100644 index 4d7e1a1..0000000 --- a/0001-Set-default-LCD-filter-to-FreeType-s-default.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 12a5b7384f35d9a3f4c6b151fac4857444db3d6a Mon Sep 17 00:00:00 2001 -From: Nikolaus Waxweiler -Date: Sat, 10 Nov 2018 16:44:23 +0000 -Subject: [PATCH] Set default LCD filter to FreeType's default - ---- - src/cairo-ft-font.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c -index 325dd61b4..3c47dc12e 100644 ---- a/src/cairo-ft-font.c -+++ b/src/cairo-ft-font.c -@@ -1404,7 +1404,7 @@ _render_glyph_outline (FT_Face face, - cairo_image_surface_t **surface) - { - int rgba = FC_RGBA_UNKNOWN; -- int lcd_filter = FT_LCD_FILTER_LEGACY; -+ int lcd_filter = FT_LCD_FILTER_DEFAULT; - FT_GlyphSlot glyphslot = face->glyph; - FT_Outline *outline = &glyphslot->outline; - FT_Bitmap bitmap; -@@ -1439,13 +1439,13 @@ _render_glyph_outline (FT_Face face, - case CAIRO_LCD_FILTER_NONE: - lcd_filter = FT_LCD_FILTER_NONE; - break; -- case CAIRO_LCD_FILTER_DEFAULT: - case CAIRO_LCD_FILTER_INTRA_PIXEL: - lcd_filter = FT_LCD_FILTER_LEGACY; - break; - case CAIRO_LCD_FILTER_FIR3: - lcd_filter = FT_LCD_FILTER_LIGHT; - break; -+ case CAIRO_LCD_FILTER_DEFAULT: - case CAIRO_LCD_FILTER_FIR5: - lcd_filter = FT_LCD_FILTER_DEFAULT; - break; -@@ -3416,7 +3416,6 @@ _cairo_ft_font_options_substitute (const cairo_font_options_t *options, - case CAIRO_LCD_FILTER_NONE: - lcd_filter = FT_LCD_FILTER_NONE; - break; -- case CAIRO_LCD_FILTER_DEFAULT: - case CAIRO_LCD_FILTER_INTRA_PIXEL: - lcd_filter = FT_LCD_FILTER_LEGACY; - break; -@@ -3424,6 +3423,7 @@ _cairo_ft_font_options_substitute (const cairo_font_options_t *options, - lcd_filter = FT_LCD_FILTER_LIGHT; - break; - default: -+ case CAIRO_LCD_FILTER_DEFAULT: - case CAIRO_LCD_FILTER_FIR5: - lcd_filter = FT_LCD_FILTER_DEFAULT; - break; --- -2.19.1 - diff --git a/cairo-1.17.6.tar.xz b/cairo-1.17.6.tar.xz deleted file mode 100644 index 115057b..0000000 --- a/cairo-1.17.6.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4eebc4c2bad0402bc3f501db184417094657d111fb6c06f076a82ea191fe1faf -size 35055900 diff --git a/cairo-1.17.8-fix-tee-compilation.patch b/cairo-1.17.8-fix-tee-compilation.patch new file mode 100644 index 0000000..52ea4f5 --- /dev/null +++ b/cairo-1.17.8-fix-tee-compilation.patch @@ -0,0 +1,110 @@ +From 5e42a5277eddafd312a73e355d7775a4401dae4e Mon Sep 17 00:00:00 2001 +From: Emmanuele Bassi +Date: Fri, 3 Feb 2023 15:40:12 +0100 +Subject: [PATCH] tee: Fix cairo wrapper functions + +Follow-up to !391 to apply the same changes to the (disabled by default) +tee surface. + +Fixes: #634 +--- + src/cairo-tee-surface.c | 24 ++++++++++++++---------- + 1 file changed, 14 insertions(+), 10 deletions(-) + +diff --git a/src/cairo-tee-surface.c b/src/cairo-tee-surface.c +index 7a94c9bca..4994a5a60 100644 +--- a/src/cairo-tee-surface.c ++++ b/src/cairo-tee-surface.c +@@ -220,12 +220,12 @@ _cairo_tee_surface_paint (void *abstract_surface, + num_slaves = _cairo_array_num_elements (&surface->slaves); + slaves = _cairo_array_index (&surface->slaves, 0); + for (n = 0; n < num_slaves; n++) { +- status = _cairo_surface_wrapper_paint (&slaves[n], op, source, clip); ++ status = _cairo_surface_wrapper_paint (&slaves[n], op, source, 0, clip); + if (unlikely (status)) + return status; + } + +- return _cairo_surface_wrapper_paint (&surface->master, op, source, clip); ++ return _cairo_surface_wrapper_paint (&surface->master, op, source, 0, clip); + } + + static cairo_int_status_t +@@ -244,13 +244,17 @@ _cairo_tee_surface_mask (void *abstract_surface, + slaves = _cairo_array_index (&surface->slaves, 0); + for (n = 0; n < num_slaves; n++) { + status = _cairo_surface_wrapper_mask (&slaves[n], +- op, source, mask, clip); ++ op, source, 0, ++ mask, 0, ++ clip); + if (unlikely (status)) + return status; + } + + return _cairo_surface_wrapper_mask (&surface->master, +- op, source, mask, clip); ++ op, source, 0, ++ mask, 0, ++ clip); + } + + static cairo_int_status_t +@@ -274,7 +278,7 @@ _cairo_tee_surface_stroke (void *abstract_surface, + slaves = _cairo_array_index (&surface->slaves, 0); + for (n = 0; n < num_slaves; n++) { + status = _cairo_surface_wrapper_stroke (&slaves[n], +- op, source, ++ op, source, 0, + path, style, + ctm, ctm_inverse, + tolerance, antialias, +@@ -284,7 +288,7 @@ _cairo_tee_surface_stroke (void *abstract_surface, + } + + return _cairo_surface_wrapper_stroke (&surface->master, +- op, source, ++ op, source, 0, + path, style, + ctm, ctm_inverse, + tolerance, antialias, +@@ -310,7 +314,7 @@ _cairo_tee_surface_fill (void *abstract_surface, + slaves = _cairo_array_index (&surface->slaves, 0); + for (n = 0; n < num_slaves; n++) { + status = _cairo_surface_wrapper_fill (&slaves[n], +- op, source, ++ op, source, 0, + path, fill_rule, + tolerance, antialias, + clip); +@@ -319,7 +323,7 @@ _cairo_tee_surface_fill (void *abstract_surface, + } + + return _cairo_surface_wrapper_fill (&surface->master, +- op, source, ++ op, source, 0, + path, fill_rule, + tolerance, antialias, + clip); +@@ -361,7 +365,7 @@ _cairo_tee_surface_show_text_glyphs (void *abstract_surface, + for (n = 0; n < num_slaves; n++) { + memcpy (glyphs_copy, glyphs, sizeof (cairo_glyph_t) * num_glyphs); + status = _cairo_surface_wrapper_show_text_glyphs (&slaves[n], op, +- source, ++ source, 0, + utf8, utf8_len, + glyphs_copy, num_glyphs, + clusters, num_clusters, +@@ -374,7 +378,7 @@ _cairo_tee_surface_show_text_glyphs (void *abstract_surface, + + memcpy (glyphs_copy, glyphs, sizeof (cairo_glyph_t) * num_glyphs); + status = _cairo_surface_wrapper_show_text_glyphs (&surface->master, op, +- source, ++ source, 0, + utf8, utf8_len, + glyphs_copy, num_glyphs, + clusters, num_clusters, +-- +GitLab + + diff --git a/cairo-1.17.8-ft-font-missing-glyph.patch b/cairo-1.17.8-ft-font-missing-glyph.patch new file mode 100644 index 0000000..320b5d6 --- /dev/null +++ b/cairo-1.17.8-ft-font-missing-glyph.patch @@ -0,0 +1,62 @@ +From 2766d9feeccd5d66e346b0abab38726b8e0aa1e9 Mon Sep 17 00:00:00 2001 +From: Adrian Johnson +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 + + diff --git a/cairo-1.17.8.tar.xz b/cairo-1.17.8.tar.xz new file mode 100644 index 0000000..d6aba7f --- /dev/null +++ b/cairo-1.17.8.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b10c8892d1b58d70d3f0ba5b47863a061262fa56b9dc7944161f8c8b783bc64 +size 33392240 diff --git a/cairo.changes b/cairo.changes index adc3985..05fa2f5 100644 --- a/cairo.changes +++ b/cairo.changes @@ -1,3 +1,37 @@ +------------------------------------------------------------------- +Fri Mar 17 13:27:04 UTC 2023 - Bjørn Lie + +- 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 + ------------------------------------------------------------------- Wed Aug 31 18:23:24 UTC 2022 - Bjørn Lie diff --git a/cairo.spec b/cairo.spec index a70ae57..d1e9562 100644 --- a/cairo.spec +++ b/cairo.spec @@ -1,7 +1,7 @@ # # spec file for package cairo # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,25 +17,30 @@ %define build_xcb_backend 1 -%define build_gl_backend 1 + Name: cairo -Version: 1.17.6 +Version: 1.17.8 Release: 0 Summary: Vector Graphics Library with Cross-Device Output Support License: LGPL-2.1-or-later OR MPL-1.1 Group: Development/Libraries/C and C++ URL: https://cairographics.org/ -Source0: https://download.gnome.org/sources/cairo/1.17/%{name}-%{version}.tar.xz +Source0: https://cairographics.org/snapshots/%{name}-%{version}.tar.xz Source99: baselibs.conf # PATCH-FIX-UPSTREAM cairo-xlib-endianness.patch fdo#63461 bnc#882951 fcrozat@suse.com -- Fix crash when client and server have different endianness Patch0: cairo-xlib-endianness.patch # PATCH-FIX-UPSTREAM cairo-get_bitmap_surface-bsc1036789-CVE-2017-7475.diff alarrosa@suse.com -- Fix segfault in get_bitmap_surface Patch1: cairo-get_bitmap_surface-bsc1036789-CVE-2017-7475.diff -# PATCH-FIX-UPSTREAM 0001-Set-default-LCD-filter-to-FreeType-s-default.patch -- Set default LCD filter to FreeType's default -Patch2: 0001-Set-default-LCD-filter-to-FreeType-s-default.patch +# PATCH-FIX-UPSTREAM cairo-1.17.8-fix-tee-compilation.patch -- https://gitlab.freedesktop.org/cairo/cairo/-/issues/634 tee: Fix cairo wrapper functions +Patch2: cairo-1.17.8-fix-tee-compilation.patch +# PATCH-FIX-UPSTREAM cairo-1.17.8-ft-font-missing-glyph.patch -- https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/467 ft: Use normal font size when detecting the format +Patch3: cairo-1.17.8-ft-font-missing-glyph.patch +BuildRequires: c++_compiler +BuildRequires: c_compiler BuildRequires: gtk-doc +BuildRequires: meson BuildRequires: pkgconfig BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(freetype2) @@ -49,10 +54,6 @@ BuildRequires: pkgconfig(zlib) # These libraries are needed only for tests. # Do not enable tests in build systems, it causes build loop! #BuildRequires: librsvg-devel poppler-devel -%if %{build_gl_backend} -BuildRequires: pkgconfig(egl) -BuildRequires: pkgconfig(gl) -%endif %if %{build_xcb_backend} BuildRequires: pkgconfig(xcb) >= 1.6 BuildRequires: pkgconfig(xcb-render) >= 1.6 @@ -144,28 +145,25 @@ cairo. %autosetup -p1 %build -%configure \ - --enable-fc \ - --enable-ft \ -%if %{build_gl_backend} - --enable-gl \ -%endif - --enable-ps \ - --enable-pdf \ - --enable-script \ - --enable-svg \ - --enable-tee \ +%meson \ %if %{build_xcb_backend} - --enable-xcb \ + -D xcb=enabled \ %endif - --enable-xlib \ - --enable-gtk-doc \ - --disable-static -%make_build + -D freetype=enabled \ + -D fontconfig=enabled \ + -D glib=enabled \ + -D gtk_doc=true \ + -D spectre=disabled \ + -D symbol-lookup=disabled \ + -D tee=enabled \ + -D tests=disabled \ + -D xlib=enabled \ + -D xml=disabled + %{nil} +%meson_build %install -%make_install -find %{buildroot} -type f -name "*.la" -delete -print +%meson_install %ldconfig_scriptlets -n libcairo2 %ldconfig_scriptlets -n libcairo-gobject2 @@ -187,12 +185,12 @@ find %{buildroot} -type f -name "*.la" -delete -print %{_bindir}/cairo-sphinx %{_bindir}/cairo-trace %dir %{_libdir}/cairo -%{_libdir}/cairo/cairo-fdr.so -%{_libdir}/cairo/cairo-sphinx.so +%{_libdir}/cairo/libcairo-fdr.so +%{_libdir}/cairo/libcairo-sphinx.so %{_libdir}/cairo/libcairo-trace.so %files devel -%doc AUTHORS ChangeLog NEWS PORTING_GUIDE README +%doc AUTHORS NEWS README.md %doc %{_datadir}/gtk-doc/html/cairo %{_includedir}/cairo/ %{_libdir}/*.so