Subject: Re: two displays, one .Xdefaults
To: James K. Lowden <jklowden@schemamania.org>
From: Pavel Cahyna <pcah8322@artax.karlin.mff.cuni.cz>
List: netbsd-help
Date: 11/15/2005 19:16:15
On Mon, Nov 14, 2005 at 10:01:25PM -0500, James K. Lowden wrote:
> I have two very different Xservers for the same X client host:
> 
> $ for D in monarch '    oak'; do xdpyinfo -display $D:0.0 | sed -n
> "s/resolution/$D/p"; done
>   monarch:    75x75 dots per inch
>       oak:    123x126 dots per inch
> 
> A font size readable on monarch is illegible on oak; what's comfortable on
> oak is Computing for the Blind on monarch.  I control the font sizes for
> some applications (nedit, xterm) via .Xdefaults, which knows nothing about
> the server's display resolution.  

Use .Xresources instead. It is read by xrdb(1) when you start X (usually
form some xinitrc script) and loaded to the X server, unlike .Xdefaults,
which is read by every app when it starts. xrdb processes the .Xresources
file vith cpp, having defined some interesting macros like SERVERHOST,
X_RESOLUTION, Y_RESOLUTION and so on (see the manual). With some #ifdefs I
am sure you will be able to do what you want.

> I suspect I've stumbled on one of those broken-by-design aspects of X?  I
> mean, I shouldn't be specifying font *size* based on display resolution;
> the server should scale the font such that 9 points appears as 9 points
> and 14 points as 14 points.  To display a 10-point font in different sizes
> depending on screen resolution is to ignore the meaning of "point".  

Newer apps (GTK 2 for example) are doing exactly that AFAIK. For xterm, try:

xterm -fa "Terminal" -fs 8

The 8 should be in points, not pixels, so I hope the font size will adapt
to the display resolution. Please tell if this works.

Bye	Pavel