From bf6781ee8ee10fd15f77406f00bdc3ed963fb4ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pankowski?= Date: Fri, 31 Aug 2018 21:05:35 +0200 Subject: [PATCH] my-set-frame-font instead of two font specific function --- init.el | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/init.el b/init.el index 0caec16..97b504d 100644 --- a/init.el +++ b/init.el @@ -909,20 +909,19 @@ inserted between the braces between the braces." (menu-bar-mode 0) (tool-bar-mode 0) -(defun set-frame-font-inconsolata (size &optional frames) - "Set font to Inconsolata:pixelsize=SIZE:antialias=true:autohint=false. -Argument FRAMES has the same meaning as for `set-frame-font'" - (interactive "n[Inconsolata] size: ") - (set-frame-font - (format "Inconsolata:pixelsize=%d:antialias=true:autohint=true" size) - nil frames)) +(setq my-font-list '("Inconsolata" "Go mono" "mononoki")) -(defun set-frame-font-go-mono (size &optional frames) - "Set font to Go mono:pixelsize=SIZE:antialias=true:autohint=false. +(defun my-set-frame-font (font-name size &optional frames) + "Set font to one of the fonts from `my-font-list' Argument FRAMES has the same meaning as for `set-frame-font'" - (interactive "n[Go mono] size: ") + (interactive + (list (helm :prompt "Font name: " + :sources (helm-build-sync-source "Fonts" + :candidates my-font-list) + :buffer "*font selection*") + (read-number "Font size: "))) (set-frame-font - (format "Go mono:pixelsize=%d:antialias=true:autohint=true" size) + (format "%s:pixelsize=%d:antialias=true:autohint=true" font-name size) nil frames)) (use-package powerline