In my experience, Emacs does not reliably read font settings from font config or from Gnome, so you may need to change Emacs' font rendering settings.
Notably, the colored pixels around the font in GVim indicate that GVim uses subpixel rendering, whereas the absence of these pixels in Emacs shows that it only uses hinting. The absence of subpixel rendering often makes fonts look blurry.
Find out GVims preferences
Find out what font rendering settings GVim uses. I presume it takes the standard ones from Gnome, so install Gnome Tweaktool to inspect the font settings from Gnome.
Tell Emacs about your font preferences
Now create an .Xresources
file that tells Emacs about these settings. The following is represents my font settings, adapt it according to what you have found out in Gnome Tweaktool:
Xft.antialias: 1
Xft.hinting: 1
Xft.hintstyle: hintfull
Xft.lcdfilter: lcddefault
Xft.rgba: rgb
As far as I know, the lcdfilter
setting isn't available in Gnome Tweaktool, so just leave it on lcddefault
. After creating the file
- Exit Emacs with
C-x C-c
Load these settings with:
$ xrdb -merge ~/.Xresources
Verify that the settings were loaded:
$ xrdb -query | grep Xft Xft.antialias: 1 Xft.hinting: 1 Xft.hintstyle: hintfull Xft.lcdfilter: lcddefault Xft.rgba: rgb
Restart Emacs
Now check whether the fonts look the same now. Note that GVim may use a different font renderer (e.g. Cairo, Harfbuzz or whatever), so expect some slight differences anyway.
Check that the settings are permanent
- Log out of your desktop
- Log in again
- Use above
xrdb -query
command to verify the presence of your font settings