You are not logged in.

#1 2013-08-13 16:20:05

shawnjgoff
Member
Registered: 2010-07-04
Posts: 14

How can I make xterm show Unicode chars other than Latin and lines?

I'm trying to get my terminal (xterm) to show more Unicode characters. The UTF-8 and Unicode FAQ for Unix/Linux suggests that xterm can display quite a wide set, but I'm not seeing that.

I have the locale resource set to true as suggested in the wiki (and I have used xrdb to load the new resources, but it was actually set already before I logged in).

I've also made sure to use a font that has those characters. Here you can see a screenshot of vim and gvim showing the same file with the same font.

http://i.imgur.com/aG8NjUrl.png




-- mod edit: read the Forum Etiquette and only post thumbnails http://wiki.archlinux.org/index.php/For … s_and_Code [jwr] --

Last edited by shawnjgoff (2013-08-13 18:32:05)

Offline

#2 2013-08-14 09:15:38

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

Re: How can I make xterm show Unicode chars other than Latin and lines?

It should work - depends on the font (using the default font provided for uxterm, the file shows correctly "here" in vim).
Your posting doesn't identify the font, or how it was set.  There is a pitfall, as noted in the FAQ -

http://invisible-island.net/xterm/xterm … utf8_fonts

Offline

#3 2013-08-14 10:35:02

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

Re: How can I make xterm show Unicode chars other than Latin and lines?

It's most likely your selection of fonts doesn't include the glyphs.  For xft (TrueType) I use DejaVu Sans Mono to balance glyph coverage with legibility and I use WenQuanYi Bitmap Song for the double wide characters.

xterm*faceName: DejaVu Sans Mono:style=Book:antialias=false
xterm*faceNameDoublesize: WenQuanYi Bitmap Song
xterm*faceSize: 8
! Fix for DJVSM low-hanging underscore, adds line spacing:
xterm*scaleHeight: 1.01

The default XLFD font, aliased to "fixed", has very good glyph coverage.  You can probably switch to it with xterm's Ctrl-Right_Click menu: uncheck 'TrueType Fonts' and make sure Default is checked.  Or start a new xterm instance from the command line:

$ xterm -xrm "*renderFont: false" &

The default fonts for xterm are all XLFD.  You can view the system defaults in '/usr/share/X11/app-defaults/XTerm'.  The defaults may be overwritten by your user's X resources configuration.

Edit: fixed missing space in code.

Last edited by thisoldman (2013-08-14 11:16:09)

Offline

#4 2013-08-14 14:59:19

shawnjgoff
Member
Registered: 2010-07-04
Posts: 14

Re: How can I make xterm show Unicode chars other than Latin and lines?

Okay, the resource causing me problems is:

XTerm*faceName: Source Code Pro

If I remove that (or if I disable TrueType fonts with the menu), I get the default font and the glyphs show up fine. The font I'm trying to use does have those glyphs - that was the reason for the screenshot: gvim is using the same font and it's rendering the the glyphs, but xterm is not. In fact, if I use

Xterm*font:     -adobe-source code pro-r-normal--17-120-100-100-m-0-iso10646-1

it renders the glyphs, but I'm not getting antialiasing.

I tried faceName: DejaVu Sans Mono and that worked. So I guess I don't understand why Source Code Pro has the glyphs in gvim, but not in xterm when I use the faceName resource, while it does have them when I use the font resource.

Offline

#5 2013-08-15 01:01:45

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

Re: How can I make xterm show Unicode chars other than Latin and lines?

I tried the ttf version with xterm and with uxterm and I ran into the same display problems you did, even without any customized X resources. The font does work with my normal urxvt and also with urxvt with no custom X resources.  It's an odd incompatibility with xterm.

I prefer xterm over other emulators, but xterm does have some quirks that can be irritating.

Offline

Board footer

Powered by FluxBB