You are not logged in.

#1 2011-02-08 05:26:57

Haptic
Member
Registered: 2009-09-03
Posts: 149

[SOLVED]Font Naming Help

I'm having trouble with these strange -*-*-*-*font-blah-blah -*-* names. I can't seem to ever get these names right. I tried a search and discovered xfontsel, but it doesn't really provide the full format. It only spits out -*-fontname-*-*-*-*...  and when I stick it in with urxvt*font:, it reverts to the default font instead of changing to the font I want.  When I copied the font name from dwm's config file, it changed fine. How can I get the proper names of the font I install?

Last edited by Haptic (2011-02-20 17:29:01)

Offline

#2 2011-02-08 06:16:17

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

Re: [SOLVED]Font Naming Help

xfontsel has a number of fields, that you may (or may not) require to correctly set your font. The fact that Urxvt reverts to the default font is an indication that you haven't specified the font name correctly.

Note that xft fonts can be called like so:

URxvt.font:xft:envy code r:medium:size=10

See this tutorial for more detail.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2011-02-08 07:26:17

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: [SOLVED]Font Naming Help

Once you have found a suitable font with xfontsel just clicking "select" will copy the proper specification into the (PRIMARY) clipboard from where you can paste it into the setup-


To know or not to know ...
... the questions remain forever.

Offline

#4 2011-02-08 10:52:43

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED]Font Naming Help

Where do you put the '-*-fontname-*-*-*-*... ' stuff? In the .Xdefaults? Have you run 'xrdb -load ~/.Xdefaults' to refresh the settings?
I have

urxvt*font:     -*-terminus-medium-r-*-*-12-*-*-*-*-*-*-*

and it works as advertised.

Offline

#5 2011-02-09 04:38:55

Haptic
Member
Registered: 2009-09-03
Posts: 149

Re: [SOLVED]Font Naming Help

What does it mean when the terminal doesn't open after copying and pasting from xfontsel? I'm trying to set the font to Inconsolata, but it doesn't open. When I change it back to terminus, it opens fine with the terminus.

Offline

#6 2011-02-09 06:14:12

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

Re: [SOLVED]Font Naming Help

Try starting urxvt from xterm and you might get an error message...

But basically it means that you aren't specifying the font entry correctly. Inconsolata is an xft font - follow the directions in the tutorial I posted in #2


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2011-02-09 08:23:22

singenbale
Member
Registered: 2010-10-01
Posts: 33

Re: [SOLVED]Font Naming Help

Hi, I have the same problem for some time now and i've been avoiding it. I can set the font in urxvt by following some guide or instructions for a particular font but can't set a font that i want. e.g I followed karol's suggestion, logged off and then on again, found that urxvt wont start, xterm gave this error:

urxvt: unable to load base fontset, please specify a valid one using -fn, aborting

found out that i actually don't have terminus font installed so i installed it, then followed a bit of wiki and urxvt finally started with terminus font.
Now if i want to set a font by myself, e.g by pasting:

urxvt*font: -*-tahoma-*-*-*-*-*-*-*-*-*-*-*-*

from xfontsel to .Xdefaults, xterm gives this error:

urxvt: -microsoft-tahoma-bold-r-normal--0-0-0-0-p-0-adobe-standard: cannot deduce encoding from registry/encoding properties "adobe-standard", ignoring font.
urxvt: -microsoft-tahoma-bold-r-normal--0-0-0-0-p-0-adobe-standard: cannot deduce encoding from font name property "adobe-standard", ignoring font.
urxvt: unable to load base fontset, please specify a valid one using -fn, aborting

I have tried several different settings but the results are so varied that i can't fix it by trial and error.
The following works:

URxvt.font:xft:Bitstream Vera Sans Mono:antialias=true

