[Top][All Lists]

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

Re: Using more and/or better icons in Emacs

From: Alan Third
Subject: Re: Using more and/or better icons in Emacs
Date: Sat, 10 Apr 2021 10:12:52 +0100

On Fri, Apr 09, 2021 at 08:43:56PM -0500, Stefan Kangas wrote:
> 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?

Yes, sorry, I seem to have caused some confusion. I thought you were
asking how to do the same thing without modifying the files. I don't
know how to do the exact same thing, because as you say they don't
scale with the text on the fly, but it's as near as I've been able to

So modifying the files seems like the best solution to me. It works
the best and doesn't require special code when inserting the image.
Alan Third

reply via email to

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