How to refresh font setting without restart Emacs?
Asked Answered
O

2

10

Problem solved

I decided to use a scale customized font named Ricty. It was a easier way.

--

I'm setting Emacs font size by using face-font-rescale-alist like followings.

(create-fontset-from-ascii-font "Inconsolata-12:weight=normal:slant=normal" nil "myfavoritefontset")
(set-fontset-font "fontset-myfavoritefontset"
          'japanese-jisx0208
          (font-spec :family "TakaoExGothic" :size 12)
          nil
          'append)
(add-to-list 'default-frame-alist '(font . "fontset-myfavoritefontset"))
(setq face-font-rescale-alist
    '(("^-apple-hiragino.*" . 1.2)
      (".*osaka-bold.*" . 1.2)
      (".*osaka-medium.*" . 1.2)
      (".*courier-bold-.*-mac-roman" . 1.0)
      (".*monaco cy-bold-.*-mac-cyrillic" . 0.9)
      (".*monaco-bold-.*-mac-roman" . 0.9)
      ("-cdac$" . 1.3)
      (".*Inconsolata.*" . 1.0)))

from http://d.hatena.ne.jp/shammer/20120811/1344701212

To check the size of font I restart Emacs each time when I change the values.

How can I refresh font size without restarting Emacs?

Ora answered 5/8, 2013 at 7:57 Comment(4)
What's a "ricty"? All the Google hits seem to be in Japanese.Fare
As I added a short explanation in question. Ricty is a combined font that is showed proper scale in several language. (Especially in Japanese and English alphabet.)Ora
Did you find a way to do so? Change font-size without restarting EmacsDeering
I'm having the same question. Did you find a solution?Wagoner
B
2

You can highlight the expression that you want to evaluate and do M-x eval-region RET

Barrybarrymore answered 5/8, 2013 at 15:43 Comment(1)
Thanks for reply. I evaluated the variable face-font-rescale-alist. But the size of fonts does not change. I think I need to evaluate some function to reflect the change.Ora
P
1

Here's what I use:

(global-set-key (kbd "<f2> g") 'text-scale-increase)
(global-set-key (kbd "<f2> l") 'text-scale-decrease)
Penstemon answered 5/8, 2013 at 8:56 Comment(1)
Thanks for your info. But I wanted to rescale fonts respectively.Ora

© 2022 - 2024 — McMap. All rights reserved.