Here's a minimal example that does something on Linux (Ubuntu 16.04) that doesn't seem right to me:
M-: (set-frame-font "Ubuntu")
M-x describe-font <RET>
The first couple of lines that Emacs 25.1 (-Q) reports are:
name (opened by): -DAMA-Ubuntu-normal-normal-normal-*-16-*-*-*-*-0-iso10646-1 full name: Ubuntu:pixelsize=16:foundry=DAMA:weight=normal:slant=normal:width=normal:scalable=true file name: /usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-M.ttf
It's the bottom line of this that's wrong (Ubuntu-M.ttf) - Emacs is selecting the "Medium" font weight variant, instead of the "Regular". Like many fonts, the Ubuntu font has weight variants beyond the well-known "Regular" and "Bold". Such additional weights can include "Light", "Book", "Demi-Bold", "Black", "Medium".
I would like to use the Ubuntu Regular font for
variable-pitch-mode, but the Medium weight isn't suitable. I've tried various different Emacs ways of specifying a font, including
All of these display text in emacs in the wrong, medium weight. Some apps allow selecting font weight by numbers (e.g. 200=Bold), but not, I believe, Emacs. Still, the system's font selection appears to be correct, and I don't understand why Emacs isn't using this
alex@Lucifer:~$ fc-match "Ubuntu" Ubuntu-R.ttf: "Ubuntu" "Regular" alex@Lucifer:~$ fc-list "Ubuntu" file family style weight [correct output]
Can anyone confirm that this problem exists on Linux (it works fine on my Windows machine)? And, even better, can anyone point me to how to get Emacs to pick the correct weight of font?