Angular
To integrate Fontsource into your Angular project, follow the steps below.
1. Installation
First, install the font package you want to use:
⬤⬤
sh
2. Import in Main Entry File
For Angular 17+ projects, the recommended approach is to import fonts in your main entry file (main.ts):
⬤⬤
ts
3. Alternative: Component-Level Import
You can also import fonts directly in individual components:
⬤⬤
ts
4. Legacy Installation
If you’re using the traditional module-based Angular architecture (pre-Angular 17), you can import fonts in your AppModule:
⬤⬤
ts
5. CSS Usage
Once imported, you can use the font in your component stylesheets:
⬤⬤
css
6. Global Styles
For application-wide font usage, add the font family to your global styles (styles.css):
⬤⬤
css