Display default fonts ....

James McDonald james at jamesmcdonald.id.au
Sat Mar 21 13:18:46 PDT 2009


Ben Duncan wrote:
> Ok, next question .... is there something like xfd is for the screen
> that is for printing out the font .....
>
>
> For example, I can xfd -f utf-8 and get a list of UTF-8 fonts shown on 
> the
> screen, what I want to do is something that can send that to a printer ..
>
> James McDonald wrote:
>> Ben Duncan wrote:
>>> Can anyone tell me how i can find the default font my xterm is using ?
>>>
>>> Thanks ....
>>>
>>>
>> you can use editres to get that information.
>
>
xrdb -query  prints out Xresources that are set but this will only print 
the xterm font if it's been set away from the default

Incidentally I just found a faq i wrote ages ago for changing the Xterm 
font from the default:


Changing the Default Font in your XTerm

When you are in an XTerm you can hold down the CTRL key and then right 
click to get a menu called "VT Fonts" and select one of the following 
options "Default, Unreadable, Tiny, Small, Medium, Large and Huge" to 
change the font size.

I wanted to get my XTerm to default to the "Huge" option but couldn't 
seem to find a positive method on the internet of how to find out 
exactly how that setting was reached and then how to make it the system 
or an individual users default.

That was before I found out about editres the "X Resource Editor". 
Following are the steps I used to change the default font in my XTerm.

1. Launch an xterm
    xterm
2. From the command line editres
    editres
3. On the "Commands" menu of editres select "Get Tree"
4. With the cross hairs that appear click the white area of your XTerm
5. You should see a Widget Tree similar as follows

         --------
        |shellext|
 ----- / --------
|xterm|
 ----- \
         -----
        |vt100|
         -----
6. Select the vt100 widget and select "Show Resource Box" from the 
"Commands" menu
7. You will see a list of X Resources the "font" option holds the 
default font value.
8. To find out what the default font value is currently scroll to "font" 
and select it then centre click (If you have a 3 button mouse this is 
the middle mouse button, If like me you have a 2 button mouse then click 
both buttons at the same time - Note you may need the Emulate3Buttons 
options set in your XF86Config or xorg.conf file for this to work)
9. The current value of "font" will appear in the "Enter Resource Value" 
box (by default this will be "fixed" - On RedHat FC2 anyway)
10. Now you have to save the resource string, click the "Set Save File" 
box and enter a file name. Once you have done this click save and the 
string will be appended to the file name you entered (you will find the 
file in the current directory from wherever you launched editres)
11. When you look at the file you named and saved above. The "font" 
resource string will look like this ".xterm.vt100.font: fixed"
12. Now you need to find the value of the "Huge" sized font
13. In editres's Resource Box select "font6" and then middle or both 
button click to have the value appear in the "Enter Resource Value" box.
14. This value will be something like "10x20" edit the value in the file 
you saved to include this value.
15. This is the value you should end up with
 
    .xterm.vt100.font: 10x20

16. Once you have the "Huge" fonts value and have edited the default 
string. You now have to append it to one of 2 files.
    /etc/X11/Xresources for a system wide change
    or
    ~/.Xresources for an individual change.
17. To make the change immediate without restarting X simply run
    xrdb /path/to/Xresources



Troubleshooting:

I had some difficulty finding the correct resource string under XFCE 
4.1.99.3
for xterm I ended up playing with the placing of the * and dots and also the
case on the Xterm xterm here is the successful string that I added to
/etc/X11/Xresources


.XTerm*font: -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1



More information about the Linux-users mailing list