You are not logged in.

#1 2019-03-28 23:57:43

dracofrancis
Member
Registered: 2019-03-03
Posts: 18

[SOLVED] terminal emulator not obeying .Xdefaults font and font size

Hi everyone and thank you once more for supporting us newbies.

This time I am stuck with a font issue: My xterm terminal (and previously my rxvt-unicode) do not follow font and font size of my .Xdefaults. Everything else is fine, such as terminal bg and fg colours.
Btw, I use .Xdefautls and not .Xresources because with the latter I couldn't even get the background colour set. My goal is to have terminus font instead of the existing default terminal font.

FYI: My /usr/sharer/kbd/consolefonts is populated with .gz files (I dont know if that is a problem)

The output of $ showconsolefont is

~ $ showconsolefont
Couldn't get a file descriptor referring to the console

Also when I try to set font:

~ $ setfont Terminus
Couldn't get a file descriptor referring to the console

My .Xdefaults file is this:

XTerm*faceSize: 12 # font size
! Default and menu font
XTerm*font:  -*-terminus-bold-*-*-*-20-*-*-*-*-*-*-*
! "Unreadable": Leave it actually unreadable.
!XTerm*font1: -*-terminus-bold-r-*-*-20-*-*-*-*-*-*-*
! "Tiny"
XTerm*font2: -*-terminus-medium-*-*-*-12-*-*-*-*-*-*-*
! "Small"
XTerm*font3: -*-terminus-bold-*-*-*-14-*-*-*-*-*-*-*
! "Medium"
XTerm*font4: -*-terminus-bold-*-*-*-17-*-*-*-*-*-*-*
! "Large"
XTerm*font5: -*-terminus-bold-*-*-*-28-*-*-*-*-*-*-*
! "Huge"
XTerm*font6: -*-terminus-bold-*-*-*-32-*-*-*-*-*-*-*
xterm*loginShell: true
xterm*vt100*geometry: 80x50
xterm*saveLines: 2000
xterm*charClass: 33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48
xterm*termName: xterm-256color
xterm*eightBitInput: false
xterm*foreground: rgb:00/ff/ff
xterm*background: rgb:00/00/00
xterm*color0: rgb:00/00/00
xterm*color1: rgb:a8/00/00
xterm*color2: rgb:00/a8/00
xterm*color3: rgb:a8/54/00
xterm*color4: rgb:00/00/a8
xterm*color5: rgb:a8/00/a8
xterm*color6: rgb:00/a8/a8
xterm*color7: rgb:a8/a8/a8
xterm*color8: rgb:54/54/54
xterm*color9: rgb:fc/54/54
xterm*color10: rgb:54/fc/54
xterm*color11: rgb:fc/fc/54
xterm*color12: rgb:54/54/fc
xterm*color13: rgb:fc/54/fc
xterm*color14: rgb:54/fc/fc
xterm*color15: rgb:fc/fc/fc
xterm*boldMode: false
xterm*colorBDMode: true
xterm*colorBD: rgb:fc/fc/fc
XTerm*selectToClipboard: true

After ever change I make I run ~ $ xrdb -merge ~/.Xdefaults with no issues.

Do you have any ideas of what the issue could be? What more information can I give to help you?

Thank you all for helping out!

Last edited by dracofrancis (2019-03-29 03:52:42)

Offline

#2 2019-03-29 00:16:25

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] terminal emulator not obeying .Xdefaults font and font size

wiki wrote:

To test, you can also set the font on the command line: -fa for faceName, -fn for font

https://wiki.archlinux.org/index.php/Xterm#Fonts

See also

The older ~/.Xdefaults file is read when an X11 program starts, but only if xrdb has not been used in the current session.

https://wiki.archlinux.org/index.php/X_resources

Why are you setting the default as a login shell?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2019-03-29 00:37:26

dracofrancis
Member
Registered: 2019-03-03
Posts: 18

Re: [SOLVED] terminal emulator not obeying .Xdefaults font and font size

Thanks for you reply.

Regarding the login shell I set it to false, I have copied someones dotfiles and didn't know what it is.

I tried both -fa and -fn and although there where no errors nothing changed.

