Skip to main content
  1. All Posts/

Changing the Blog Font

·191 words·1 min·
Aaron
Author
Aaron
I only know that I know nothing.
Table of Contents

Preface
#

I’ve been using the open-source font “LXGW WenKai”1 for a while now and really like it, so I decided to change my blog’s font to LXGW WenKai as well.

Configuration
#

Reading the font’s [Issue #24]2, I found that someone had already converted the font using the ttf2woff2 tool and provided a method to use it on web pages. After testing, I found that using lxgw-wenkai-webfont directly doesn’t render correctly in Safari, but lxgw-wenkai-lite-webfont works fine. The lite version has some font weights removed, which makes it more compatible.

A quick search 3 revealed that the Congo theme allows inserting extra code into the template’s and

sections. Simply create layouts/partials/extend-head.html or layouts/partials/extend-footer.html files. After creating the html file and pasting the code below, save and refresh the page to see the LXGW WenKai font applied to your blog.

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/[email protected]/style.css"
/>
<style>
  body {
    font-family: "LXGW WenKai Lite", sans-serif;
  }
</style>

References
#


  1. An open-source Chinese font with a fresh style ↩︎

  2. Pre-converted font version from Issue #24 ↩︎

  3. Congo theme documentation on where to insert extra code ↩︎