Orientação gerada a partir de informações públicas. Apenas para referência.
O pacote mongol é uma biblioteca de widgets do Flutter projetada para renderizar e editar texto vertical em mongol. Ele suporta o sistema único de escrita horizontal para vertical usado na escrita tradicional mongol, permitindo exibição precisa e interação com textos que fluem de cima para baixo. Ideal para aplicativos voltados para usuários da língua mongol ou aqueles que exigem tipografia culturalmente específica, integra-se perfeitamente a projetos Flutter em todas as principais plataformas. O pacote gerencia layout, alinhamento e lógica de entrada adaptadas às convenções da escrita mongol.
Casos de uso
Exibindo texto mongol tradicional
Editando scripts verticais mongóis
Aplicativos multilíngues com suporte ao mongol
Aplicações culturais ou educacionais
Publicação digital para conteúdo mongol
Principais recursos
Renderização vertical de texto para o script mongol
edição de texto interativa
Compatibilidade multiplataforma
Suporte para caracteres Unicode mongóis
Layout de texto personalizável
Indicado para
Desenvolvedores direcionados para públicos falantes de mongol
Aplicativos que exigem tipografia tradicional mongol
Software educacional ou linguístico
Projetos envolvendo escritas da Ásia Oriental ou Central
Considerações
Requer conhecimento da estrutura da escrita mongol
Limitado a casos específicos de uso de idioma
Pode ser necessário esforços adicionais de localização
Não adequado para layouts de texto horizontal padrão
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
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