all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: "Nicolas P. Rougier (inria)" <nicolas.rougier@inria.fr>
Cc: emacs-devel@gnu.org
Subject: Re: ELPA: New package: svg-lib
Date: Mon, 27 Sep 2021 18:38:54 +0100	[thread overview]
Message-ID: <YVIBrpK4WZ2e5igs@idiocy.org> (raw)
In-Reply-To: <m1o88e3yvv.fsf@P-E3-Elodie.imn.u-bordeaux2.fr>

On Mon, Sep 27, 2021 at 03:49:16PM +0200, Nicolas P. Rougier (inria) wrote:
> 
> Note that there is still a pending bug with text size for some users (see
> https://github.com/rougier/svg-tag-mode/pull/14. This is a different project
> but the problem is the same). Any help appreciated.

Hi Nicolas,

I had my own go at matching SVG images and Emacs's text rendering at
one time and my code is here:

    https://gist.github.com/alanthird/7b86dc66df1ed3b9006bcd3fddd7350f

I was really just messing about, though, so it's probably not much
use.

Reading through that bug report I'm not 100% sure what is going on,
but I do suspect there may be some confusion as the behaviour of SVG
rendering has changed between Emacs 27 and Emacs 28.

For the most part Emacs 28 _should_ do the right thing. i.e. 1em
matches the exact font size used at the insertion point and the
default font family should also match the font at the insertion point.
Emacs 28 also adds the ability to set image sizes with '(1 . em), to
make it easier to make images scale with the font (we're using that to
display checkboxes in customize, and so on).

It also should set the DPI accurately so that 1cm == 1 real world cm,
except possibly on Macs where Apple's recommended DPI behaviour is...

Strange.

Unfortunately I guess you still have to support Emacs 27 (and below?)
so perhaps none of that really helps you.

When generating images I'd suggest always setting the image scale to
1, as that avoids any strange resizing behaviour that may be caused by
the image creation code attempting to rescale images to match the font
size.

Finally we have a bug open about screen DPIs (bug#49937) although it
probably has nothing to do with the problems you're seeing.
-- 
Alan Third



  parent reply	other threads:[~2021-09-27 17:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-27 13:49 ELPA: New package: svg-lib Nicolas P. Rougier (inria)
2021-09-27 14:34 ` Stefan Kangas
2021-09-27 14:34 ` Stefan Kangas
2021-09-27 17:38 ` Alan Third [this message]
2021-09-27 18:03   ` Nicolas P. Rougier (inria)
2021-09-27 20:19     ` Alan Third
2021-09-27 20:43       ` Nicolas P. Rougier (inria)
2021-09-27 20:03 ` Stefan Monnier
2021-09-27 20:47   ` Nicolas P. Rougier (inria)
2021-09-27 20:59     ` Stefan Kangas
2021-09-28  5:32       ` Nicolas P. Rougier (inria)
2021-09-27 21:02     ` Stefan Monnier
2021-09-28  5:34       ` Nicolas P. Rougier (inria)
2021-09-28  4:29     ` Adam Porter

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

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

  git send-email \
    --in-reply-to=YVIBrpK4WZ2e5igs@idiocy.org \
    --to=alan@idiocy.org \
    --cc=emacs-devel@gnu.org \
    --cc=nicolas.rougier@inria.fr \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.