đ Bangla Fonts
Bangla Fonts is a lightweight Flutter package developed by LoomixDev that allows you to use popular Bangla fonts dynamically from a CDN. Save your app size by not bundling heavy .ttf files in assets!
⨠Features
- đĻ Ultra Lightweight: No need to bundle fonts in your APK/IPA.
- ⥠Dynamic Loading: Downloads and registers fonts at runtime.
- đž Smart Caching: Automatically saves fonts locally after the first download.
- đ Reliable CDN: Hosted on high-speed GitHub Pages.
- đ¯ Easy to Use: Just one line of code to load any font.
đŧī¸ Live Preview
đ Live Demo: Explore all fonts at https://oxfaysal.github.io/bangla_fonts_cdn/
đ¨ Supported Fonts
| Font Name | Preview Text | Constant |
|---|---|---|
| Kalpurush | āĻāĻŽāĻžāϰ āϏā§āύāĻžāϰ āĻŦāĻžāĻāϞāĻž āĻāĻŽāĻŋ āϤā§āĻŽāĻžā§ āĻāĻžāϞā§āĻŦāĻžāϏāĻŋ | BanglaFonts.kalpurush |
| Shadhinata | āĻāĻŽāĻžāϰ āϏā§āύāĻžāϰ āĻŦāĻžāĻāϞāĻž | BanglaFonts.shadhinata |
| Siyam Rupali | āĻŦāĻžāϤāĻžāϏ⧠āĻŦāĻšāĻŋāĻā§ āĻĒā§āϰā§āĻŽ, āύā§āύ⧠āϞāĻžāĻāĻŋāϞ āύā§āĻļāĻž | BanglaFonts.siyamRupali |
| Nikosh | āĻŦāĻžāĻāϞāĻž āĻāĻŽāĻžāĻĻā§āϰ āĻ āĻšāĻāĻāĻžāϰ, āĻŦāĻžāĻāϞāĻž āĻāĻŽāĻžāĻĻā§āϰ āĻāĻžāώāĻž | BanglaFonts.nikosh |
| Adorsho Lipi | āĻāĻĻāϰā§āĻļ āϞāĻŋāĻĒāĻŋ āĻĻāĻŋā§ā§ āĻļā§āϰ⧠āĻšā§āĻ āĻāĻŽāĻžāĻĻā§āϰ āĻļāĻŋāĻā§āώāĻž | BanglaFonts.adorshoLipi |
| Li Adorno Irrit | āϏā§āĻāύāĻļā§āϞāϤāĻžā§ āĻāϏā§āĻ āύāϤā§āύ āĻŽāĻžāϤā§āϰāĻž | BanglaFonts.liAdornoIrrit |
| Mukti | āĻŽā§āĻā§āϤāĻŋāϰ āĻāĻžāύ⧠āĻā§āĻā§ āĻāĻ ā§āĻ āĻĒā§āϰāĻžāĻŖ | BanglaFonts.mukti |
| Sagar | āϏāĻžāĻāϰ āϤā§āϰā§āϰ āĻŽāĻŋāώā§āĻāĻŋ āĻšāĻžāĻā§āĻž āĻāĻžā§ā§ āϞāĻžāĻā§ āĻŦā§āĻļ | BanglaFonts.sagar |
| Showpnocari | āϏā§āĻŦāĻĒā§āύā§āϰ āĻĄāĻžāύāĻžā§ āĻāϰ āĻāϰ⧠āĻāϞāĻŋ āĻ āĻāĻžāύāĻžā§ | BanglaFonts.showpnocari |
| Sylheti | āϏāĻŋāϞā§āĻāĻŋ āĻāĻžāώāĻžāϰ āĻŽāĻžā§āĻžā§ āĻā§āĻžāύ⧠āĻā§āĻŦāύ | BanglaFonts.sylheti |
| Anek Bangla | āĻāϧā§āύāĻŋāĻ āĻŦāĻžāĻāϞāĻžāϰ āύāϤā§āύ āĻāĻ āϰā§āĻĒ | BanglaFonts.anekBangla |
| Hind Siliguri | āĻĒā§āϰāϝā§āĻā§āϤāĻŋ āĻ āĻŦāĻžāĻāϞāĻž āĻāĻžāώāĻžāϰ āĻŽā§āϞāĻŦāύā§āϧāύ | BanglaFonts.hindSiliguri |
| Mina | āϏāĻšāĻā§ āĻĒā§āĻžāϰ āϝā§āĻā§āϝ āϏā§āύā§āĻĻāϰ āĻŽāĻŋāύāĻž āĻĢāύā§āĻ | BanglaFonts.mina |
| SolaimanLipi | āύāĻŋāϰā§āĻā§āϞ āĻ āĻĒāϰāĻŋāĻā§āĻāύā§āύ āĻ āĻā§āώāϰā§āϰ āĻā§āĻā§āĻž | BanglaFonts.solaimanLipi |
| Li Dhakaia | āĻĒā§āϰāĻžāύ āĻĸāĻžāĻāĻžāϰ āĻāϤāĻŋāĻšā§āϝ⧠āĻā§āϰāĻž āĻĢāύā§āĻ | BanglaFonts.liDhakaia |
| Li Dorswadesh | āύāĻŋāĻā§āϰ āĻĻā§āĻļā§āϰ āĻŽāĻžāĻāĻŋāϰ āĻā§āϰāĻžāĻŖā§ āĻāϰāĻž | BanglaFonts.liDorswadesh |
| Li Liakote Kota | āύāĻžāύā§āĻĻāύāĻŋāĻ āĻ āĻā§āώāϰ āĻāϰ āĻļā§āϞā§āĻĒāĻŋāĻ āĻāĻžāύ | BanglaFonts.liLiakoteKota |
| Li Shamim Chitra | āĻāĻŋāϤā§āϰāĻžāϞ⧠āĻŽāĻžā§āĻžāϰ āĻāĻ āĻ āĻĒā§āϰā§āĻŦ āĻĒā§āϰāĻāĻžāĻļ | BanglaFonts.liShamimChitra |
| Li Ullash | āύāϤā§āύ āĻĻāĻŋāύā§āϰ āύāϤā§āύ āĻāϞā§āϞāĻžāϏ | BanglaFonts.liUllash |
| SuTonnyOMJ | āĻāĻŋāϰāĻā§āύāĻž āĻŦāĻŋāĻā§ āĻāĻŋāĻŦā§āϰā§āĻĄā§āϰ āĻĒā§āϰāĻŋā§ āĻĢāύā§āĻ | BanglaFonts.sutonnyOMJ |
đ Getting Started
Installation
Add this to your pubspec.yaml:
dependencies:
bangla_fonts: ^1.1.0
1. Initialize & Load
It's recommended to load your primary font in the main() function to avoid layout shifts.
import 'package:bangla_fonts/bangla_fonts.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// [Optional] Pre-load a specific font at app startup
// This prevents the font from "flicking" when it's first displayed.
await BanglaFonts.load(BanglaFonts.kalpurush);
runApp(const MyApp());
}
2. Apply in UI
Simply use the font name in your TextStyle.
Text(
"āĻāĻŽāĻžāϰ āϏā§āύāĻžāϰ āĻŦāĻžāĻāϞāĻž",
style: TextStyle(
fontFamily: BanglaFonts.kalpurush,
fontSize: 22,
fontWeight: FontWeight.w500,
),
)
đ ī¸ Troubleshooting
If the fonts are not loading or displaying correctly, please check the following:
-
Internet Connection: Since the fonts are loaded dynamically from a CDN, an active internet connection is required for the first-time load. Once loaded, they are cached locally for offline use.
-
Ensure Initialization: If you are pre-loading fonts in
main(), make sure you have calledWidgetsFlutterBinding.ensureInitialized();before callingBanglaFonts.load(). -
HTTP Permissions:
- Android: Ensure you have added internet permission in your
AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />- macOS: If you are testing on macOS, enable network access in
DebugProfile.entitlementsandRelease.entitlements.
- Android: Ensure you have added internet permission in your
-
Font Family Name: Double-check that you are using the constants from the
BanglaFontsclass (e.g.,BanglaFonts.kalpurush) instead of typing the string manually to avoid typos. -
Clean Build: Sometimes Flutter's cache can cause issues. Try running:
flutter clean
flutter pub get
đ¤ Contributing
Found a bug or want to add a new font?
-
Fork the Project.
-
Create your Feature Branch (git checkout -b feature/NewFont).
-
Commit your Changes (git commit -m 'Add NewFont').
-
Push to the Branch (git push origin feature/NewFont).
-
Open a Pull Request.
đ§ Contact & Support
If you have any questions, feedback, or run into issues while using bangla_fonts, feel free to reach out:
- Email: loomixdev@gmail.com
- GitHub: https://github.com/oxfaysal
- Facebook: https://web.facebook.com/0xfaysal
I'm happy to help you with any improvements or fixes!
Maintained by Faysal (LoomixDev)
Important
Acknowledgments & Credits: > Heartfelt thanks to OmicronLab, Lipighor, and all the talented font creators for their incredible contributions to the Bangla typography ecosystem.
Caution
License & Disclaimer: > All fonts included/linked in this package are the intellectual property of their respective creators. This package is intended for development and educational purposes. Please ensure you comply with the specific license of each font for commercial use.