emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using more and/or better icons in Emacs


From: Stefan Kangas
Subject: Re: Using more and/or better icons in Emacs
Date: Fri, 9 Apr 2021 20:43:56 -0500

Stefan Kangas <stefan@marxist.se> writes:

> Basing myself on that I have ended up with the following fragment:
>
> (let* ((scale (cadr (assoc :height (assoc 'default face-remapping-alist))))
>        (family (face-attribute 'default :family))
>        (height (* (aref (font-info family) 2) (if scale scale 1)))
>        (ascent (* (aref (font-info family) 8) (if scale scale 1))))
>   (insert-image (create-image "material/action/ic_search_24px.svg" 'svg nil
>                               :height height
>                               :ascent 'center)))

Hmm, I'm now testing simply using this, with width and height set to 1em
in the SVG file:

(insert-image (create-image "material/action/ic_search_24px.svg" 'svg nil
                            :ascent 'center))

And it seems to do precisely the correct thing, as well as work with
`text-scale-adjust'.  So perhaps that's the winner?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]