help-gnu-emacs
[Top][All Lists]
Advanced

[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
useful.

(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()
(interactive)
(if (eval 'ivan-fixed-font)
        (progn
          (set-frame-font 
"-adobe-courier-medium-r-normal--*-240-*-*-m-*-iso8859-1")
          ;; TBD remove hard coded value!
          (set-frame-height (selected-frame) 47)
          (setq ivan-fixed-font nil))
  (progn
        (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]