Sample Header Ad - 728x90

How does Linux find the bold variant of a given font?

10 votes
1 answer
646 views
There is a monospace font family I like called IBM Plex Mono. It comes with several font weights beyond just normal and bold, namely:
Thin
ExtraLight
Light
Regular
Medium
SemiBold
Bold
Now, I have two workstations that I use regularly. One of them runs Kubuntu 22.04, where I have installed this font family using apt (it is in the repos). The other one runs Fedora Kinoite, and I have installed the font by downloading the .woff2 files and copying them to my ~/.local/share/fonts directory. On both machines, I have set the default monospace font (using the Fonts settings in KDE settings) to **IBM Plex Medium,** which is the weight I like to use in my terminal (Konsole). After doing this, Konsole uses the correct medium weight in the terminal. However, the two machines render *bold* text in the terminal differently, which you can test by running echo -e "\033[1mBold\033[0m normal" to print some bold text using ANSI escape codes. - On the Kubuntu machine, a bolder font weight (I think it's the Bold weight) is used. - On the Fedora machine, the font weight is exactly the same, as though the font resolution has decided that Medium is “already” bold enough. My immediate problem, of course, is that I would like to figure out how to get Fedora (or at least Konsole) to use a variant of the font that actually has heavier weight so that I can tell bold and normal text apart. But my question is broader than that—given a pile of .woff2 (or .ttf or whatever) files in ~/.local/share/fonts, and that I have specified one of these as my default monospace font, how does Linux decide which variant to use when Konsole asks for "default monospace with bold weight"? Is there a way I can control this myself, e.g. in /etc/fonts/conf.d/? ---- This question is similar to mine, but it's fairly old and doesn't really cover the "best practices" for how to set up these kinds of mapping (e.g. where I should stick that XML): https://unix.stackexchange.com/questions/311988/how-do-i-alias-the-bold-weight-of-a-font-family-to-the-bold-weight-of-another-fo
Asked by Max (203 rep)
Jul 13, 2024, 12:31 AM
Last activity: Jul 13, 2024, 02:11 AM