Making xpdf usable on HiDPI with .Xresources

I now have a 4K-screen, and immediately some programs became unusable. Everything KDE just worked. URxvt and XTerm just needed an OpenType font specified instead of the old “fixed” one.

Like this:

xterm*faceName: Monospace
xterm*faceSize: 10

and this

URxvt.font:     xft:bitstream vera sans mono:size=14:antialias=true
URxvt.boldFont: xft:bitstream vera sans mono:bold:size=14:antialias=true

But some were more elusive, most notably, because they’re badly documented on the net, and information is difficult to find because the motif-toolkit is very ancient. One of them is xpdf. Whose UI sported tiny fonts.

But I managed to produce a somewhat decent .Xresources (either put them into .Xdefaults; or put them into .Xresources and merge in via xrdb -merge .Xresouces).

The font really needs to be specified in the old fontList way, and I couldn’t find out how to make it use a modern OpenType font.

The rest is mostly to turn off superfluous borders and heavy shadows.

Xpdf*fontList: -*-lucida-medium-r-*-*-20-*-*-*-*-*-*-*
Xpdf*XmText.background: #ffffff
Xpdf*XmTextField.background: #ffffff
Xpdf*XmList.background: #ffffff
Xpdf*GraphEdit.background: #ffffff
Xpdf*shadowThickness: 1
Xpdf*borderThickness: 0
Xpdf*?*arg*shadowThickness: 1
Xpdf*?*arg*borderThickness: 0
Xpdf*?*buttons*shadowThickness: 1
Xpdf*?*buttons*borderThickness: 0
Xpdf*XmToggleButton*shadowThickness: 0
Xpdf*XmToggleButton*borderThickness: 0
Xpdf*menubar.shadowThickness: 0
Xpdf*menubar.borderThickness: 0
Xpdf*XmMenuShell*XmTearOffButton*ShadowThickness: 2
Xpdf*main_window.?.borderThickness: 0
Xpdf*main_window.shadowThickness: 0
Xpdf*cutCopyPasteBindings: KDE
Xpdf*selectAllBindings: KDE
Xpdf*buttonColorKey: c
Xpdf*FlatButtons: on

And you especially want it to start in a decent size. You can set this in .pdfrc, but this replaces it:

Xpdf*initialZoom: 200

Comments are closed.