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.

theme.customFonts doesn't seem to work

See original GitHub issue

First of all, I am in love with this project! 😃

I am trying to use custom fonts, and it seems, by defining font in the theme.customFonts, and then referencing it in the fonts doesn’t seem to do its job.

So let’s consider the following:

customFonts: {
    inter: {
      bold: "Inter-Bold",
      default: "Inter-Regular",
      normal: "Inter-Regaulr",
      "400": "Inter-Regular",
      "300": "Inter-Thin",
      "500": "Inter-Medium",
      "600": "Inter-Medium",
      "700": "Inter-SemiBold",
    },
  },
  fonts: {
    root: "inter",
  },

Of course, the assets are loaded, using the Font.loadAsync(fonts) in a custom provider.

This throws the following error:

fontFamily “inter” is not a system font and has not been loaded through Font.loadAsync. If you intended to use a system font, make sure you typed the name correctly and that it is supported by your device operating system.

The weird thing, if i change it like this:

fonts: {
    root: "Inter-Bold",
  },

The font changes to bold. This works though both ob the device and in the browser, so that’s good.

Any idea how to get around on this?

Thank you in advance!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nandorojocommented, Dec 29, 2020

Looks like it was because it wasn’t capitalized in the theme before. Glad it’s working.

0reactions
zilahircommented, Dec 29, 2020

UPDATE:

Hah! It seems like it’s working this way! 😃

Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom Fonts not showing new fonts - WordPress.org
Hello – I have been having trouble getting my custom fonts loaded on one of my sites. It seemed to disappear from my...
Read more >
Solved: My uploaded custom fonts don't work on a Theme Tem...
1. Coverted the font; 2. Uploaded it to the platform - The converted .eot, .svg, .ttf and .woff formats; 3. Updated the CSS...
Read more >
Custom Fonts Not Displaying On Front End - Elementor
Go to Elementor > Custom Fonts. If the URLs listed do not begin with https, click the DELETE button next to each, and...
Read more >
How to Add Custom Fonts to Your WordPress Site (3 Methods)
How to add custom fonts to your WordPress site (three methods) · 1. Edit your theme's file · 2. Upload your font's file...
Read more >
Topic: Responsive Theme – Custom Font Size Doesn't Work
Hello, hope you can help Am trying to change the Custom Font size of the Responsive theme but it doesn't seem to be...
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