Mongolian Vertical Script Widgets for Flutter Apps

Mongolian Vertical Script Widgets for Flutter Apps

mongol This library is a collection of Flutter widgets for displaying traditional Mongolian vertical text.

mongol

This library is a collection of Flutter widgets for displaying traditional Mongolian vertical text.

Vertical text

MongolText is a vertical text version of Flutter's Text widget. Left-to-right line wrapping is supported.

MongolText('ᠨᠢᠭᠡ ᠬᠣᠶᠠᠷ ᠭᠤᠷᠪᠠ ᠳᠦᠷᠪᠡ ᠲᠠᠪᠤ ᠵᠢᠷᠭᠤᠭ᠎ᠠ ᠨᠠᠢᠮᠠ ᠶᠢᠰᠦ ᠠᠷᠪᠠ'),

The library supports mobile, web, and desktop.

Emoji and CJK characters

The library rotates emoji and CJK (Chinese, Japanese, and Korean) characters for proper orientation.

Text styling

You add styling using TextSpan and/or TextStyle, just as you would for a Text widget.

MongolText.rich(
  textSpan,
  textScaleFactor: 2.5,
),

where textSpan is defined like so:

const textSpan = TextSpan(
  style: TextStyle(fontSize: 30, color: Colors.black),
  children: [
    TextSpan(text: 'ᠨᠢᠭᠡ\n', style: TextStyle(fontSize: 40)),
    TextSpan(text: 'ᠬᠣᠶᠠᠷ', style: TextStyle(backgroundColor: Colors.yellow)),
    TextSpan(
      text: ' ᠭᠤᠷᠪᠠ ',
      style: TextStyle(shadows: [
        Shadow(
          blurRadius: 3.0,
          color: Colors.lightGreen,
          offset: Offset(3.0, -3.0),
        ),
      ]),
    ),
    TextSpan(text: 'ᠳᠦᠷ'),
    TextSpan(text: 'ᠪᠡ ᠲᠠᠪᠤ ᠵᠢᠷᠭᠤ', style: TextStyle(color: Colors.blue)),
    TextSpan(text: 'ᠭ᠎ᠠ ᠨᠠᠢᠮᠠ '),
    TextSpan(text: 'ᠶᠢᠰᠦ ', style: TextStyle(fontSize: 20)),
    TextSpan(
        text: 'ᠠᠷᠪᠠ',
        style:
            TextStyle(fontFamily: 'MenksoftAmuguleng', color: Colors.purple)),
  ],
);

This all assumes you've added one or more Mongolian fonts to your app assets.

Adding a Mongolian font

Previous versions of this library included a Mongolian font. However, as of version 0.6.0, the font is removed. This allows the library to be smaller and also gives developers the freedom to choose any Mongolian font they like.

Since it's likely that some of your users' devices won't have a Mongolian font installed, you should include at least one Mongolian font with your project. Here is what you need to do:

1. Get a font

You can find a font from the following companies:

This one from Menksoft is the one that used to be included in the library.

2. Add the font to your project

You can get directions to do that here and here.

Basically you just need to create an assets/fonts folder for it and then declare the font in pubspec.yaml like this:

flutter:
  fonts:
    - family: MenksoftQagan
      fonts:
        - asset: assets/fonts/MQG8F02.ttf

You can call the family name whatever you want, but this string is what you will use in the next step.

3. Set the default Mongolian font for your app

In your main.dart file, set the fontFamily for the app theme.

MaterialApp(
  title: 'My App',
  theme: ThemeData(fontFamily: 'MenksoftQagan'),
  home: MyHomePage(),
);

Now you won't have to manually set the font for every Mongolian text widget. If you want to use a different font for some widgets, though, you can still set the fontFamily as you normally would inside TextStyle.

You may also consider using mongol_code with a Menksoft font if your users have devices that don't support OpenType Unicode font rendering. mongol_code converts Unicode to Menksoft code, which a Menksoft font can display without any special rendering requirements.

MongolAlertDialog

This alert dialog works mostly the same as the Flutter AlertDialog.

Keyboard and vertical TextField

These are not part of mongol library yet, but you can see an example of how to make a custom in-app keyboard and a vertical TextField in the example app that's included with this library. Here is a screenshot from the demo app:

The text field is just a standard TextField rotated by 90 degrees. For that reason, it only supports single line input.

TODO

  • Multiline MongolTextField class
  • Improved keyboard
  • Various other text based widgets
  • Support WidgetSpan.

Download Details:

Author: suragch

Source Code: https://github.com/suragch/mongol

flutter dart mobile-apps

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Google's Flutter 1.20 stable announced with new features - Navoki

Google has announced new flutter 1.20 stable with many improvements, and features, enabling flutter for Desktop and Web

Top 25 Flutter Mobile App Templates in 2020

Flutter has been booming worldwide from the past few years. While there are many popular mobile app development technologies out there, Flutter has managed to leave its mark in the mobile application development world. In this article, we’ve curated the best Flutter app templates available on the market as of July 2020.

Flutter App Development Trends 2020

As the new decade dawns upon us, a slew of technologies has been making a lot of noise to grab the developers’ attention. While native app development is going strong, the trade winds are now blowing towards going cross-platform.

How To Succeed In Mobile App Wireframe Design?

This article covers everything about mobile app wireframe design: what to do and what not, tools used in designing a mobile or web app wireframe, and more.

Top 10 Mobile App Development Companies in India

The mobile application scenario has been continually changing over the years. In recent years India has become a center for mobile app development companies. The increase of smartphones has instantly increased the requirements for these apps. Every year new technological trends occur due to contin