🚀 Bangla Fonts

Pub Version License: MIT

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.1

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 called WidgetsFlutterBinding.ensureInitialized(); before calling BanglaFonts.load().

  • HTTP Permissions:

    1. Android: Ensure you have added internet permission in your AndroidManifest.xml:
      <uses-permission android:name="android.permission.INTERNET" />
    
    1. macOS: If you are testing on macOS, enable network access in DebugProfile.entitlements and Release.entitlements.
  • Font Family Name: Double-check that you are using the constants from the BanglaFonts class (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:

I'm happy to help you with any improvements or fixes!



Developed with love
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.

Libraries

bangla_fonts