Created
October 19, 2023 12:41
-
-
Save HelgeSverre/db64490f836348654ca5fdab6b2d5e54 to your computer and use it in GitHub Desktop.
Adding Inter font to Flutter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The package "google_fonts" has a bug related to font weights, | |
# dont bother using it, just do this instead: | |
# Click "Download Family" on https://fonts.google.com/specimen/Inter | |
# Unzip the file and throw the .ttf files into assets/fonts/ | |
# Specify the Font family in your code like so: | |
# MaterialApp(theme: ThemeData(fontFamily: "Inter")); | |
## Then add this config to your pubspec.yaml file | |
flutter: | |
assets: | |
- assets/fonts/ | |
fonts: | |
- family: Inter | |
fonts: | |
- asset: assets/fonts/Inter-Thin.ttf | |
weight: 100 | |
- asset: assets/fonts/Inter-ExtraLight.ttf | |
weight: 200 | |
- asset: assets/fonts/Inter-Light.ttf | |
weight: 300 | |
- asset: assets/fonts/Inter-Regular.ttf | |
weight: 400 | |
- asset: assets/fonts/Inter-Medium.ttf | |
weight: 500 | |
- asset: assets/fonts/Inter-SemiBold.ttf | |
weight: 600 | |
- asset: assets/fonts/Inter-Bold.ttf | |
weight: 700 | |
- asset: assets/fonts/Inter-ExtraBold.ttf | |
weight: 800 | |
- asset: assets/fonts/Inter-Black.ttf | |
weight: 900 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment