From db78c36739101084ddd2220d7f93dc3dac45f238 Mon Sep 17 00:00:00 2001 From: Marek Kasik Date: Fri, 27 Feb 2026 15:31:32 +0100 Subject: [PATCH] Set unit of SVG surface explicitly Resolves: RHEL-68451 --- libgxps-0.3.2-svg-surface-unit.patch | 29 ++++++++++++++++++++++++++++ libgxps.spec | 8 +++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 libgxps-0.3.2-svg-surface-unit.patch diff --git a/libgxps-0.3.2-svg-surface-unit.patch b/libgxps-0.3.2-svg-surface-unit.patch new file mode 100644 index 0000000..df45500 --- /dev/null +++ b/libgxps-0.3.2-svg-surface-unit.patch @@ -0,0 +1,29 @@ +From 2cf98e222fa2e780a39a2e8331e9f083d3418971 Mon Sep 17 00:00:00 2001 +From: Marek Kasik +Date: Wed, 25 Feb 2026 12:16:51 +0100 +Subject: [PATCH] tools: Set unit of SVG surface explicitly + +Set unit of created surface to CAIRO_SVG_UNIT_PT since current +Cairo defaults to CAIRO_SVG_UNIT_USER which corresponds +to CAIRO_SVG_UNIT_PX (1/96th of inch) although documentation +of cairo_svg_surface_create() says that it requires width +and height in points. +--- + tools/gxps-svg-converter.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tools/gxps-svg-converter.c b/tools/gxps-svg-converter.c +index 291f7aa..22b2f55 100644 +--- a/tools/gxps-svg-converter.c ++++ b/tools/gxps-svg-converter.c +@@ -52,6 +52,7 @@ gxps_svg_converter_begin_document (GXPSConverter *converter, + + _gxps_converter_print_get_output_size (print_converter, first_page, &width, &height); + converter->surface = cairo_svg_surface_create (print_converter->filename, width, height); ++ cairo_svg_surface_set_document_unit (converter->surface, CAIRO_SVG_UNIT_PT); + cairo_svg_surface_restrict_to_version (converter->surface, CAIRO_SVG_VERSION_1_2); + } + +-- +2.53.0 + diff --git a/libgxps.spec b/libgxps.spec index 69b6e3d..7f43d09 100644 --- a/libgxps.spec +++ b/libgxps.spec @@ -1,12 +1,14 @@ Name: libgxps Version: 0.3.2 -Release: 10%{?dist} +Release: 11%{?dist} Summary: GObject based library for handling and rendering XPS documents License: LGPL-2.1-or-later URL: https://wiki.gnome.org/Projects/libgxps Source0: https://ftp.gnome.org/pub/gnome/sources/%{name}/0.3/%{name}-%{version}.tar.xz +Patch: libgxps-0.3.2-svg-surface-unit.patch + BuildRequires: meson BuildRequires: gcc BuildRequires: gtk3-devel @@ -80,6 +82,10 @@ documents using the %{name} library. %changelog +* Fri Feb 27 2026 Marek Kasik - 0.3.2-11 +- Set unit of SVG surface explicitly +- Resolves: RHEL-68451 + * Tue Oct 29 2024 Troy Dawson - 0.3.2-10 - Bump release for October 2024 mass rebuild: Resolves: RHEL-64018