blob b764d1999df172280a3bc31f4994634a5a5a4468 1283 bytes (raw)
name: generated-image-specs.el # note: path name is non-authoritative(*)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
| | (require 'svg)
(defun generate-circle-image (alist)
(let* ((vsize (font-get (alist-get :font alist) :size))
(foreground (apply #'color-rgb-to-hex (nconc (color-name-to-rgb (alist-get :foreground alist)) (list 2))))
(background (apply #'color-rgb-to-hex (nconc (color-name-to-rgb (alist-get :background alist)) (list 2))))
(hsize (* vsize .8))
(svg (svg-create hsize vsize))
(sw (* .1 hsize)))
(svg-rectangle svg 0 0 hsize vsize :fill background)
(svg-circle svg (* hsize .5)
(- (* .8 vsize) (* .5 hsize))
(- (* hsize .5) sw)
:fill "none"
:stroke foreground
:stroke-width sw)
(svg-line svg
(* hsize .5) (- (* .8 vsize) (* .5 hsize))
(* hsize .5) (- (* .8 vsize) sw)
:stroke foreground
:stroke-width sw)
(svg-circle svg (* hsize .5) (- (* .8 vsize) (* (/ 2.0 3.0) hsize))
sw
:fill foreground
:stroke "none")
(let ((ret (svg-image svg)))
(setcdr ret (plist-put (cdr ret) :scale 1.0))
(setcdr ret (plist-put (cdr ret) :ascent 80))
ret)))
(insert (propertize " " 'display `(generated-spec ,#'generate-circle-image)))
|
debug log:
solving b764d1999d ...
found b764d1999d in https://yhetil.org/emacs-bugs/CAOqdjBcX0WgmJenStzb-4s0pnnTWm3rzxHiXFJSzMUM-H4zULQ@mail.gmail.com/
applying [1/1] https://yhetil.org/emacs-bugs/CAOqdjBcX0WgmJenStzb-4s0pnnTWm3rzxHiXFJSzMUM-H4zULQ@mail.gmail.com/
diff --git a/generated-image-specs.el b/generated-image-specs.el
new file mode 100644
index 0000000000..b764d1999d
Checking patch generated-image-specs.el...
Applied patch generated-image-specs.el cleanly.
index at:
100644 b764d1999df172280a3bc31f4994634a5a5a4468 generated-image-specs.el
(*) Git path names are given by the tree(s) the blob belongs to.
Blobs themselves have no identifier aside from the hash of its contents.^
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).