LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-16-2022, 05:15 AM   #1
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
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-*-*-*-*-*-*
Xman.font.manualFontItalic:     -*-courier-medium-o-*-*-*-50-*-*-*-*-*-*
Xman.font.manualFontNormal:     -*-courier-medium-r-*-*-*-50-*-*-*-*-*-*
My .xinitrc includes the lines:
Code:
userresources=$HOME/.Xresources
...
if [ -f $userresources ]; then
    xrdb -merge $userresources
fi
So as I understand it, those fonts should override the larger default fonts. They do if I launch Xman from a terminal but not when I launch it from my buttonbar app.

What am I doing wrong?
 
Old 04-17-2022, 08:34 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
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).
 
Old 04-17-2022, 09:30 AM   #3
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574

Original Poster
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
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-*-*-*-*-*-*
*manualFontItalic:              -*-courier-medium-o-*-*-*-120-*-*-*-*-*-*
*manualFontNormal:              -*-courier-medium-r-*-*-*-120-*-*-*-*-*-*
I used those lines as a model for my version, just using a smaller font, as you will see if you compare the default with what I put in my .Xresources file. But what actually does xrdb -merge do when your local .Xresources and the default version clash?

Last edited by hazel; 04-17-2022 at 09:33 AM.
 
Old 04-18-2022, 02:05 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
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
appres xman
appres Xman
xprop -root
 
1 members found this post helpful.
Old 04-18-2022, 04:16 AM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574

Original Poster
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
Code:
$ appres Xman
...
Xman.font.manualFontBold:       -*-courier-bold-r-*-*-*-50-*-*-*-*-*-*
Xman.font.manualFontItalic:     -*-courier-medium-o-*-*-*-50-*-*-*-*-*-*
Xman.font.manualFontNormal:     -*-courier-medium-r-*-*-*-50-*-*-*-*-*-*
*manualFontItalic:      -*-courier-medium-o-*-*-*-120-*-*-*-*-*-*
*input: True
......
*manualFontNormal:      -*-courier-medium-r-*-*-*-120-*-*-*-*-*-*
*manualFontBold:        -*-courier-bold-r-*-*-*-120-*-*-*-*-*-*
Interesting. There are some additional fonts that I haven't shrunk. I'll modify those too.
Code:
$ xprop -root
CUT_BUFFER0(STRING) = "RESOURCE_MANAGER(STRING) = \"XTerm.vt100.background:\\tblack\\nXTerm.vt100.foreground:\\twhite\\nXman.font.manualFontBold:\\t-*-courier-bold-r-*-*-*-50-*-*-*-*-*-*\\nXman.font.manualFontItalic:\\t-*-courier-medium-o-*-*-*-50-*-*-*-*-*-*\\nXman.font.manualFontNormal:\\t-*-courier-medium-r-*-*-*-50-*-*-*-*-*-*\\n\"\n"
...
RESOURCE_MANAGER(STRING) = "XTerm.vt100.background:\tblack\nXTerm.vt100.foreground:\twhite\nXman.font.manualFontBold:\t-*-courier-bold-r-*-*-*-50-*-*-*-*-*-*\nXman.font.manualFontItalic:\t-*-courier-medium-o-*-*-*-50-*-*-*-*-*-*\nXman.font.manualFontNormal:\t-*-courier-medium-r-*-*-*-50-*-*-*-*-*-*\n"
Still looks the same: shrunken fonts when launched from a terminal, not when launched graphically.
 
Old 04-18-2022, 04:28 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
ok, here is mine, ubuntu 20.04 (without xrdb -merge):
Code:
$ appres Xman | grep -i font
*manualFontItalic:	-*-courier-medium-o-*-*-*-120-*-*-*-*-*-*
*manualFontNormal:	-*-courier-medium-r-*-*-*-120-*-*-*-*-*-*
*manualFontSymbol:	-*-symbol-*-*-*-*-*-120-*-*-*-*-*-*
*directoryFontNormal:	-*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*
*manualFontBold:	-*-courier-bold-r-*-*-*-120-*-*-*-*-*-*
And what I have also tried:
Code:
$ xman
Warning: Cannot convert string "-*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*" to type FontStruct
Warning: Cannot convert string "-*-courier-medium-r-*-*-*-120-*-*-*-*-*-*" to type FontStruct
Warning: Cannot convert string "-*-courier-bold-r-*-*-*-120-*-*-*-*-*-*" to type FontStruct
Warning: Cannot convert string "-*-courier-medium-o-*-*-*-120-*-*-*-*-*-*" to type FontStruct
Warning: Cannot convert string "-*-symbol-*-*-*-*-*-120-*-*-*-*-*-*" to type FontStruct
 
1 members found this post helpful.
Old 04-18-2022, 04:38 AM   #7
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574

Original Poster
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
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!

Last edited by hazel; 04-18-2022 at 04:40 AM.
 
Old 04-18-2022, 08:55 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
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
                      RESOURCE_MANAGER property.

       XAPPLRESDIR    A string that will have ``Xman'' appended to it. This string will be the full path name of a
                      user app-defaults file to be merged into the resource database after the system  app-defaults
                      file, and before the resources that are attached to the display.
                      See X(7) for a full statement of rights and permissions.
 
Old 04-18-2022, 11:37 AM   #9
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574

Original Poster
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
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.
 
Old 04-19-2022, 01:04 PM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by hazel View Post
Code:
...
Xman.font.manualFontBold:       -*-courier-bold-r-*-*-*-50-*-*-*-*-*-*
Xman.font.manualFontItalic:     -*-courier-medium-o-*-*-*-50-*-*-*-*-*-*
Xman.font.manualFontNormal:     -*-courier-medium-r-*-*-*-50-*-*-*-*-*-*
......
*manualFontNormal:      -*-courier-medium-r-*-*-*-120-*-*-*-*-*-*
*manualFontBold:        -*-courier-bold-r-*-*-*-120-*-*-*-*-*-*
AFAIU Xresources are applied by specificity, i.e. more specific settings override less specific settings.
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'?
 
Old 04-20-2022, 04:22 AM   #11
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574

Original Poster
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
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.
 
Old 04-20-2022, 11:47 PM   #12
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
^ 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:
Originally Posted by ondoho View Post
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?
You haven't adressed this?
 
Old 04-21-2022, 04:10 AM   #13
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574

Original Poster
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
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.

Last edited by hazel; 04-21-2022 at 04:12 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make xman display internationalized man pages? Lockywolf Linux - Newbie 1 05-04-2014 02:36 AM
[SOLVED] xman and section "9" manpages rnturn Linux - General 2 05-02-2014 08:49 AM
web page, font and font size linuxzouk Programming 4 06-19-2004 10:03 PM
Xman Error: no manual page found A-dummy Linux - General 3 01-13-2003 09:58 AM
where can I get xman? uishen Linux - General 2 02-05-2002 06:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration