Set unit of SVG surface explicitly

Resolves: RHEL-68451
This commit is contained in:
Marek Kasik 2026-02-27 15:31:32 +01:00
parent 12fb6691d4
commit db78c36739
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From 2cf98e222fa2e780a39a2e8331e9f083d3418971 Mon Sep 17 00:00:00 2001
From: Marek Kasik <mkasik@redhat.com>
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

View File

@ -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 <mkasik@redhat.com> - 0.3.2-11
- Set unit of SVG surface explicitly
- Resolves: RHEL-68451
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 0.3.2-10
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018