all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Mechanism to scale SVG images when default face height changes?
@ 2023-09-18 17:42 Jimmy Yuen Ho Wong
  2023-09-18 17:53 ` Eli Zaretskii
  2023-09-18 18:19 ` Alan Third
  0 siblings, 2 replies; 10+ messages in thread
From: Jimmy Yuen Ho Wong @ 2023-09-18 17:42 UTC (permalink / raw)
  To: Emacs-Devel devel

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

Hi everyone,

all-the-icons maintainer here. Recently I've converted all-the-icons from
using icon-fonts to SVGs. A few early testers of this branch have reported
that when they resize the default face, either by text-scale-mode, loading
a different theme or setting the default face size attributes manually, the
SVG icons inserted into the buffers do not scale accordingly.

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))
```

As far as I understand, simply adjusting the scale factor of the image will
suffice. The problem is, since Emacs doesn't do it by itself, I don't
really know how to do it in Elisp and be performant. Are there any hooks or
internal undocumented functions that I can use to scale all the images in
all of the frames when the default face size changes?

Thanks,

Jimmy Yuen Ho Wong

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-09-20 19:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-18 17:42 Mechanism to scale SVG images when default face height changes? Jimmy Yuen Ho Wong
2023-09-18 17:53 ` Eli Zaretskii
2023-09-18 19:16   ` Jimmy Yuen Ho Wong
2023-09-18 18:19 ` Alan Third
2023-09-18 19:10   ` Jimmy Yuen Ho Wong
2023-09-18 19:37     ` Alan Third
2023-09-18 19:55       ` Jimmy Yuen Ho Wong
2023-09-18 20:53         ` Alan Third
2023-09-18 21:04           ` Jimmy Yuen Ho Wong
2023-09-20 19:12             ` Alan Third

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.