include a local custom font in bookdown

15 Views Asked by At

In my project folder I have an assets folder that contains font files.

BCSans-Bold.woff
BCsans-Regular.woff

etc.

My _output.yml file points to my css

bookdown::gitbook:
   css: assets/style.css

and within this file I am using

@font-face {
  font-family: "BCSans";
  font-style: normal
  src:url('assets/BCSans-Regular.woff');
}

Which doesn't work and I get the error message in console

[WARNING] Could not fetch resource assets\assets/BCSans-Regular.woff

I'm more used to using shiny where everything in the www is automatically included. I'm not sure if there is something similar with bookdown or there is a yaml option I am missing.

Any advice on what the correct syntax or how to fix would be appreciated!

0

There are 0 best solutions below