4

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)?

licorna
  • 207
  • 1
  • 8
  • Emacs faces measure the size of the font in "points" rather than pixels, so presumably it should already take DPI into account. IOW, please M-x report-emacs-bug. – Stefan Oct 18 '16 at 13:24

2 Answers2

3

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")))

Chakravarthy Raghunandan
  • 3,192
  • 2
  • 19
  • 43
1

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.

licorna
  • 207
  • 1
  • 8