How To Use Web Fonts In blogdown

TC

2018/02/15

Categories: trivial Tags: blogdown hugo

There are several ways to set font types in your blogdown site:

Font files for chinese are usually large so web font is not an option. But english fonts are fine.

In the rest of the post I’ll demonstrate:

Results:


I am in spin_cycle

ABCDEFGHIJKLMNOPQRSTUVWXYZ


Web fonts

your css should look like:

@font-face {
  font-family: "spin_cycle";
  src: url("/spin_cycle.ttf");
}
body {
  font-family:  "spin_cycle"
}

Take a look at my repo for a example: - css - font file

Google fonts

your css should look like:

@import url(https://fonts.googleapis.com/css?family=Open+Sans);

body{
   font-family: 'Open Sans',serif;
}
comments powered by Disqus