ui/pretty-code: Added support for PragmataPro font

This commit is contained in:
Aidan Gilmore 2018-07-07 17:55:26 -04:00
parent ee91748613
commit b8179ca236
No known key found for this signature in database
GPG key ID: F92E3698096A0D3B
4 changed files with 223 additions and 13 deletions

View file

@ -44,6 +44,19 @@ font.")
"An alist containing a mapping of major modes to its value for
`prettify-symbols-alist'.")
;;;###autodef
(defun +pretty-code--correct-symbol-bounds (ligature-alist)
"Prepend non-breaking spaces to a ligature.
This way `compose-region' (called by `prettify-symbols-mode') will use the
correct width of the symbols instead of the width measured by `char-width'."
(let ((len (length (car ligature-alist)))
(acc (list (cdr ligature-alist))))
(while (> len 1)
(setq acc (cons #X00a0 (cons '(Br . Bl) acc))
len (1- len)))
(cons (car ligature-alist) acc)))
;;;###autodef
(defun set-pretty-symbols! (modes &rest rest)
"Associates string patterns with icons in certain major-modes.