unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Anand Tamariya <atamariya@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Alexander Adolf <alexander.adolf@condition-alpha.com>,
	Emacs Devel <emacs-devel@gnu.org>
Subject: Re: SVG hack for display engine
Date: Wed, 17 Nov 2021 10:03:25 +0530	[thread overview]
Message-ID: <CADm7Y4=qCedZcNX=mjiCBmfUsr2YoticZmzb5-fR_VJ6G8VE5A@mail.gmail.com> (raw)
In-Reply-To: <83k0h818zw.fsf@gnu.org>

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

On Tue, Nov 16, 2021 at 7:46 PM Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Alexander Adolf <alexander.adolf@condition-alpha.com>
> > Date: Tue, 16 Nov 2021 15:08:00 +0100
> > Cc: Anand Tamariya <atamariya@gmail.com>, emacs-devel@gnu.org
> >
> > All of these, and probably many more, use cases would be enabled by an
> SVG based display engine.
>
> What is "an SVG based display engine"?  How will it work?  Which parts
> of the existing display engine will it replace, and how?
>
> A serious discussion of these matters should answer all those
> questions and many more.  The Emacs display engine isn't just
> something that takes text and shows it on the screen in different
> colors, it implements a large number of features without which Emacs
> wouldn't be Emacs.  They all need to be supported in any new
> implementation, so we should have a more-or-less clear idea how this
> would be possible with this proposal.
>
Here's some details on how I think it might work. Emacs exposes two Lisp
APIs:
- svg-render (svg x y width height)
svg is a Lisp DOM object as returned by (dom-node). This should use librsvg
to generate a bitmap image of svg of size (width x height) and superimpose
it at position (x, y) on the current bitmap being displayed by Emacs. The
current image API takes either a filename or XML string for SVG. This can
be avoided if svg is a Lisp DOM.

- svg-bbox (node)
This returns the bounding box of the DOM node. This is basically a wrapper
around librsvg API.

Emacs also adds a hook, say, display-svg-hook which runs only on a
graphical display. Any mode can use this hook to display the SVG content
using the above API.

This should mean minimal changes to the display engine and it continues to
run as is for terminals. What do you think?

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

  parent reply	other threads:[~2021-11-17  4:33 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15  2:39 SVG hack for display engine Anand Tamariya
2021-11-15 12:45 ` Eli Zaretskii
2021-11-15 13:27   ` Anand Tamariya
2021-11-15 14:02     ` Eli Zaretskii
2021-11-16  3:01       ` Anand Tamariya
2021-11-16  3:28         ` Po Lu
2021-11-16 12:56           ` Eli Zaretskii
2021-11-16 13:02             ` Po Lu
2021-11-16 12:55         ` Eli Zaretskii
2021-11-16 14:08           ` Alexander Adolf
2021-11-16 14:16             ` Eli Zaretskii
2021-11-16 14:22               ` Alexander Adolf
2021-11-17  4:33               ` Anand Tamariya [this message]
2021-11-17  4:46                 ` Po Lu
2021-11-26  1:33                   ` Gerry Agbobada
2021-11-17 13:47                 ` Eli Zaretskii
2021-11-17 23:47                   ` Anand Tamariya
2021-11-18  8:16                     ` Eli Zaretskii
2021-11-18 10:13                       ` Anand Tamariya
2021-11-18 11:21                         ` Eli Zaretskii
2021-11-18 13:29                           ` Anand Tamariya
2021-11-18 14:52                             ` Eli Zaretskii
2021-11-19  1:32                               ` Anand Tamariya
2021-11-19  7:07                                 ` Eli Zaretskii
2021-11-20 19:44                                 ` Alan Third
2021-11-22  2:48                                   ` Anand Tamariya
2021-11-22 10:59                                     ` Alan Third

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='CADm7Y4=qCedZcNX=mjiCBmfUsr2YoticZmzb5-fR_VJ6G8VE5A@mail.gmail.com' \
    --to=atamariya@gmail.com \
    --cc=alexander.adolf@condition-alpha.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).