[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
get.
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
- Re: Using more and/or better icons in Emacs, (continued)
- Re: Using more and/or better icons in Emacs, Dmitry Gutov, 2021/04/09
- Re: Using more and/or better icons in Emacs, Stefan Kangas, 2021/04/09
- Re: Using more and/or better icons in Emacs, Dmitry Gutov, 2021/04/09
- Re: Using more and/or better icons in Emacs, Stefan Kangas, 2021/04/09
- Re: Using more and/or better icons in Emacs, Eli Zaretskii, 2021/04/09
- Re: Using more and/or better icons in Emacs, Alan Third, 2021/04/09
- Re: Using more and/or better icons in Emacs, Alan Third, 2021/04/09
- Re: Using more and/or better icons in Emacs, Dmitry Gutov, 2021/04/09
- Re: Using more and/or better icons in Emacs, Stefan Kangas, 2021/04/09
- Re: Using more and/or better icons in Emacs, Stefan Kangas, 2021/04/09
- Re: Using more and/or better icons in Emacs,
Alan Third <=
- Re: Using more and/or better icons in Emacs, Stefan Kangas, 2021/04/10
- Re: Using more and/or better icons in Emacs, Alan Third, 2021/04/10
- Re: Using more and/or better icons in Emacs, Alan Third, 2021/04/12
- Re: Using more and/or better icons in Emacs, Stefan Kangas, 2021/04/12
- Re: Using more and/or better icons in Emacs, Alan Third, 2021/04/13
- Re: Using more and/or better icons in Emacs, Stefan Kangas, 2021/04/13
- Re: Using more and/or better icons in Emacs, Alan Third, 2021/04/13
- Re: Using more and/or better icons in Emacs, Stefan Kangas, 2021/04/13
- Re: Using more and/or better icons in Emacs, Eli Zaretskii, 2021/04/14
- Re: Using more and/or better icons in Emacs, Alan Third, 2021/04/15