New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the best way to include Google fonts (or any other) into create-react-based applications #2872
Comments
The process doesn't need to be any different than usual when using CRA. You can simply add the font to your |
I came across this post, there are two options though. |
I believe that post was geared more towards using custom fonts. I'm guessing you are referring to using something such as Roboto? You shouldn't have any issues following the instructions on the Google page (i've used the same font in past). |
Place the import script inside |
You can import it!
In index.js:
That's it. Webpack will include the font files in your production builds. All the Google fonts are on npm. |
Want Font Awesome? Also this simple:
HTH. |
I would just put them in public/index.html and src/index.css as suggested above. |
@robcaldecott Should be mentioned - only latin character set is currently supported |
For |
Hmm @gaearon , what about if you have 2 fonts? one for LTR and one for RTL? and you are using i18n or i18next to switch the language without the need for page reload? Don't you think using something like webfontloader would help, like you listen to the language and load the needed font? Would love hearing your thoughts. |
Well, I think that using On the other hand, using
|
As the subject suggest, I would like to receive a recommended way to including Google fonts into create-react-based applications.
The text was updated successfully, but these errors were encountered: