I've been doing experiments at displaying static text images in the mode-line using Imagemagick to generate the image (see below). I would like now to generate such an image in a dynamic way, providing information from within Emacs. For example, I could display the current major mode or the cursor line/column (might be slow).
My question is how to dynamically generate the image according to the provided information (e.g. how to call and pass arguments to Imagemagick). Displaying line/column using image Imagemagick might very slow but still, I would like to try.
Imagemagick command used for the screenshot:
convert -antialias -background none -fill white -family Roboto -weight regular -gravity southeast -size 64x42 -pointsize 20 label:"Emacs\nv26.3" label.png
And in the modeline (header line in my case):
(propertize " " 'display (create-image "~/label.png" 'png nil :ascent 90 ))
eval
form intomode-line-format
. – Yuan Fu Jun 3 '20 at 1:45