~ $ set -fa Terminus
~ $ set -fn Terminus
~ $ 

Offline

#4 2019-03-29 00:39:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: [SOLVED] terminal emulator not obeying .Xdefaults font and font size

dracofrancis wrote:

~ $ set -fn Terminus

"Terminus" is neither an XLFD nor a font-config recognized name.  Use either a full XLFD with -fn, or use -fa "xos4 Terminus".

dracofrancis wrote:

I tried both -fa and -fn and although there where no errors...

What?  There certainly should have been an error:

$ xterm -fn Terminus
xterm: cannot load font "Terminus"
xterm: cannot load font "-Misc-Fixed-medium-R-*-*-13-120-75-75-C-120-ISO10646-1"

Last edited by Trilby (2019-03-29 00:42:21)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2019-03-29 00:42:36

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,475

Re: [SOLVED] terminal emulator not obeying .Xdefaults font and font size

dracofrancis wrote:

...
My xterm terminal (and previously my rxvt-unicode) do not follow font and font size of my .Xdefaults. Everything else is fine, such as terminal bg and fg colours.
...

~ $ showconsolefont
Couldn't get a file descriptor referring to the console

...

~ $ setfont Terminus
Couldn't get a file descriptor referring to the console

...

Why you are running those commands from xterm, instead of linux console ?

Offline

#6 2019-03-29 00:47:29

dracofrancis
Member
Registered: 2019-03-03
Posts: 18

Re: [SOLVED] terminal emulator not obeying .Xdefaults font and font size

I am confused...isn't xterm a terminal emulator? What do you mean by linux console?

Offline

#7 2019-03-29 01:08:27

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] terminal emulator not obeying .Xdefaults font and font size

setfont and showconsolefont are for the console, not X. Hence the errors.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2019-03-29 01:17:00

dracofrancis
Member
Registered: 2019-03-03
Posts: 18

Re: [SOLVED] terminal emulator not obeying .Xdefaults font and font size

Okay understood. So I changed .Xdefaults to .Xresources and added the following to my .xinitrc

[[ -f ~/.Xresources ]] && xrdb -merge -I$HOME ~/.Xresources


Now my output is:

~ $ xrdb -query -all
XTerm*faceSize: 12 # font size
XTerm*font:     -*-terminus-bold-*-*-*-20-*-*-*-*-*-*-*
XTerm*font1:    -*-terminus-bold-r-*-*-20-*-*-*-*-*-*-*
XTerm*font2:    -*-terminus-medium-*-*-*-12-*-*-*-*-*-*
XTerm*font3:    -*-terminus-bold-*-*-*-14-*-*-*-*-*-*-*
XTerm*font4:    -*-terminus-bold-*-*-*-17-*-*-*-*-*-*-*
XTerm*font5:    -*-terminus-bold-*-*-*-28-*-*-*-*-*-*-*
XTerm*font6:    -*-terminus-bold-*-*-*-32-*-*-*-*-*-*-*
XTerm*selectToClipboard:        true
xterm*background:       rgb:00/00/00
xterm*boldMode: false
xterm*charClass:        33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48
xterm*color0:   rgb:00/00/00
xterm*color1:   rgb:a8/00/00
xterm*color10:  rgb:54/fc/54
xterm*color11:  rgb:fc/fc/54
xterm*color12:  rgb:54/54/fc
xterm*color13:  rgb:fc/54/fc
xterm*color14:  rgb:54/fc/fc
xterm*color15:  rgb:fc/fc/fc
xterm*color2:   rgb:00/a8/00
xterm*color3:   rgb:a8/54/00
xterm*color4:   rgb:00/00/a8
xterm*color5:   rgb:a8/00/a8
xterm*color6:   rgb:00/a8/a8
xterm*color7:   rgb:a8/a8/a8
xterm*color8:   rgb:54/54/54
xterm*color9:   rgb:fc/54/54
xterm*colorBD:  rgb:fc/fc/fc
xterm*colorBDMode:      true
xterm*eightBitInput:    false
xterm*foreground:       rgb:00/ff/ff
xterm*loginShell:       false
xterm*saveLines:        2000
xterm*termName: xterm-256color
xterm*vt100*geometry:   80x50

