HIDPI顯示屏上的較大" xterm"字體


在適當的桌面環境中愉快地使用了不同的終端模擬器(例如KonsoleGnome-TERMINAL和最近的XFCE Terminal)幾年後,我決定使用具有 bitmap字體的老式xterm。它工作得很好,它支持Unicode,默認的fixed font family包含幾乎所有語言的字符,這很棒。


我的XFCE環境默認設置為120 dpi,但是xpdyinfo報告97x97 DPI

$ xdpyinfo |grep resolution
  resolution:    97x97 dots per inch


$ xrandr --dpi 120


$ xdpyinfo | grep resolution
  resolution:    120x120 dots per inch


$ xrandr --output LVDS1 --scale 0.5x0.5

workarounds for Qt and Gtk,但是基於Xlib的應用程序(如XtermXcalcXmanXfige等)呢?隨著顯示DPI上升,我們應該看著它們消失嗎?如果您有任何解決方法,請幫助。



$ sudo apt-get install xfonts-100dpi




$ xterm -font -Adobe-Courier-Bold-r-Normal-*-34-*-100-100-*-*-*-*



PS6:我可以通過 Courier New 和20pt來創建120DPI位圖字體

$ otf2bdf -p 20 -r 120 cour.ttf > cour.bdf
$ bdftopcf cour.bdf | gzip - > cour.pcf.gz
$ sudo cp cour.pcf.gz /usr/share/fonts/X11/misc/
$ fc-cache
$ xterm -font -*-*-*-*-*-*-*-*-120-120-*-*-*-*

PS7:75 DPI以BDF字體硬編碼。也許更改它會有所幫助。

PS8:vncdesk是用於scale up a single window的好工具。


Right now you can increase the font size by holding control and right mouse button(i.e ctrl+right mouse button) and select the font size. To make it default you need to have an Xresources configuration. I am trying it and I will update the answer once I get it.


You can create .Xresources file inside your home directory and add the below line xterm*font: *-fixed-*-*-*-18-*. Then merge your changes with the X server resource utility using xrdb(i.e xrdb -merge ~/.Xresources) or you can restart the X also. The new xterms should have the changed font size.


I'm not sure but you can maybe merge the font and the siz like this:

xterm -fn helvetica -fs 20x10

small test of fonts

regards, maniat1k


You have hinted the answer yourself by referencing https://en.wikipedia.org/wiki/Fixed_(typeface)

This is the standard fixed bitmap font which has been expanded by Markus Kuhn to have a rather complete character set. The question is then how to scale a bitmap.

What you have achieved so far is scaling a vector font and converting it to a bitmap (ttf → bdf → pcf). That is a fine strategy but as you mention it lacks some language support. That seems strange as Courier New is one of the more unicode complete fonts but I digress! Maybe try using Mono which is a clone.

I do however not understand why you are doing this as xterm does support truetype.

Modify ~/.Xresources such as this (note that you'll need to reload it using xrdb as seen in another answer to this question):

XTerm*renderFont: true
XTerm*faceName: VeraMono
XTerm*faceSize: 10

But back to the task: You want a larger bitmap font.

The largest available bitmap available is:

10x20   -Misc-Fixed-Medium-R-Normal--20-200-75-75-C-100-ISO10646-1

Markus have been so nice that he supplies the source BDF files. If your distribution does not have the most recent updates (from April 2009) you can grab the package directly from him.

The "-misc-fixed-*" font package:


Rather than converting back and forth between pcf and bdf you could/should stick to the source format. You can use a BDF font editor to resize the font. Do not expect any antialiasing or such trickery - but at least you can get a readable size.

Or you can use bdfresize by Hiroto Kagotani (also found in some package systems).


I do not know of a way to scale just one window (never had the need). You could track this Superuser question. When I have had the need I have scaled the entire environment.

You can downgrade a 3200x1800 display to 1920x1080 using:

xrandr --dpi 141
xrandr --output eDP1 --scale 0.6x0.6

Other tricks for screen scaling in different window managers can be found here. They suggest using VNC:

One approach is to run the application full screen and without decoration in its own VNC desktop. Then scale the viewer. With Vncdesk (vncdesk-git from the AUR) you can set up a desktop per application, then start server and client with a simple command such as vncdesk 2.

x11vnc has an experimental option -appshare, which opens one viewer per application window. Perhaps something could be hacked up with that.