This is an excerpt of my pubspec.yaml file:
flutter: uses-material-design: true fonts: - family: Coiny fonts: - asset: fonts/Coiny-Regular.ttf
I am trying to use the font called "Coiny" from the Google Fonts page. I created a fonts folder inside my root directory and put it in there.
In my code, I do this:
new Text("Testtext", style: new TextStyle(fontFamily: "Coiny")),
But it has no effect. I have encountered a similar problem in the past with the Barrio font. But it seemed to work after some time, which is not the case with this one.
The flutter recent version v1.12.13 does not support the open type font(otf) directly. You have to convert the otf to true type font(ttf) somehow. You can use this third-party website to covert the font to ttf before using it in your project.
You might want to try removing the app from the device and reinstalling it. Depending on how you're launching, it might not be writing over the old install file.
I had the same issue. If you're testing via an emulator, you just need to stop and restart it. Via VSCode you can just stop the run process (Red square in the top right) and then run
-> Run without debugging
or Start Debugging
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With