[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fwd: Mechanism to scale SVG images when default face height changes?
From: |
Corwin Brust |
Subject: |
Fwd: Mechanism to scale SVG images when default face height changes? |
Date: |
Mon, 18 Sep 2023 13:49:46 -0500 |
See below. We should open tasks to update hand-crafted and generated
SVG fragments text sizes to/to-prefer EM units.
Anyone would be welcome to look into src/dm-draw.el and
docs/maps/tiles.org to collect more detail (are those the only places
we currently hard code assumption that text size is expressed in
pixels?) and any direction you would suggestion (shall we assume
sizing must always be in em and thus update both org files and elisp
at the same time, or should we try something like converting
automatically when we load map tiles?). Handy link to open a ticket
for sharing your research, if you work on this:
https://savannah.nongnu.org/task/?group=dungeon&func=additem
---------- Forwarded message ---------
From: Alan Third <alan@idiocy.org>
Date: Mon, Sep 18, 2023 at 1:19 PM
Subject: Re: Mechanism to scale SVG images when default face height changes?
To: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
Cc: Emacs-Devel devel <emacs-devel@gnu.org>
On Mon, Sep 18, 2023 at 06:42:33PM +0100, Jimmy Yuen Ho Wong wrote:
> In the SVG branch in all-the-icons, all the icons are inserted with a
> `:width` and `:height` properties set on the image, and the face is applied
> to the propertized string. i.e.
>
> ```elisp
> ELISP> (all-the-icons-icon-for-file "test.js")
> #("" 0 1
> (face all-the-icons-lpurple font-lock-face all-the-icons-lpurple
> fontified t display
> (image :type svg :data "<svg viewBox=\"0 0 512 512\" width=\"512\"
> height=\"512\"> <path d=\"...snip...\"></path></svg>" :scale 1
> :transform-smoothing t :width 14 :height 14 :ascent center :margin 1)
> front-sticky nil rear-nonsticky t))
> ```
Do you need to set the size in pixels? If you set the size in em's
(from Emacs 28 up) then it will scale automatically.
--
Alan Third
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Fwd: Mechanism to scale SVG images when default face height changes?,
Corwin Brust <=