but changing "Bitstream Vera Sans Mono" in the above line to some other font name (2 or 3 that i tried) does't work (Urxvt starts with some default font with queit wide spacing).
I probably need some more info regarding fonts e.g:
1. How do i know which fonts are xft and what if they are
2. Can urxvt use all installed fonts? if yes what is wrong in my method of using tahoma font
3. Does xfontsel list all installed fonts
4. Can i use anti-aliasing in urxvt by setting the font in .Xdefaults in the following way: "-terminux-*-*-*-*...." or
5. Does anti-aliasing work only with xft fonts and need to be set by the method given in the link posted by jasonwryan in #2
@jasonwryan:
I found the same link on wikipaedia also but its too complex for me to understand and I  got lost somewhere in the beginning. I need some basic info regarding fonts.

Offline

#8 2011-02-09 19:49:05

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

Re: [SOLVED]Font Naming Help

Isn't Tahoma an xft font?

xfontsel should list all installed fonts, however if a font doesn't have a standard naming convention it may not appear.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2011-02-09 20:37:21

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: [SOLVED]Font Naming Help

singenbale wrote:

I probably need some more info regarding fonts e.g:
1. How do i know which fonts are xft and what if they are
2. Can urxvt use all installed fonts? if yes what is wrong in my method of using tahoma font
3. Does xfontsel list all installed fonts
4. Can i use anti-aliasing in urxvt by setting the font in .Xdefaults in the following way: "-terminux-*-*-*-*...." or
5. Does anti-aliasing work only with xft fonts and need to be set by the method given in the link posted by jasonwryan in #2

1. Xft is simply a rendering library, or a means to render fonts under X11 (e.g., the linux GUI desktop); it's not a type of font itself.  Xft can render most any font, be it a TTF, FON, or bitmap font.  You must however specify the font in a format that Xft can read, such as how Jason recommended:

URxvt.font:xft:envy code r:medium:size=10

2. Yes, but not all fonts will look good.  The problem with your method is in the output you provided; urxvt cannot determine which encoding (language set) you want to use.  If you supply a proper xfont declaration it should work fine, though Tahoma isn't fixed width so it will look quite ugly in urxvt:

-*-tahoma-*-*-*-*-*-120-*-*-*-*-iso8859-1

3. Not sure about this one, but it certainly displays most, if not all fonts installed on my system.  In order to appear in xfontsel, the font may need to be properly registered; see the mkfontdir man page for more information or have a look at the build scripts for any of the arch font packages. 

4. No. Specifying fonts that way will use the barebones X11 font rendering, which will not support antialiasing.

5. Yes.  Technically Xft and Fontconfig can both provide antialiasing, but for urxvt only Xft is used.

Last edited by thayer (2011-02-09 20:41:58)


thayer williams ~ cinderwick.ca

Offline

#10 2011-02-09 20:44:44

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED]Font Naming Help

xfontsel list only the fonts that are found in the specified fontpaths (IIRC, it's /usr/share/fonts by default). You may need to add e.g.

xset +fp /usr/share/fonts/local

to get xfontsel to see Terminus.

'xlsfonts' will list all the available fonts.

Offline

#11 2011-02-11 15:47:39

singenbale
Member
Registered: 2010-10-01
Posts: 33

Re: [SOLVED]Font Naming Help

@thayer
Thanks! thats a great reply. Now at least I know where I stand.

thayer wrote:

2. Yes, but not all fonts will look good.  The problem with your method is in the output you provided; urxvt cannot determine which encoding (language set) you want to use.  If you supply a proper xfont declaration it should work fine, though Tahoma isn't fixed width so it will look quite ugly in urxvt:

-*-tahoma-*-*-*-*-*-120-*-*-*-*-iso8859-1

I thought that by setting tahoma in general without any further specifications, I was doing a good thing in not limiting urxvt to a particular setting as that would have a  smaller chance of success. guess I was wrong in that one.
@karol & jasonwryan
thanks for helping out. I will look into xlsfonts as well. I'll keep experimenting with it and see what I come up with.

Offline

Board footer

Powered by FluxBB