bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#67794: 30.0.50; mouse-face is not respected on SVG images


From: Alan Third
Subject: bug#67794: 30.0.50; mouse-face is not respected on SVG images
Date: Wed, 20 Dec 2023 13:54:11 +0000

On Wed, Dec 20, 2023 at 03:19:29PM +0200, Eli Zaretskii wrote:
> > I'm using librsvg 2.57 and I could not easily test it with an older
> > version.
> 
> Alan, is the trick with wrapping SVG with another one supposed to work
> with all versions of librsvg?

Yes.

> I see some version conditions in
> svg_load_image, but I'm not sure I understand the consequences.

It's quite complex because the librsvg API has changed a lot over the
last few years. Generally we try to use as many features of librsvg as
possible for each version. So, for example 2.52 and above allow us to
ask directly the size of the image (the most accurate way), 2.48
requires us to do more calculations and below 2.48 we need to actually
generate the rasterized image and get it's size from that.

> Specifically, what does this code do:
> 
>   #if LIBRSVG_CHECK_VERSION (2, 48, 0)
>     rsvg_handle_set_stylesheet (rsvg_handle, (guint8 *)css, strlen (css), 
> NULL);
>   #endif
> 
> It is only used for librsvg 2.48 and later.

This sets a CSS stylesheet which contains the font and font size. It's
only used on 2.48+ because that's when it was introduced. There is a
previous call to the same function that has more explanation. There
are two calls because we need to set up the SVG, parse it, get it's
size, then wrap it, set up the wrapped version and parse again before
finally rasterizing.

> And for librsvg older than 2.32, it looks like we don't use the
> wrapped SVG at all?

I think we do. The #if/#endif's are hard to follow, but I'm sure the
wrapper is used in all versions.

IIRC the main difference between 2.32 and older versions is the
initial setup of the SVG handle.

I'll see if I can come up with some better comments.

-- 
Alan Third





reply via email to

[Prev in Thread] Current Thread [Next in Thread]