LoginSignup
3
3

More than 5 years have passed since last update.

複数フォントを列挙して最初に見つかったフォントを使う

Last updated at Posted at 2014-09-17

こんな感じの関数を定義する:

(require 'cl)
(defun find-font (&rest fonts)
  "与えられたフォント FONTS で最初に見つかったフォントを返す"
  (find-if (lambda (f)
             (find-font (font-spec :name f)))
           fonts))

使い方:

(when window-system
  ;; 最初に見つかったフォントをデフォルトフォントに設定
  (let ((font (find-font "Ricty-11"
                         "Inconsolata-11"
                         "Monospace-11")))
    (if font (set-default-font font)))
3
3
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
3
3