a husky looking at the camera smiling

4/6 - How to display Custom Fonts on Linux.

when i first switched to linux, i didn't know just how much websites would change. especially on neocities.

this sites favourite font (and mine) is MS PGothic. with the MS standing for microsoft.

looking back now, i feel so embarrassed for not figuring this out further, so to heal my ashamed heart, i tell how i solved this. 5 months later.

you had to download them separately

microsoft fonts are already preinstalled within windows, allowing for the use and ability to display on websites using them.

if the appropriate file is not installed on the system, the browser is not able to fetch it and falls back on another font listed. if there is no other font listed, it will default to serif.

this is also why secondary fonts are important to make your site look as good as you'd like it.

so, how do you download these fonts on linux?

first, you'll need to find the fonts. you can find a lot of fonts on github or just googling the font you need. this can be risky, however so always check with something like virustotal or another file checker just for safe measure.

next, you'll need to load it into your system. i'm using endeavourOS with KDE Plasma desktop environment, so the settings might look different, but the steps should be the same.

navigate to the FONTS section in your settings. for me it looks like this.

screenshot of settings to fonts

then go to something along the lines of FONT MANAGEMENT. click import from file and select your text file. i'm under the assumption that .woff, .ttf & others should work.

screenshot of font management

at first, it'll look like nothing happened, but that should mean it worked! to confirm, open your browser with that font and see if it displays, if everything was done correctly, you should see it!

i was absolutely stumped on this for a shameful amount of time, not even the stack sites would help me...but hopefully this helped you in some way or you've learned something new!!