Ever since I have FreeBSD 12 installed on a spare laptop, I notice that this is the most frequently used portable machine at home. (Of course, I still use my main desktop, which runs Fedoda 27, for everything.) I think one of the main reasons is that I like the experiences when I started using Linux years ago – not everything works out of the box, and sometimes I’m forced to learn and understand better about an issue before it can be fixed.

So today, I managed to fix another font rendering issue of the source code viewer on Github on Firefox. Here’s how it looks like before the fix:

Everyone’s guess must be some fonts used on Github to display the source code must be unavailable on my system. But which font? According to a page on Quora1, the code is displayed in the first font available on my system:

  1. Consolas

  2. Liberation Mono

  3. Courier

  4. monospace

So one way to fix this is to try to install one of those listed font above. Another solution which I have yet to verify is to update the fonts.conf (usually resides in ~/.config/fontconfig directory) to include the substitute of the missing fonts with available one. Anyway, I went with the 3rd solution which is to install a font called Liberation from Red Hat. This fonts are to replace Microsoft TTF fonts. I came across this font name while viewing a Youtube video2.

Then without even restarting Firefox, I just refreshed the Github page with F5. Here’s what I see now:

That’s it. All I need to do now is to figure out how to crop the images screenshot on FreeBSD using i3-gaps as the window manager.


References:

  1. What font and theme does GitHub use in its code viewer?

  2. After a Minimal Linux Install: Graphical Environment and Users