[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Toggle Fonts without font-menue

From: Ivan Kanis
Subject: Re: Toggle Fonts without font-menue
Date: 25 Sep 2002 19:45:49 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

    David> Well yes, the fontset solution is probably more elegant!
    David> But I'm not really an expert in these things and simply
    David> switching the default is an easy way of obtaining my
    David> goal.

Well I am embarassed to post this code here because it is butt
ugly. It seems to do what you want. You just need to replace "fixed"
and "adobe-...." with the fonts you need. It is bound to C-c j but you
can bind to whatever key combination you want. Hope you find it

(global-set-key "\C-cj" 'my-toggle-font)

; Toggle between large and small font, the large font is useful for reading
; Japanese
(setq ivan-fixed-font t)

(defun my-toggle-font()
(if (eval 'ivan-fixed-font)
          ;; TBD remove hard coded value!
          (set-frame-height (selected-frame) 47)
          (setq ivan-fixed-font nil))
        (set-frame-font "fixed")
          ;; TBD remove hard coded value!
          (set-frame-height (selected-frame) 87)
        (setq ivan-fixed-font t))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]