I have two displays and different frames on each. Each display has very different DPI so I need different fonts sizes for them.
How can I set different fonts sizes for different frames (font size changes not applied globally)?
You could also change font like so :- (set-frame-font "PragmataPro 13")
,
where the 2nd argument is the size you want to use.
EDIT: if you are running emacsclient by connecting to an emacs daemon process, the above answer will not work. Instead put this in your init.el
: (setq default-frame-alist '((font . "PragmataPro-13")))
(modify-frame-parameters nil (list (cons 'font YOUR-CHOSEN-FONT)))
.
– Drew
Oct 18 '16 at 14:19
I figured out the second parameter of set-face-attribute
correspond to what frame you want the face-attribute to change so:
;; on my retina display (2880x1800)
(set-face-attribute 'default (selected-frame) :font "Source Code Pro" :height 140 :weight 'medium)
;; on my 4k external display (3840 x 2160)
(set-face-attribute 'default (selected-frame) :font "Source Code Pro" :height 210 :weight 'medium)
In this case I'm only changing the font :height
. Anyway, I'm setting this as valid answer because it is the one I will be using.
M-x report-emacs-bug
. – Stefan Oct 18 '16 at 13:24