GNU bug report logs - #37159
26.1; svg images in eww

Previous Next

Package: emacs;

Reported by: Tomasz Piotrowski <tpiotrowski <at> is.umk.pl>

Date: Fri, 23 Aug 2019 14:17:01 UTC

Severity: minor

Tags: fixed

Found in version 26.1

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #123 received at 37159 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Tomasz Piotrowski <tpiotrowski <at> is.umk.pl>
Cc: Lars Magne Ingebrigtsen <larsi <at> gnus.org>, 37159 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#37159: 26.1; svg images in eww
Date: Thu, 19 Sep 2019 12:02:56 +0100
[Message part 1 (text/plain, inline)]
On Thu, 19 Sep 2019, 09:21 Tomasz Piotrowski, <tpiotrowski <at> is.umk.pl> wrote:

> >>> Looks like whatever library Emacs is using for the svgs are saying that
> >>> they're shorter than they should be:
> >>>
> >>> (image-size (create-image "/tmp/d.svg" nil nil :scale 1) t)
> >>> => (12 . 13)
> >> What would be a solution to this?
> >
> > I do not know.
> If the patch lines are commented out in shr.el:
>
>     ;; SVG images often do not have a specified foreground/background
>     ;; color, so wrap them in styles.
>     ;; (when (eq content-type 'image/svg+xml)
>     ;;   (setq data (svg--wrap-svg data)))
>     (list data content-type)))
>
> (defun svg--wrap-svg (data))
>   ;; "Add a default foreground colour to SVG images."
>   ;; (with-temp-buffer
>   ;;   (insert "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" "
>   ;;           "xmlns:xi=\"http://www.w3.org/2001/XInclude\" "
>   ;;           "style=\"color: "
>   ;;           (face-foreground 'default) ";\">"
>   ;;           "<xi:include href=\"data:image/svg+xml;base64,"
>   ;;           (base64-encode-string data t)
>   ;;           "\"></xi:include></svg>")
>   ;;   (buffer-string)))
>
> then the equations (SVG images) are not overlapping with surrounding
> text.
>

Hmm, it looks like GTK explicitly sets the width and height of the wrapper
to match the SVG file. I don't know how practical that is for us, does it
mean loading the file twice: once to get the size and once to wrap it?

>
[Message part 2 (text/html, inline)]

This bug report was last modified 5 years and 281 days ago.

Previous Next


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