我还想在我的.emacs
文件中保存字体大小.
(set-face-attribute 'default nil :height 100)
该值为1/10pt,因此100将给你10pt等.
来自Emacswiki,GNU Emacs 23有一个内置的组合键:
C-xC-+并C-xC--增加或减少缓冲区文本大小
按Shift键和第一个鼠标按钮.您可以通过以下方式更改字体大小: 此网站有更多详细信息.
M-x customize-face RET default将允许您设置default
面部,所有其他面部基于该面部.在那里你可以设置font-size.
这是我的.emacs中的内容.实际上,颜色主题将设置基础,然后我的自定义面部设置将覆盖一些东西.custom-set-faces由emacs的自定义面机制编写:
;; my colour theme is whateveryouwant :) (require 'color-theme) (color-theme-initialize) (color-theme-whateveryouwant) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(default ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "unknown" :family "DejaVu Sans Mono")))) '(font-lock-comment-face ((t (:foreground "darkorange4")))) '(font-lock-function-name-face ((t (:foreground "navy")))) '(font-lock-keyword-face ((t (:foreground "red4")))) '(font-lock-type-face ((t (:foreground "black")))) '(linum ((t (:inherit shadow :background "gray95")))) '(mode-line ((t (nil nil nil nil :background "grey90" (:line-width -1 :color nil :style released-button) "black" :box nil :width condensed :foundry "unknown" :family "DejaVu Sans Mono")))))
这是另一个简单的解决方案 也适用于24
(set-default-font "Monaco 14")
捷径:
`C-+` increases font size `C--` Decreases font size
我有以下内容.emacs
:
(defun fontify-frame (frame) (set-frame-parameter frame 'font "Monospace-11")) ;; Fontify current frame (fontify-frame nil) ;; Fontify any future frames (push 'fontify-frame after-make-frame-functions)
您可以替换您选择的任何字体"Monospace-11"
.可用选项集与系统高度相关.使用M-x set-default-font
和查看选项卡完成将为您提供一些想法.在我的系统,使用Emacs 23和启用抗锯齿,可以选择按名称,例如,系统字体Monospace
,Sans Serif
等等.
在X11中打开emacs,转到菜单选项,选择"设置默认字体...",更改字体大小.在同一菜单中选择"保存选项".完成.
zoom.cfg和global-zoom.cfg提供字体大小更改绑定(来自EmacsWiki)
C--或C-mousewheel-up:增加字体大小.
C- +或C-鼠标滚轮:减小字体大小.
C-0将字体大小恢复为默认值.
以下是交互式调整字体高度大小的选项,一次一个:
;; font sizes (global-set-key (kbd "s-=") (lambda () (interactive) (let ((old-face-attribute (face-attribute 'default :height))) (set-face-attribute 'default nil :height (+ old-face-attribute 10))))) (global-set-key (kbd "s--") (lambda () (interactive) (let ((old-face-attribute (face-attribute 'default :height))) (set-face-attribute 'default nil :height (- old-face-attribute 10)))))
当您想要调整所有缓冲区中的文本大小时,这是首选.我不喜欢使用解决方案text-scale-increase
,text-scale-decrease
因为排水沟中的行号可能会被切断.
Firefox和其他程序允许您使用C- +和C--增加和减少字体大小.我设置了我的.emacs,以便通过添加以下代码行来获得相同的能力:
(global-set-key [C-kp-add] 'text-scale-increase) (global-set-key [C-kp-subtract] 'text-scale-decrease)