How can I get better-looking fonts in my terminal (URxvt)?
Solution 1
In ~/.Xresources
, put, for example, the below config. (There are some other configurations of urxvt
that might interest you here
(note that this is a plain text file, posted on the web;
you may want to use "View Source" to read it).
There you also find another color scheme, that might be better if you ever experience eye problems because of too bright lights emitting from a monitor.
More colors stuff.)
Then, in ~/.xinitrc
, put xrdb ~/.Xresources
.
For testing, an alias like alias xup="xrdb ~/.Xresources"
could be useful, then simply start a new instance of urxvt
.
URxvt.font: xft:bitstream vera sans mono:size=16:antialias=true
URxvt.boldFont: xft:bitstream vera sans mono:bold:size=16:antialias=true
URxvt*color0: #000000 // black
URxvt*color1: #B40000 // red
URxvt*color2: #00AA00 // green
URxvt*color3: #AAAA00 // yellow
URxvt*color4: #5555AA // blue
URxvt*color5: #AA00AA // magenta
URxvt*color6: #00AAAA // cyan
URxvt*color7: #AAAAAA // white
URxvt*color8: #555555 // black (now and below: bright)
URxvt*color9: #FF0000 // red
URxvt*color10: #00FF00 // green
URxvt*color11: #FFFF00 // yellow
URxvt*color12: #6464FF // blue
URxvt*color13: #FF00FF // magenta
URxvt*color14: #00FFFF // cyan
URxvt*color15: #FFFFFF // white
Here is what it looks like:
Solution 2
There are a couple of good resources available for font configuration. The first I would recommend is the Arch wiki page, it has details on how to manually configure your fonts.conf
or how to install and use the various patchsets (like infinality—which are distro agnostic).
There is also a long thread on the Gentoo boards that has a lot of good tips, but requires some wading through.
Ultimately, font appearance is quite subjective.
The settings that you have in your .Xresources
look fine, but if you are dissatisfied with how your fonts appear, you will have to configure the settings you are after in your files in$XDG_CONFIG_HOME/fontconfig/conf.d
until you achieve what you are looking for.
You are also setting your DPI at 96: check what your monitor's optimum DPI is and set it accordingly.
Related videos on Youtube
Comments
-
jcora over 1 year
I've noticed that the fonts in URxvt look a little bit low-res compared to fonts that I see in my browser, for example.
I was wondering how could I fix my
.Xdefaults
file to make the fonts have a little bit more detail and be sharper.It might not be visible in this picture, but I can definitely notice the difference when looking myself:
Here is my current
.Xdefaults
:URxvt*background: Black URxvt*foreground: White URxvt*geometry: 80x30 URxvt*scrollBar: false "URxvt.font: 9x15 !-- Xft settings -- ! Xft.dpi: 96 Xft.antialias: true Xft.rgba: rgb Xft.hinting: true Xft.hintstyle: hintfull ! -- Fonts -- ! URxvt.font:xft:Monospace:pixelsize=15 URxvt.boldfont:xft:Monospace-Bold:pixelsize=15
-
Admin almost 11 yearshave you tried comparing a black on white terminal with the browser?
-
Admin almost 11 yearsI also see now that you are comparing two different fonts. Maybe you should switch the font.
-
-
jasonwryan almost 11 yearsThe OP was specifically asking about font configuration, not colors...
-
Emanuel Berg almost 11 years@jasonwryan: Yeah, there are font stuff in my answer as well, even if you don't include colors as part of font.
-
jasonwryan almost 11 yearsUm, no. Your font lines just replicate the settings (antialias) that the OP is already using and use a different font...
-
Emanuel Berg almost 11 years@jasonwryan: So what more do you want than font and color? What do you propose you change, if not that, if you seek to get the text in your terminal to look better?
-
jasonwryan almost 11 yearsOP is asking for font configuration help: you haven't provided any...
-
Jpaji Rajnish about 8 yearsMaybe OP was asking about font config but this answer offers font config AND the likely next question which is color schemes and general urxvt config setup. I found this answer extremely helpful.
-
joharr over 4 yearsYour testing alias is a godsend.