I'm trying to show Chinese characters in my Flutter web app with Chinese font. Something like this.
After downloading the font ttf file, I applied it to my Chinese characters, but it doesn't seem to work.
Here is how I apply my styling.
Text(
"你好",
style: TextStyle(
fontFamily: "Chinese",
fontSize: 70,
color: Color.fromARGB(255, 234, 222, 218)
),
)
This is my pubspec.yaml file.
fonts:
- family: Chinese
fonts:
- asset: assets\fonts\MaShanZheng-Regular.ttf
How do I solve this? Much appreciated :)
Pubspec is very sensitive about indentation:
Make sure you have the right path too and got the font