You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Congratulations and thank you for the awesome plugin!
It really handles font loading with ease. I have a specific example that I am not sure how to handle with gatsby-omni-font-loader and I would appreciate the help.
The problem is the following.
Custom fonts are specified in the custom config key.
This seems like a normal configuration, from what I saw in the documentation. However, although these fonts are very similar, their weights make a big difference in terms of the character width. gatsby-omni-font-loader waits for only one variant to be loaded, and in my case, the first one that needs to be shown on the page is not one that is loaded until then, which looks like an additional layout shift after the other one is loaded. I am using enableListener config which adds the loaded class to the body element.
Is there a way to wait for all the weights to load?
The text was updated successfully, but these errors were encountered:
Hi Renato,
thanks for reaching out. I see the issue, but I'm afraid that the only way of loading the font in a way you described is to rename the font family to MyCustomFontName-Bold, etc. This should work in theory.
However, I am planning a big update for the plugin in the future and I'm actively looking for the features to include in the future releases. So I'll be adding this one to the list.
Thanks and keep me posted if you've found another way to tackle this issue with the plugin
Hello Adrian!
Congratulations and thank you for the awesome plugin!
It really handles font loading with ease. I have a specific example that I am not sure how to handle with
gatsby-omni-font-loader
and I would appreciate the help.The problem is the following.
Custom fonts are specified in the
custom
config key.Something like this:
fonts.css
looks something like this:This seems like a normal configuration, from what I saw in the documentation. However, although these fonts are very similar, their weights make a big difference in terms of the character width.
gatsby-omni-font-loader
waits for only one variant to be loaded, and in my case, the first one that needs to be shown on the page is not one that is loaded until then, which looks like an additional layout shift after the other one is loaded. I am usingenableListener
config which adds the loaded class to thebody
element.Is there a way to wait for all the weights to load?
The text was updated successfully, but these errors were encountered: