You are not logged in.

#1 2009-11-30 22:49:53

Nanthiel
Member
From: Slovenia
Registered: 2009-09-20
Posts: 148

xterm font problem (national characters)

Hello everyone!
I have the following problem...

I'm Slovene and the national characters (š, č, ž) work in the xterm by default, but when I change the fault, even to a line like "XTerm*font: -*-fixed-medium-r-normal-*-16-*-iso8859-2", which is identical to the default font, they stop working. They show up as a space. If I set the font to something like "XTerm*faceName: terminus:pixelsize=14", they show up as 'box' characters, but when I try to use something like Monospace, they work again.

How is it possible that the manual declaration of the -fixed- font does not work, when it's exactly like the default font if no special font is specified?


Thanks for the answers,

— Nanthiel

Offline

#2 2009-12-01 02:17:44

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: xterm font problem (national characters)

Xterm won't load the "Fixed" font on my machine as you have it written.

$ xterm
xterm: cannot load font -*-fixed-medium-r-normal-*-16-*-iso8859-2

This version loads with no error messages:    "xterm*font:    -*-fixed-medium-r-normal-*-16-*-*-*-*-*-iso8859-2"

I don't know enough about xterm setup, or the Terminus fonts, to tell you more about them.  I think the font you are calling "Monospace" might actually be Bitstream Vera Sans Mono. If you run "fc-match Monospace", it will tell you which font is being used for "Monospace".

Last edited by thisoldman (2009-12-01 02:22:44)

Offline

#3 2009-12-01 12:32:07

Nanthiel
Member
From: Slovenia
Registered: 2009-09-20
Posts: 148

Re: xterm font problem (national characters)

Oh! Thanks for the reply. Yes, I see now that it actually doesn't load at all. But it for some reason breaks national character support, even without loading! The fixed version aswell does not make national characters work, but the encoding is right.
The "monospace" font on my machine is the "DejaVu Sans Mono" "Book" font. And of course it supports unicode, but I wonder how I can do minor changes to the default font without breaking the national char support? If I use the CTRL-menu, it works normally.

Offline

#4 2009-12-01 18:52:06

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: xterm font problem (national characters)

For xterm to use the Terminus font, this works for me:

xterm*faceName:    xft:Terminus:size=12

From the xterm manpage, I see you can start a session like this: "xterm -lc"
This option is to  make xterm support your locale settings.  I see no error or warning messages when I use the "-lc" option; but I don't know if the option works.

Offline

#5 2009-12-01 19:56:45

Nanthiel
Member
From: Slovenia
Registered: 2009-09-20
Posts: 148

Re: xterm font problem (national characters)

Okay to sum up my observations: the 'XTerm*faceName' option makes fonts work properly, but 'terminus' apparently doesn't support my characters? If I select something that I know is unicode, it works.
The problem shows up when using the 'XTerm*font' option, which breaks national character support no matter what I put there. Even if I choose a font that should support them. (National characters don't show up at all, when they are typed they leave a blank space.)

Thanks for the suggestion on the xterm -lc, but it doesn't work, I'm afraid. =/

I'm not going to worry anymore, just going to use the default XTerm font. Is there possibly a way to make that font only change the size by default? (to "Small", just like from the CTRL menu, because that WORKS?)

Thanks!


p.s. Why do I really need national characters in a terminal, anyway...? Heh.

Last edited by Nanthiel (2009-12-01 19:58:10)

Offline

#6 2009-12-01 22:57:42

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: xterm font problem (national characters)

When I use Terminus, it shows the Š and š, Č and č, Ž and ž.

Try adding this line to your xterm settings to make sure xterm is UTF-8 compatible:

xterm*utf8:    2

I have no trouble using Terminus to show the Slovenian characters with locale set to 'en_US.utf8'.

Terminus is installed to ./usr/share/fonts/local/'.  For Xorg to be fully aware of Terminus, your '/etc/X11/xorg.conf' must contain a section like this,

Section "Files"
    FontPath    "/usr/share/fonts/local"
EndSection

If you aren't using an 'xorg.conf' file, I think you can create one containing just those three lines.  (I could be wrong).  X has to be restarted for any changes in 'xorg.conf' to work.

After restarting, Terminus will show up when you run 'xfontsel'.  Xfontsel is a small app that lets you display fonts and their names in the old Xorg format:   "-*-terminus-medium-*-*-*-12-*-*-*-*-*-iso8859-2".  The program won't show all the valid options, just some of them.

Now you should be able to load Terminus in xterm with

xterm*font:    -*-terminus-medium-*-*-*-12-*-*-*-*-*-iso8859-2

Change the "12" to change the size of the font.

Or,

xterm*faceName:    xft:Terminus:size=12:hinting=true

Again, change the "12" to change the size of the font.

I hope this helps you.  I've learned much about xterm, and I now know that I prefer the font Inconsolata over Terminus.

Last edited by thisoldman (2009-12-01 22:59:47)

Offline

#7 2009-12-02 00:11:07

dickey
Member
Registered: 2009-06-01
Posts: 35

Re: xterm font problem (national characters)

For what you're trying to do, something like koi8rxterm would be a good
starting point.  That's a script which sets up xterm for an 8-bit code
(a different one), and uses a set of fonts that work with it.

The reply about using the utf8 resource starts off okay, but goes
off target since the Terminus font is not the same as Unicode.

Offline

#8 2009-12-02 00:44:17

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: xterm font problem (national characters)

I was trying to present enough info but not too much. I thought part of the original post was the desire to use the Terminus font.  Maybe I misread...

I'm sorry if I have.

Last edited by thisoldman (2009-12-02 00:45:30)

Offline

#9 2009-12-02 01:06:11

Nanthiel
Member
From: Slovenia
Registered: 2009-09-20
Posts: 148

Re: xterm font problem (national characters)

I've followed everything exactly as 'thisoldman' wrote, and it doesn't work. =/
But Terminus now shows up when running xfontsel. Also, my locale is also set to "en_US.utf8"

And um, it's not just about the terminus font. It's about changing to any font but 'Monospace' (= Dejavu Mono), which works.
Also, if I use the 'xft:' line in front of Terminus when called with XTerm*faceName, it uses the 'Monospace' font for some reason.

Offline

#10 2009-12-02 01:24:02

dickey
Member
Registered: 2009-06-01
Posts: 35

Re: xterm font problem (national characters)

Well... two replies:

The ISO-8859-2 encoding corresponds to mostly (not all) Unicode values 0-255.
But some of those ISO-8859-2 values fall outside the range.  From the original
question, it's not clear what the locale setting is, but I'd assume that it would be
consistent with ISO-8859-2 (not something like en_US.UTF-8).

For the patterns beginning with "xft:", I've seen a few comments about that.
One of the problems in diagnosing problems with Xft and fontconfig is that
they give no useful warning messages.  So if something's not recognized,
they'll just give the default pattern.

Offline

#11 2009-12-02 01:27:08

dickey
Member
Registered: 2009-06-01
Posts: 35

Re: xterm font problem (national characters)

by the way -
The blanks come from xterm trying to use codes that don't exist in
the given font.

Offline

#12 2009-12-02 01:53:29

dickey
Member
Registered: 2009-06-01
Posts: 35

Re: xterm font problem (national characters)

If you remove the "xft:" from the string, it should work
(or at least you can fix that step).

Notwithstanding the vague description in

http://keithp.com/~keithp/render/Xft.tutorial

the XftParse() function doesn't like seeing that "xft:".
That's what xterm is using.  Some other programs use
different interfaces, which look for it.

Offline

#13 2009-12-02 09:36:16

Nanthiel
Member
From: Slovenia
Registered: 2009-09-20
Posts: 148

Re: xterm font problem (national characters)

I've tried changing my system locale to sl_SI.utf8 and it doesn't work either. Now the interesting thing is, wherever else I use the other fonts, it works. Only XTerm has problems (I've tried using them in Leafpad and Terminal so far). Why would that be?

Removing 'xft:' makes xterm use the terminus font, as it should, but the nat. chars are still not there. Awkward.

The most awkward thing being, that they work "out-of-the-box", but get ruined by the tiniest change to the font settings.

Offline

#14 2009-12-02 10:37:58

dickey
Member
Registered: 2009-06-01
Posts: 35

Re: xterm font problem (national characters)

But sl_SI.utf8 would use UTF-8 encoding, while your font's encoding
(from its name) is ISO-8859-2.  If your data is actually being written in
UTF-8 encoding, the terminal emulator has to decide if the value fits in
the font.  The codes that do not correspond to ISO-8859-1 will not be
found in the font, due to the way the codes are defined.

Some emulators use a fontset, and will fill in the missing values
using close matches from other fonts.  You may be seeing this behavior.

Offline

Board footer

Powered by FluxBB