LoginSignup
5
5

More than 5 years have passed since last update.

emacsで手書きフォントを使う

Last updated at Posted at 2016-06-16

windowsのemacsでプロポーショナルフォントが使えるように設定できたので、手書きフォントも使えるようにしてみた。

init.el
(create-fontset-from-ascii-font
 "Comic Sans MS:weight=normal:slant=normal" nil "handwritten")
(set-fontset-font "fontset-handwritten" 'japanese-jisx0208
          (font-spec :family "S2GP海フォント"))
(add-to-list 'face-font-rescale-alist '("S2GP海フォント" . 1.09))
(defface handwritten
  '((default . (:family "Comic Sans MS"))) "手書きフォント")
;; (defface handwritten
;;   '((default . (:family "S2GP海フォント"))) "手書きフォント")
(set-face-attribute 'handwritten nil :fontset "fontset-handwritten")

(require 'face-remap)
(defun handwritten-face-mode (&optional arg)
  "handwritten-face mode.
An interface to `buffer-face-mode' which uses the `handwritten' face.
Besides the choice of face, it is the same as `buffer-face-mode'."
  (interactive (list (or current-prefix-arg 'toggle)))
  (buffer-face-mode-invoke 'handwritten arg
               (called-interactively-p 'interactive)))

comic.png

ascii文字もS2GP海フォントにすることもできるが、このフォントにはイタリック体がないのでComic Sans MSにした。ascii文字もS2GP海フォントにする場合はdeffaceの部分を変更する。

参考:
http://s2g.jp/font/index.htm

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5