How to set font for frame on hiDPI screen?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to set font for frame on hiDPI screen?

HaiJun Zhang
export GDK_SCALE=2
emacs -Q

The font size is good. Then I eval ‘(set-frame-font “Monospace:size=16”)’. The font becomes too small now. It works well on non-hiDPI screen.

Reply | Threaded
Open this post in threaded view
|

Re: How to set font for frame on hiDPI screen?

Eli Zaretskii
> Date: Tue, 14 Jan 2020 15:41:44 +0800
> From: HaiJun Zhang <[hidden email]>
>
> export GDK_SCALE=2
> emacs -Q
>
> The font size is good. Then I eval ‘(set-frame-font “Monospace:size=16”)’. The font becomes too small now. It works well on non-hiDPI screen.

In what version of Emacs, and how was it compiled?

Reply | Threaded
Open this post in threaded view
|

Re: How to set font for frame on hiDPI screen?

HaiJun Zhang
在 2020年1月14日 +0800 PM11:35,Eli Zaretskii <[hidden email]>,写道:

> > Date: Tue, 14 Jan 2020 15:41:44 +0800
> > From: HaiJun Zhang <[hidden email]>
> >
> > export GDK_SCALE=2
> > emacs -Q
> >
> > The font size is good. Then I eval ‘(set-frame-font “Monospace:size=16”)’. The font becomes too small now. It works well on non-hiDPI screen.
>
> In what version of Emacs, and how was it compiled?
>

Emacs: 26.3.

I have found a resolution. Changing ‘(set-frame-font “Monospace:size=16”)’ to ‘(set-frame-font “Monospace 16”)’ fixes it.

Does the size in the former means pixel size? And the latter means font size?