bchall.org

Home | About | Now | Projects

Adding WebFonts to this site

Created Sun Nov 22 10:24:01 PM EST 2026

Over the past few days I have been working on adding webfonts to this site. Right now, all headers and body text except the navigation bar are Linux Biolinum, a free font licensed under the OFL. Adding better fonts has been on my mind for a while, but I became much more interesteed in the idea after reading much of Matthew Butterick's Practical Typography. I was inspired to try this out after reading this great MDN article about webfonts and seeing how easy it was, and after reading Butterick's work, where he also emphasizes both the importance of typography and how much easier it is to include fonts in webpages now.

Web Fonts

I have decided to use Web Fonts, in the form of .woff2 files, to provide fonts for this page. This means the fonts are hosted on my web server, linked as files in each page's source. One of the easiest ways to do this historically has been via Google Fonts, which has a great UI where you can pick different fonts, see example text at different sizes and weights, and much more. Google Fonts also gives you the code snippets you need to include the fonts in your site with simple changes to your CSS.

The downside of Google Fonts is that they are hosted on Google. This means both that you depend on Google for assets to display your own page, and that Google can see who visits your page when they go to fetch the fonts for it. Since I disagree with this, I have opted to host the fonts myself.

System Fonts

If you learned HTML like I did, you might remember adding style attributes or CSS to specify fonts on a site. Back then, the best way to do it was to make a list from most specific to least specific, ending up with something like "Helvetica, Arial, sans-serif". Systems that didn't have Helvetica would fallback to Arial, and so on. This is a necessary concession as not all systems have the same installed fonts available, and the browser relies on the system's font library (or it's own) to render the page.

With Web Fonts, you can provide the font files to the browser direclty from your server, so you don't have to worry about the page rendering differently on different clients depending on their font availability. On a site like this, that's not such a concern (it's mostly just text, no UI). But it's nice to have the effort you put into selecting typefaces and font sizes rewarded on all clients, not just the ones with the fancy fonts you specified.

Integrating Web Fonts

Mostly I followed the MDN article's steps, linked above. I won't reproduce them all here. I just adapted them to the current setup I have for this site.

Briefly, it was:

  1. Download the fonts from DaFont
  2. Upload the formats I wanted (in this case, Regular, Bold, and Italic) to the Transfonter site, to convert them into .woff2 files. Transfonter also gives you CSS snippets you can include directly in your CSS.
  3. I modified the CSS for my specific needs and for the setup for this site. That just meant adjusting the load paths for the linked files, and making sure the references were all correct so that bold and italic fonts got used automatically.

Open, good fonts

There are a lot of passionate people out there making open, freely available fonts that you can use gratis. I think this is fantastic and in the spirit of free software, so we can also have great free fonts to use with it. In the future, I might consider adding fonts like Matthew Butterick's, which I really admire; I'm not against paying for good work like that given that I have the means. (He also offers Practial Typography for free, the only compensation available is by way of his typefaces.) But I think it's great that there are gratis options available for everyone.

Page last generated on 2026-11-22 Sun 22:34