I didn't know Fontsource before your article Dan, thanks for sharing. I have a question, which is the benefice to use this package instead download and manage the font locally?
When I want to have a font in my project, usually I have a folder called assets/fonts in my src folder who contains the font files and the workaround to import them is similar to the described in your post
Hey mate, glad you got something out of my post! βΊοΈ
The main difference is that by using Fontsource, you are effectively treating your self-hosted fonts as package dependencies that can be version locked and updated as needed.
It also saves you from having to manage the font files themselves, and from having to maintain a directory structure for them.
For example: if you need an extra subset (weight 500 italic) then itβs just one import line away, as opposed to downloading the new subset, converting it with Transfonter, adding the converted files to your repo and then importing the font for use.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I didn't know Fontsource before your article Dan, thanks for sharing. I have a question, which is the benefice to use this package instead download and manage the font locally?
When I want to have a font in my project, usually I have a folder called assets/fonts in my src folder who contains the font files and the workaround to import them is similar to the described in your post
What's the difference between this two methods?
There is another advantage: its run offline, so, you can use it in a progressive web app :)
Exactly! π
Hey mate, glad you got something out of my post! βΊοΈ
The main difference is that by using Fontsource, you are effectively treating your self-hosted fonts as package dependencies that can be version locked and updated as needed.
It also saves you from having to manage the font files themselves, and from having to maintain a directory structure for them.
For example: if you need an extra subset (weight 500 italic) then itβs just one import line away, as opposed to downloading the new subset, converting it with Transfonter, adding the converted files to your repo and then importing the font for use.