bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#47074: Replace XPM icons with Unicode codepoints in customize/widget


From: Alan Third
Subject: bug#47074: Replace XPM icons with Unicode codepoints in customize/widgets
Date: Fri, 12 Mar 2021 18:21:24 +0000

On Fri, Mar 12, 2021 at 01:12:02AM +0100, Lars Ingebrigtsen wrote:
> Alan Third <alan@idiocy.org> writes:
> 
> > In fact, it's possible to build an SVG within Emacs that contains the
> > correct font details that will display at the correct size.
> >
> > Something like this:
> >
> > (require 'svg)
> > (let* ((scale (cadr (assoc :height (assoc 'default face-remapping-alist))))
> >        (height (* (/ (face-attribute 'default :height) 10) (if scale scale 
> > 1)))
> >        (family (face-attribute 'default :family))
> >        (img (svg-create height height
> >                     :font-size height
> >                     :font-family family)))
> >   (svg-circle img "0.5em" "0.5em" "0.5em")
> >   (insert "XX")
> >   (insert-image (svg-image img :ascent 'center))
> >   (insert "XX"))
> 
> Hm...  Isn't that basically what `image-compute-scaling-factor' does
> already, only on the `create-image' level?

Sort of, although this should produce an image that's the exact same
size as the text, which I don't think we can duplicate without making
image-compute-scaling-factor resize much more aggressively. Nor would
we want to, generally.

-- 
Alan Third





reply via email to

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