I'm interested in how can i get a valid font name to use in in .Xresources file. I've installed ttf-ms-fonts
and want to switch my terminal to courier font. But setting it like this does't work
urxvt*font: cour
urxvt*boldFont: courbd
How do i specify a valid name?
Try fc-list command. It is a quick and handy command to lists fonts and styles available on the Linux system for applications using fontconfig. You can use fc-list to find out whether a particular language font is installed or not.
Font hinting (also known as instructing) is the use of mathematical instructions to adjust the display of an outline font so that it lines up with a rasterized grid. At low screen resolutions, hinting is critical for producing clear, legible text.
The “fixed” alias is used as the default font for xterm windows. (Twelve-point Helvetica bold roman has the alias “variable” and is used by default for labels such as those in the titlebar twm puts on windows.)
About Xft. The current version of Xft (2.0) provides a client-side font API for X applications. It uses FontConfig to select fonts and the X protocol for rendering them. When available, Xft uses the Render extension to accelerate text drawing.
First, you have to decide if you want to use core protocol or Xft for font rendering. As you see in another answer, xfontsel
is the right tool to get a correct font name for core protocol. But it's unlikely to be what you want for truetype fonts (do you want antialiasing? Then Xft is your choice).
If urxvt is built with Xft support (check urxvt --help 2>&1 | grep options
to be sure), you might want to give it font names prefixed by xft:
URxvt.font: xft:Courier New
Other options affecting font matching and rendering may be specified in xft font name:
URxvt.font: xft:Courier New:pixelsize=18:antialias=false
(search man rxvt
for xft:
for further details)
All available font names can be queried with fc-list
. E.g. fc-list|grep courbd.ttf
shows you the font name is Courier New and style is Bold (append :style=Bold
to select it).
Use fc-match "Courier New"
to check which font is the best match for a given name from Xft's point of view.
Other applications may have their own conventions for X11 and Xft font names. E.g. the same xft:
prefix is used by emacs; xterm uses faceName
and renderFont
resources to determine whether to use Xft and which font to request; xedit
supports core protocol only. The mere fact that the application is configurable from X resources isn't enough to tell how the font names are interpreted.
i think you can use the program
xfontsel
to get the complete name of the font. The font name looks like this:
-*-courier-bold-*-*-*-*-*-*-*-*-*-*-*
Best wishes, Matthias
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With