GNU bug report logs - #75712
HAVE_RSVG: svg_css_length_to_pixels doesn't handle RSVG_UNIT_CH

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefankangas <at> gmail.com>

Date: Tue, 21 Jan 2025 00:00:02 UTC

Severity: normal

Done: Pip Cet <pipcet <at> protonmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 75712 <at> debbugs.gnu.org, pipcet <at> protonmail.com
Subject: bug#75712: HAVE_RSVG: svg_css_length_to_pixels doesn't handle RSVG_UNIT_CH
Date: Tue, 21 Jan 2025 15:59:16 +0200
> Cc: Pip Cet <pipcet <at> protonmail.com>
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Mon, 20 Jan 2025 20:25:18 -0600
> 
> --- a/src/image.c
> +++ b/src/image.c
> @@ -12008,9 +12008,15 @@ svg_css_length_to_pixels (RsvgLength length, double dpi, int font_size)
>  	 what size we make the image.  */
>        value = 0;
>        break;
> -    default:
> -      /* We should never reach this.  */
> -      value = 0;
> +#if LIBRSVG_CHECK_VERSION (2, 58, 0)
> +    case RSVG_UNIT_CH:
> +      /* FIXME: With CSS 3, "the ch unit falls back to 0.5em in the
> +	 general case, and to 1em when it would be typeset upright".
> +	 However, I could not find a way to easily get the relevant CSS
> +	 attributes using librsvg.  Thus, we simply wrongly assume the
> +	 general case is always true here.  See Bug#75712.  */
> +      value = value * font_size / 2.0;
> +#endif

This makes the code worse for librsvg versions before 2.58.  Why not
keep the old code for older versions?

Also, pointing to bug#75712 is not useful here: this bug had accrued
too many completely unrelated messages, so anyone who'd like to have
more details about this issue will curse us.  How about explaining the
main issues here in this very comment instead?

Thanks.




This bug report was last modified 118 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.