unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: Tomasz Piotrowski <tpiotrowski@is.umk.pl>
Cc: Lars Magne Ingebrigtsen <larsi@gnus.org>, 37159@debbugs.gnu.org
Subject: bug#37159: 26.1; svg images in eww
Date: Thu, 19 Sep 2019 12:02:56 +0100	[thread overview]
Message-ID: <CABGBtwmEUB+zwjVwhd22cNkup-59-tDZOQw=Go8oAAqiwyDjNw@mail.gmail.com> (raw)
In-Reply-To: <875zloofx3.fsf@host-4-42.fizyka.umk.pl>

[-- Attachment #1: Type: text/plain, Size: 1466 bytes --]

On Thu, 19 Sep 2019, 09:21 Tomasz Piotrowski, <tpiotrowski@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?

>

[-- Attachment #2: Type: text/html, Size: 2514 bytes --]

  reply	other threads:[~2019-09-19 11:02 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23 12:55 bug#37159: 26.1; svg images in eww Tomasz Piotrowski
2019-08-23 17:29 ` Lars Ingebrigtsen
2019-08-24  7:56   ` Tomasz Piotrowski
2019-08-25  5:49     ` Lars Ingebrigtsen
2019-08-25  6:21       ` Tomasz Piotrowski
2019-08-25  7:35         ` Eli Zaretskii
2019-08-25  8:10           ` Tomasz Piotrowski
2019-08-25  8:20             ` Eli Zaretskii
2019-08-25 10:12               ` Tomasz Piotrowski
2019-08-25 10:15                 ` Tomasz Piotrowski
2019-08-26  4:56               ` Lars Ingebrigtsen
2019-08-26  5:33                 ` Tomasz Piotrowski
2019-08-26  6:25                   ` Tomasz Piotrowski
2019-08-26  7:48                 ` Eli Zaretskii
2019-08-26  7:50                   ` Lars Ingebrigtsen
2019-08-26  8:02                     ` Eli Zaretskii
2019-08-27  6:59                       ` Lars Ingebrigtsen
2019-08-27  7:47                         ` Eli Zaretskii
2019-08-27  8:01                           ` Tomasz Piotrowski
2019-09-04 15:04                             ` Tomasz Piotrowski
2019-09-09 15:20                               ` Tomasz Piotrowski
2019-09-14  8:59                         ` Alan Third
2019-09-14 12:05                           ` Lars Ingebrigtsen
2019-09-14 14:49                             ` Lars Ingebrigtsen
2019-09-14 15:51                               ` Eli Zaretskii
2019-09-14 15:54                               ` Alan Third
2019-09-15 12:17                                 ` Lars Ingebrigtsen
2019-09-16  8:44                                   ` Tomasz Piotrowski
2019-09-16 12:27                                     ` Lars Ingebrigtsen
2019-09-16 14:29                                       ` Tomasz Piotrowski
2019-09-16 18:34                                         ` Lars Ingebrigtsen
2019-09-18  7:18                                           ` Tomasz Piotrowski
2019-09-18 13:43                                             ` Lars Ingebrigtsen
2019-09-19  8:20                                               ` Tomasz Piotrowski
2019-09-19 11:02                                                 ` Alan Third [this message]
2019-09-19 13:59                                                   ` Lars Ingebrigtsen
2019-09-20 18:56                                                     ` Alan Third
2019-09-20 19:09                                                       ` Tomasz Piotrowski
2019-09-20 19:18                                                         ` Lars Ingebrigtsen
2019-09-20 19:22                                                           ` Tomasz Piotrowski
2019-09-20 19:26                                                             ` Eli Zaretskii
2019-09-20 20:48                                                               ` Tomasz Piotrowski
2019-09-21  6:28                                                                 ` Eli Zaretskii
2019-09-21 17:32                                                                   ` Tomasz Piotrowski
2019-09-20 20:56                                                             ` Lars Ingebrigtsen
2019-08-26  4:54         ` Lars Ingebrigtsen
2019-08-26  7:46           ` Eli Zaretskii
2019-08-26  7:49             ` Tomasz Piotrowski
2019-08-25 22:34 ` Jordan Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABGBtwmEUB+zwjVwhd22cNkup-59-tDZOQw=Go8oAAqiwyDjNw@mail.gmail.com' \
    --to=alan@idiocy.org \
    --cc=37159@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=tpiotrowski@is.umk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).