Move iosevka changes into pretty-code/autoload
This commit is contained in:
parent
3a257cfc56
commit
2e15387999
3 changed files with 53 additions and 52 deletions
|
@ -230,54 +230,3 @@
|
||||||
+pretty-code-iosevka-font-ligatures)))
|
+pretty-code-iosevka-font-ligatures)))
|
||||||
|
|
||||||
(add-hook 'doom-init-ui-hook #'+pretty-code-setup-iosevka-ligatures-h)
|
(add-hook 'doom-init-ui-hook #'+pretty-code-setup-iosevka-ligatures-h)
|
||||||
|
|
||||||
(defvar +pretty-code--iosevka-font-names
|
|
||||||
'(
|
|
||||||
"iosevka-custom-lightoblique.ttf"
|
|
||||||
"iosevka-custom-thinoblique.ttf"
|
|
||||||
"iosevka-custom-mediumitalic.ttf"
|
|
||||||
"iosevka-custom-light.ttf"
|
|
||||||
"iosevka-custom-heavy.ttf"
|
|
||||||
"iosevka-custom-bolditalic.ttf"
|
|
||||||
"iosevka-custom-bold.ttf"
|
|
||||||
"iosevka-custom-lightitalic.ttf"
|
|
||||||
"iosevka-custom-thin.ttf"
|
|
||||||
"iosevka-custom-extralight.ttf"
|
|
||||||
"iosevka-custom-oblique.ttf"
|
|
||||||
"iosevka-custom-italic.ttf"
|
|
||||||
"iosevka-custom-heavyoblique.ttf"
|
|
||||||
"iosevka-custom-heavyitalic.ttf"
|
|
||||||
"iosevka-custom-extralightitalic.ttf"
|
|
||||||
"iosevka-custom-thinitalic.ttf"
|
|
||||||
"iosevka-custom-medium.ttf"
|
|
||||||
"iosevka-custom-mediumoblique.ttf"
|
|
||||||
"iosevka-custom-extralightoblique.ttf"
|
|
||||||
"iosevka-custom-boldoblique.ttf"
|
|
||||||
"iosevka-custom-regular.ttf"))
|
|
||||||
|
|
||||||
(defun +pretty-code/install-iosevka-font (&optional pfx)
|
|
||||||
"Helper function to download and install Iosevka font based on OS.
|
|
||||||
When PFX is non-nil, ignore the prompt and just install"
|
|
||||||
(interactive "P")
|
|
||||||
(when (or pfx (yes-or-no-p "This will download and install the Iosevka fonts, are you sure you want to do this?"))
|
|
||||||
(let* ((url-format "https://github.com/jsravn/iosevka-emacs/raw/master/%s")
|
|
||||||
(font-dest (cl-case window-system
|
|
||||||
(x (concat (or (getenv "XDG_DATA_HOME") ;; Default Linux install directories
|
|
||||||
(concat (getenv "HOME") "/.local/share"))
|
|
||||||
"/fonts/"))
|
|
||||||
(mac (concat (getenv "HOME") "/Library/Fonts/" ))
|
|
||||||
(ns (concat (getenv "HOME") "/Library/Fonts/" )))) ;; Default MacOS install directory
|
|
||||||
(known-dest? (stringp font-dest))
|
|
||||||
(font-dest (or font-dest (read-directory-name "Font installation directory: " "~/"))))
|
|
||||||
|
|
||||||
(unless (file-directory-p font-dest) (mkdir font-dest t))
|
|
||||||
|
|
||||||
(dolist (font +pretty-code--iosevka-font-names)
|
|
||||||
(url-copy-file (format url-format font) (expand-file-name font font-dest) t))
|
|
||||||
|
|
||||||
(when known-dest?
|
|
||||||
(message "Font downloaded, updating font cache... <fc-cache -f -v> ")
|
|
||||||
(shell-command-to-string (format "fc-cache -f -v")))
|
|
||||||
(message "Successfully %s `Iosevka' fonts to `%s'!"
|
|
||||||
(if known-dest? "installed" "downloaded")
|
|
||||||
font-dest))))
|
|
||||||
|
|
52
modules/ui/pretty-code/autoload/iosevka.el
Normal file
52
modules/ui/pretty-code/autoload/iosevka.el
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
;;; ui/pretty-code/autoload/iosevka.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(defvar +pretty-code--iosevka-font-names
|
||||||
|
'(
|
||||||
|
"iosevka-custom-lightoblique.ttf"
|
||||||
|
"iosevka-custom-thinoblique.ttf"
|
||||||
|
"iosevka-custom-mediumitalic.ttf"
|
||||||
|
"iosevka-custom-light.ttf"
|
||||||
|
"iosevka-custom-heavy.ttf"
|
||||||
|
"iosevka-custom-bolditalic.ttf"
|
||||||
|
"iosevka-custom-bold.ttf"
|
||||||
|
"iosevka-custom-lightitalic.ttf"
|
||||||
|
"iosevka-custom-thin.ttf"
|
||||||
|
"iosevka-custom-extralight.ttf"
|
||||||
|
"iosevka-custom-oblique.ttf"
|
||||||
|
"iosevka-custom-italic.ttf"
|
||||||
|
"iosevka-custom-heavyoblique.ttf"
|
||||||
|
"iosevka-custom-heavyitalic.ttf"
|
||||||
|
"iosevka-custom-extralightitalic.ttf"
|
||||||
|
"iosevka-custom-thinitalic.ttf"
|
||||||
|
"iosevka-custom-medium.ttf"
|
||||||
|
"iosevka-custom-mediumoblique.ttf"
|
||||||
|
"iosevka-custom-extralightoblique.ttf"
|
||||||
|
"iosevka-custom-boldoblique.ttf"
|
||||||
|
"iosevka-custom-regular.ttf"))
|
||||||
|
|
||||||
|
(defun +pretty-code/install-iosevka-font (&optional pfx)
|
||||||
|
"Helper function to download and install Iosevka font based on OS.
|
||||||
|
When PFX is non-nil, ignore the prompt and just install"
|
||||||
|
(interactive "P")
|
||||||
|
(when (or pfx (yes-or-no-p "This will download and install the Iosevka fonts, are you sure you want to do this?"))
|
||||||
|
(let* ((url-format "https://github.com/jsravn/iosevka-emacs/raw/master/%s")
|
||||||
|
(font-dest (cl-case window-system
|
||||||
|
(x (concat (or (getenv "XDG_DATA_HOME") ;; Default Linux install directories
|
||||||
|
(concat (getenv "HOME") "/.local/share"))
|
||||||
|
"/fonts/"))
|
||||||
|
(mac (concat (getenv "HOME") "/Library/Fonts/" ))
|
||||||
|
(ns (concat (getenv "HOME") "/Library/Fonts/" )))) ;; Default MacOS install directory
|
||||||
|
(known-dest? (stringp font-dest))
|
||||||
|
(font-dest (or font-dest (read-directory-name "Font installation directory: " "~/"))))
|
||||||
|
|
||||||
|
(unless (file-directory-p font-dest) (mkdir font-dest t))
|
||||||
|
|
||||||
|
(dolist (font +pretty-code--iosevka-font-names)
|
||||||
|
(url-copy-file (format url-format font) (expand-file-name font font-dest) t))
|
||||||
|
|
||||||
|
(when known-dest?
|
||||||
|
(message "Font downloaded, updating font cache... <fc-cache -f -v> ")
|
||||||
|
(shell-command-to-string (format "fc-cache -f -v")))
|
||||||
|
(message "Successfully %s `Iosevka' fonts to `%s'!"
|
||||||
|
(if known-dest? "installed" "downloaded")
|
||||||
|
font-dest))))
|
|
@ -1,4 +1,4 @@
|
||||||
;;; ui/pretty-code/settings.el -*- lexical-binding: t; -*-
|
;;; ui/pretty-code/autoload/pretty-code.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defvar +pretty-code-symbols-alist '((t))
|
(defvar +pretty-code-symbols-alist '((t))
|
Loading…
Add table
Add a link
Reference in a new issue