I just cannot figure out why xterm (and as a result ranger, mc, vim,...) are not obeying the .Xresources

Offline

#9 2019-03-29 01:53:46

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: [SOLVED] terminal emulator not obeying .Xdefaults font and font size

Ok, so now you've gone back and addressed one of the many comments questions in this thread (Xresources vs Xdefaults).  How about the others?

And lets add one to it.  What is your metric for these things not being "obeyed".  You do know that "faceSize" will not affect fonts specified with an XLFD, right?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2019-03-29 02:05:07

dracofrancis
Member
Registered: 2019-03-03
Posts: 18

Re: [SOLVED] terminal emulator not obeying .Xdefaults font and font size

By obey I mean that the font I specify in my .Xresources is not the one I see on my xterm and other console based apps.

Secondly, I did not know that facesize will not affect fonts specified with XLFD, so thank you for that info.

There are obviously many many things I do not know, hence my posting on a thread titled "newbie corner".

My simple question is what to do to solve it? What should my .Xresources look like in order to achieve having terminus of a certain size?

I hope I am not annoying people with my amateur hour questions and I surely do appreciate your willingness to help.

Offline

#11 2019-03-29 02:17:10

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: [SOLVED] terminal emulator not obeying .Xdefaults font and font size

dracofrancis wrote:

By obey I mean that the font I specify in my .Xresources is not the one I see on my xterm

And how are you determining this.  What font is it then?  What makes you sure it is not Terminus?  It's not a matter of believing you or not, but rather a need to know what specifically is leading to this conclusion:
http://catb.org/~esr/faqs/smart-questions.html#symptoms

draconfancis wrote:

My simple question is what to do to solve it? What should my .Xresources look like in order to achieve having terminus of a certain size?

We can't solve a problem until we diagnose it.  What size of terminus do you want?  What are the results of testing the -fn flag with the same font string in your Xdefaults/Xresources?  When you ran this test previously, you used different parameters than those in your Xresources, so it was a useless test.  Further you claimed that no errors were reported which really isn't possible.

Last edited by Trilby (2019-03-29 02:17:39)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#12 2019-03-29 02:32:17

dracofrancis
Member
Registered: 2019-03-03
Posts: 18

Re: [SOLVED] terminal emulator not obeying .Xdefaults font and font size

I understand, you are right. I want to have terminus size 20 bold .

Does this help?

~ $ xterm -fn  -*-terminus-bold-*-*-*-20-*-*-*-*-*-*-*
xterm: cannot load font "-*-terminus-bold-*-*-*-20-*-*-*-*-*-*-*"
xterm: cannot load font "-Misc-Fixed-medium-R-*-*-13-120-75-75-C-120-ISO10646-1"

I was trying "set font Terminus" that is why there was no error coming out (and also no result).

and for the font I currently have: How do I check in order to tell you?

~ $ showconsolefont
Couldn't get a file descriptor referring to the console

Last edited by dracofrancis (2019-03-29 02:33:27)

Offline

#13 2019-03-29 02:42:55

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: [SOLVED] terminal emulator not obeying .Xdefaults font and font size

Again, the `setfont` and `showconsolefont` are completely irrelevant here.  You are not in a console.  Period.

I don't know that there is a command to determine which font xterm is using (from within xterm).  But you have concluded that it is not using the one you want.  I wanted to know what led you to this conclusion - a describe od what you see.  The error message from the -fn flag however, does indeed indicate that the font is not loaded.

What about `xterm -fa "xos4 Terminus"`?

If that fails, post the output of the following:

fc-match "xos4 Terminus"
pacman -Qs terminus

"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#14 2019-03-29 02:45:58

dracofrancis
Member
Registered: 2019-03-03
Posts: 18

Re: [SOLVED] terminal emulator not obeying .Xdefaults font and font size

Okay great news: when I run xterm -fa "xos4 Terminus" a new xterm window opens with Terminus font.

So the next step is to put that in my .Xresources with the correct format, right?

Offline

#15 2019-03-29 03:06:59

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: [SOLVED] terminal emulator not obeying .Xdefaults font and font size

Yes.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB