question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use custom fonts?

See original GitHub issue

First of all, thanks for that great module!

Would someone elaborate on how to use custom fonts? I’ve seen the business-card example with @font-face definiton, but it’s unclear to me what the file-path of the font must be relative to.:

<html>
   <head>
      <style>
         @font-face {
           font-family: 'MyOpenSans';
           font-style: normal;
           font-weight: 400;
           src: url(file://app/templates/fonts/OpenSans-Regular.ttf); <-- ?
         }
   </style>
     ...

Would appreciate some info!

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:4
  • Comments:6

github_iconTop GitHub Comments

4reactions
woodscreativecommented, Aug 12, 2019

I base64 the src if that helps.

@font-face {
  font-family: "CustomFont";
  font-style: normal;
  font-weight: 700;
  src: url(data:font/truetype;base64,....)
}
0reactions
marco910commented, Jan 13, 2022

I base64 the src if that helps.

@font-face {
  font-family: "CustomFont";
  font-style: normal;
  font-weight: 700;
  src: url(data:font/truetype;base64,....)
}

I’m using the same but still have the “DejaVuSans” font inside my PDF. How can if fix this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Install Custom Fonts on Your Computer [Quick Tip]
1) Shut down any program you want to use the font in. · 2) Download the font to your computer and extract files...
Read more >
The Easy Way to Add Fonts to Your Website (Including ...
How to add custom fonts to your website using @font-face · Step 1: Download the font · Step 2: Create a WebFont Kit...
Read more >
Use a custom font - Flutter documentation
Use a custom font ; 1. Import the font files. Supported font formats ; 2. Declare the font in the pubspec. pubspec.yaml option...
Read more >
How To Load and Use Custom Fonts with CSS | DigitalOcean
You will use the font stack, a rank ordering of fonts based on availability, to use fonts that may be installed on the...
Read more >
Using custom fonts - Studio Help - Google Support
If you want to use different custom fonts for each variation of a single dynamic creative, upload the fonts into Asset Library, then...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found