mongol 패키지는 수직 몽골어 텍스트의 렌더링과 편집을 위한 Flutter 위젯 라이브러리입니다. 전통적인 몽골 문자에서 사용되는 고유한 가로에서 세로로 쓰는 글쓰기 시스템을 지원하여 상단에서 하단으로 흐르는 텍스트를 정확하게 표시하고 상호작용할 수 있게 합니다. 몽골어 사용자나 문화적으로 특수한 타이포그래피가 필요한 앱에 적합하며, 모든 주요 플랫폼에서 Flutter 프로젝트에 원활하게 통합됩니다. 이 패키지는 몽골 문자 규칙에 맞춰 레이아웃, 정렬 및 입력 로직을 처리합니다.
사용 사례
전통 몽골어 텍스트 표시
수직 몽골 문자 편집
몽골어 지원이 있는 다국어 앱
문화 또는 교육용 애플리케이션
몽골어 콘텐츠를 위한 디지털 출판
주요 기능
몽골 문자를 위한 수직 텍스트 렌더링
인터랙티브 텍스트 편집
크로스 플랫폼 호환성
몽골어 유니코드 문자 지원
사용자 정의 텍스트 레이아웃
적합한 대상
몽골어 사용자들을 대상으로 하는 개발자
전통 몽골 문자 타이포그래피가 필요한 앱
교육 또는 언어 소프트웨어
동아시아 또는 중앙아시아 문자를 포함하는 프로젝트
고려 사항
몽골 문자 구조에 대한 지식이 필요합니다
특정 언어 사용 사례에 제한됨
추가적인 현지화 노력이 필요할 수 있습니다
표준 수평 텍스트 레이아웃에 적합하지 않습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
mongol
This library is a collection of Flutter widgets for displaying traditional Mongolian vertical text.
The primary widgets include:
MongolText: vertical version of Text
MongolTextField: vertical version of TextField
MongolListTile: vertical version of ListTile, for use in horizontal list views and menus
MongolPopupMenuButton: vertical version of PopupMenuButton, for displaying menus
MongolAlertDialog: vertical version of AlertDialog
Displaying vertical text
MongolText is a vertical text version of Flutter's Text widget. Left-to-right line wrapping is supported.
This all assumes you've added one or more Mongolian fonts to your app assets.
Adding a Mongolian font
The library does not include a Mongolian font. 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:
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.
Editing vertical text
You can use MongolTextField to receive and edit text from the system keyboard. This widget includes most of the functionality of the standard Flutter TextField widget.
Here is it on iOS and Android interacting with a system keyboard:
If you want to use an outlined text field with a label, use MongolOutlineInputBorder:
Note: There is currently a bug in the MongolTextField for maxLines: null. PRs are welcome!
In order to correctly handle right/left and up/down keys on the web and desktop (or for physical keyboards connected to a mobile app), you need to return the MongolTextEditingShortcuts widget from the builder method of your MaterialApp (or CupertinoApp or WidgetsApp) at the top of your widget tree:
For something a little fancier, you can also use the MongolListTile widget just like you would use ListTile. Here is an example from the example project:
There are Mongol equivalents to all of the Flutter buttons:
MongolTextButton
MongolOutlinedButton
MongolElevatedButton
MongolFilledButton
MongolFilledButton.tonal
MongolTextButton.icon
MongolOutlinedButton.icon
MongolElevatedButton.icon
MongolFilledButton.icon
MongolFilledButton.tonalIcon
MongolIconButton
MongolIconButton.filled
MongolIconButton.filledTonal
MongolIconButton.outlined
The reason for the Mongol icon button is to provide a vertical tooltip that will appear for a longpress on mobile and for a mouse hover on desktop and web.
Other widgets
MongolAlertDialog
This alert dialog works mostly the same as the Flutter AlertDialog.
TODO
Improve keyboard (this may be better as a separate package)
Various other text based widgets
Support WidgetSpan.
Add more tests
For MongolTextAlign.bottom don't count final space in line height