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: Lars Ingebrigtsen
Subject: bug#47074: Replace XPM icons with Unicode codepoints in customize/widgets
Date: Fri, 12 Mar 2021 01:12:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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?

> Alas it doesn't resize the image as you scale with C-x C-+.
>
> Perhaps there is some way to mark certain SVGs as part of the UI and
> regenerate them?

Yes, doing so should be easy enough.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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