I’m developing a mobile application using flutter to be used in my country, Sri Lanka. I have to use Sinhala language as the font in the mobile UIs. I searched it on many websites, went through documentations but unable to find a proper solution. I want to know whether there is a flutter_localization library that can be used in my application or any other solution to this. Thanks in advance.
fonts:
- family: xxx
fonts:
- asset: assets/fonts/xxx.ttf
Text(title, style: TextStyle(fontFamily: "xxx", fontWeight: FontWeight.bold),));
I’m developing a mobile application using flutter to be used in my country, Sri Lanka. I have to use Sinhala language as the font in the mobile UIs. I searched it on many websites, went through documentations but unable to find a proper solution. I want to know whether there is a flutter_localization library that can be used in my application or any other solution to this. Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/9487cf7c-5500-497d-a52d-c27320b8d20c%40googlegroups.com.
I would be loading a new font (Sinhala font in our case) and use it in the app... Here is what we do for our regional language app:
- Drop your font in the app to this path: /assets/fonts/xxx.ttf (You need to create assets/font folder in your app)
- Define it in the pubspec.yaml like:
fonts:
- family: xxx
fonts:
- asset: assets/fonts/xxx.ttf- Then attach it to the text widget where you want to use the said font:
Text(title, style: TextStyle(fontFamily: "xxx", fontWeight: FontWeight.bold),));Hope this helps... if you need a full working sample app let me know can send over the code...
On Fri, Aug 16, 2019 at 7:44 PM Yasas Sandeepa <yasassan...@gmail.com> wrote:
--I’m developing a mobile application using flutter to be used in my country, Sri Lanka. I have to use Sinhala language as the font in the mobile UIs. I searched it on many websites, went through documentations but unable to find a proper solution. I want to know whether there is a flutter_localization library that can be used in my application or any other solution to this. Thanks in advance.
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutt...@googlegroups.com.
class AppTheme {....
static bodyTextStyle(BuildContext context) {String fontFamily = Provider.of<AppSettingsProvider>(context).isEnglishLang() ? "Helvetica": "thiruvachanam" ;
return new TextStyle(fontSize: 16.0, fontFamily: fontFamily);
}
}
@override
Widget build(BuildContext context) {
...
....
return Text(verseString, style: AppTheme.bodyTextStyle(context),);
}
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/fe12e6cd-8b7f-4838-a579-63149264b7f6%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/fe12e6cd-8b7f-4838-a579-63149264b7f6%40googlegroups.com.