1 Star 0 Fork 2

zhengchen/emacs

forked from latpaw/emacs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
init-fonts.el 1.72 KB
一键复制 编辑 原始数据 按行查看 历史
root 提交于 2013-07-18 16:40 . init
(require 'cl)
(defun font-name-replace-size (font-name new-size)
(let ((parts (split-string font-name "-")))
(setcar (nthcdr 7 parts) (format "%d" new-size))
(mapconcat 'identity parts "-")))
(defun increment-default-font-height (delta)
"Adjust the default font height by DELTA on every frame.
The pixel size of the frame is kept (approximately) the same.
DELTA should be a multiple of 10, in the units used by the
:height face attribute."
(let* ((new-height (+ (face-attribute 'default :height) delta))
(new-point-height (/ new-height 10)))
(dolist (f (frame-list))
(with-selected-frame f
;; Latest 'set-frame-font supports a "frames" arg, but
;; we cater to Emacs 23 by looping instead.
(set-frame-font (font-name-replace-size (face-font 'default)
new-point-height)
t)))
(set-face-attribute 'default nil :height new-height)
(message "default font size is now %d" new-point-height)))
(defun increase-default-font-height ()
(interactive)
(increment-default-font-height 10))
(defun decrease-default-font-height ()
(interactive)
(increment-default-font-height -10))
(global-set-key (kbd "C-M-=") 'increase-default-font-height)
(global-set-key (kbd "C-M--") 'decrease-default-font-height)
(set-fontset-font (frame-parameter nil 'font)
'han '("WenQuanYi Zen Hei" . "unicode-bmp"))
(set-fontset-font (frame-parameter nil 'font)
'cjk-misc '("WenQuanYi Zen Hei" . "unicode-bmp"))
(set-fontset-font (frame-parameter nil 'font)
'kana '("WenQuanYi Zen Hei" . "unicode-bmp"))
(set-fontset-font (frame-parameter nil 'font)
'symbol '("WenQuanYi Zen Hei" . "unicode-bmp"))
(provide 'init-fonts)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cowboy13/emacs.git
git@gitee.com:cowboy13/emacs.git
cowboy13
emacs
emacs
master

搜索帮助