For lack of a better term.
- Update Andrea’s image.
| ;; --------------------------------------------------------------------- | |
| ;; Tag minor mode | |
| ;; Copyright (C) 2020 Nicolas .P Rougier | |
| ;; | |
| ;; This program is free software; you can redistribute it and/or modify | |
| ;; it under the terms of the GNU General Public License as published by | |
| ;; the Free Software Foundation, either version 3 of the License, or | |
| ;; (at your option) any later version. | |
| ;; | |
| ;; This program is distributed in the hope that it will be useful, |
| ;; An experiment for an SVG toolbar using icons from material.io | |
| ;; | |
| ;; Example usage: (toolbar 48 "black" "white" t t) | |
| ;; Material icons freely available (Apache 2 license) from | |
| ;; - https://material.io/resources/icons/?style=outline | |
| ;; - https://github.com/google/material-design-icons | |
| (require 'xml) (require 'svg) | |
| (defun toobar-item (label icon fg-color bg-color size with-icon with-label) |
| ;; Score out this text | |
| (require 'svg) | |
| (defun replace-text (start end) | |
| (let* ((str (buffer-substring start end)) | |
| (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))) | |
| (img (svg-create (car (window-text-pixel-size nil start end)) |