LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   font rendering in different terminals (https://www.linuxquestions.org/questions/linux-general-1/font-rendering-in-different-terminals-4175613563/)

jr_bob_dobbs 09-10-2017 05:51 PM

font rendering in different terminals
 
I've noticed that some times the same font will render differently depending on the terminal being used.

I've uploaded a picture here: https://prnt.sc/gjkfrg

In the linked picture, I have xfce4-terminal and urxvt. I've had trouble getting that font (Bitstream Vera Sans Mono) to render in previous distros, but setting font hinting fixed it. Not this time, at least in xterm and urxvt. I use the same font in a text editor and it renders correctly there.

I guess my question is, why do some terminals handle fonts differently?

Myk267 09-10-2017 10:37 PM

It looks like xfce4-terminal is rendering with full hinting and urxvt is using slight hinting. It seems that a few programs like URxvt just don't use fontconfig like most programs: https://wiki.archlinux.org/index.php...config_support

Edit: Even after you get that sorted out, I suspect you might even find that URxvt renders fonts with slightly different spacing than a lot of other terminals. There's some polite disagreement about this on the URxvt mailing lists. There's also patches to "fix" it, but you'll have to hunt around for them, if you dare going down that route.

dugan 09-11-2017 11:21 AM

Quote:

Originally Posted by Myk267 (Post 5757483)
Even after you get that sorted out, I suspect you might even find that URxvt renders fonts with slightly different spacing than a lot of other terminals. There's some polite disagreement about this on the URxvt mailing lists. There's also patches to "fix" it, but you'll have to hunt around for them, if you dare going down that route.

I stopped using urxvt ages ago due to that kerning issue.

xterm renders fonts differently because it relies more on your X resource settings. You probably want an .Xresources file with the following:

Code:

Xft.autohint: 0
Xft.lcdfilter: lcddefault
Xft.hintstyle: hintslight
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb

If you use a GTK or Qt-based terminal (I like either termite, or terminator 1.91), its font rendering should be more consistent with what GTK and Qt-based apps are showing.

jr_bob_dobbs 09-25-2017 10:37 PM

Thank you, everyone, for the replies. Between those, plus much googling and a great deal of Trial And Error, I've actually got both xterm and uxvrt to render that font the way I like. :)

This parameter was crucial in xterm command line:
Code:

-fa "xft:DejaVu Sans Mono:pixelsize=16:hinting=true:hintstyle=hintfull"
and for urxvt:
Code:

-fn "xft:Bitstream Vera Sans Mono:pixelsize=16:hinting=true:hintstyle=hintfull"
Note: neither one of those is the complete command line: lots of things for setting colors & stuff omitted for clarity.

note: I've also got settings in several files, but the font would not render until I added those parameters to the call of xterm and urxvt. Files created/modified: XTerm, .Xresource and .Xdefaults. The point is, between all of the interactions, maybe those parameters won't work on every system?


All times are GMT -5. The time now is 07:00 AM.