I am generating a PDF inside my rails app and want to use calibri font but it doesnt’work.
- I downloaded the file
- Created a folder
/fonts
in/assets
- I put the font in that folder as calibri.ttf
- changed the
application.rb
to includeconfig.assets.paths << Rails.root.join('app', 'assets', 'fonts')
- Put
//= link_tree ../fonts
inmanifest.js
according to some tip in the internet - Changed
newsletter.scss
to include:
@font-face {
font-family: "NL Calibri";
font-style: normal;
font-weight: 400;
font-display: block;
src: font-url("calibri.ttf") format('truetype');
}
- Rebooted the server after
rails assets:precompile
- Generating the Newsletter via
wicked PDF
inside the app
Problem
Trying to do inline font-family changes via style changes: font-family: 'NL Calibri'
to the elements but the font doesn’t change on the newsletter.