1 Star 0 Fork 0

colawithsauce / emacs.d

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
init-fonts.el 2.20 KB
一键复制 编辑 原始数据 按行查看 历史
;; -*- lexical-binding: t; -*-
;; setting fonts
(use-package faces
:custom-face
(variable-pitch
((t (:font ,(font-xlfd-name (font-spec :family "Iosevka"
:foundry "Outline"
;; If we do not specify this, Emacs
;; selects ascii and we miss accents
:registry "iso10646-1"))
:slant normal :weight normal
:height 138 :width normal))))
(default
((t (:font ,(font-xlfd-name (font-spec :family "Comic Mono"
:foundry "Outline"
;; If we do not specify this, Emacs
;; selects ascii and we miss accents
:registry "iso10646-1"))
:slant normal :weight normal
:height 140 :width normal))))
(fixed-pitch
((t (:inherit default))))
:config
(defun colawithsauce/set-unicode-fonts (&optional frame)
"Setting unicode-char fonts for emacs."
;; Use Noto for everything to get consistent view
;; Chinese, simplified
(set-fontset-font t 'unicode (font-spec :family "Sarasa Mono Slab SC" :weight 'normal) frame)
;; Symbols, including b/w emoji
(set-fontset-font t 'symbol "Apple Color Emoji" frame 'prepend))
;; For initial frame
(add-hook 'after-init-hook #'colawithsauce/set-unicode-fonts)
(add-hook 'after-make-frame-functions #'colawithsauce/set-unicode-fonts)
;; Rescale to restrict font into same height.
(add-to-list 'face-font-rescale-alist '("Apple Color Emoji" . 0.9))
(add-to-list 'face-font-rescale-alist '("Sarasa Mono Slab SC" . 0.88))
;; Disable font rescale in variable-pitch mode
(defun colawithsauce/disable-rescale-maybe ()
"remove stuffs in `face-font-scale-alist' when in buffer-face-mode."
(if buffer-face-mode
(setq-local face-font-rescale-alist nil)
(setq-local face-font-rescale-alist '(("Sarasa Mono Slab SC" . 0.88) ("Apple Color Emoji" . 0.9) ("-cdac$" . 1.3)))))
(add-hook
'buffer-face-mode-hook #'colawithsauce/disable-rescale-maybe)
)
(provide 'init-fonts)
1
https://gitee.com/colawithsauce/emacs.d.git
git@gitee.com:colawithsauce/emacs.d.git
colawithsauce
emacs.d
emacs.d
master

搜索帮助