Getting the right font size in a trditional X application (Xman)
I use Xman as a simple man page reader but, when launched from my desktop, it uses too big a font and pages run over the edge even when I make it fullscreen. So I added a couple of lines to my .Xresources file as follows:
Code:
Xman.font.manualFontBold: -*-courier-medium-o-*-*-*-50-*-*-*-*-*-* Code:
userresources=$HOME/.Xresources What am I doing wrong? |
the usual answer is because it is overridden. I don't know your button bar, but probably that sets those resources somehow. Or your font specification is invalid and therefore some other font has been selected (which is different in the mentioned two cases).
|
The buttonbar (which I wrote myself) simply forks off graphical apps without arguments. It doesn't specify anything beyond that. The default resources for Xman are in /etc/X11/app-defaults.
Code:
*manualFontBold: -*-courier-bold-r-*-*-*-120-*-*-*-*-*-* |
I have experienced similar problems when I ampersand too many apps in my .xinitrc, and/or put them in the wrong order.
In other words, make sure the xrdb command is near the top, and has completed, before you start barbarella? Also, a -merge is not always sufficient as pan64 pointed out. You can check your actually valid Xresources with Code:
appres |
Code:
$ appres Xman Code:
$ xprop -root |
ok, here is mine, ubuntu 20.04 (without xrdb -merge):
Code:
$ appres Xman | grep -i font Code:
$ xman |
I don't get those warnings, but that's probably irrelevant.
As to the fonts, my guess is that the ones I have without the Xman prefix are the defaults from /etc/X11/app-defaults/Xman. In other words I have both the default and the prescribed versions in my merged resources database, and graphical launches continue to use the default ones. I suppose the solution is to change the defaults rather than fiddling around with a personal file and a merger. After all, a program like Xman is hardly likely to be upgraded within the lifetime of this release! |
The warning means the font does not exist, another one will be used instead.
Xman version 1.1.5, from somewhere 1989, 1990. By the way probably this helps (man page): Code:
XENVIRONMENT to get the name of a resource file that overrides the global resources stored in the |
I fiddled about a bit with Xman's default resources file and found that a font size of 100 is best overall. It requires a maximised window to display a readable man page (a smaller one will do for a contents list), but using a smaller font makes the page more difficult to read. The program now launches from the buttonbar in a satisfactory manner.
|
Quote:
That way you can define your font for almost everything with '*font: ...', but can still override it for specific applications: 'Xman*font: ...'. The logic is simple for anyone who understands shell globbing. In your example above, 'Xman.font.something' is very specific and should win - in case the resource is actually called Xman.font.something, and not e.g. 'Xman.manualFontNormal'? |
As I've said, it does override for instances launched from the shell. But not for instances launched graphically. Maybe window managers have shell scripts to handle the resources for programs launched from their menus, but obviously I didn't put anything of the kind into barbarella. It's just a simple fork and exec. Anyway, I've changed the default resources now and that solves the problem.
|
^ So you edited /etc/X11/app-defaults/Xman? Not very elegant. These old X apps do get updated sometimes.
If you're happy with your solution feel free to ignore me, but: Quote:
|
Good question. Barbarella isn't launched by .xinitrc but by fluxbox. There's a directory called .fluxbox/apps where you can put stuff you want to auto-launch. It allows you to specify the desktop you want the app to run on which is essential for barbarella; I want different buttonbars on different desktops because of the way I like to work.
The xrdb merge is done by .xinitrc before startfluxbox is executed. So the merge is certainly complete by then. Incidently, I have no idea where that .xinitrc file originally comes from. I copied it over from my earlier Slackware installation but I certainly didn't write it myself. |
All times are GMT -5. The time now is 03:25 AM. |