Open iceXice opened 2 weeks ago
const text2 = TextSpan( children: [ TextSpan(text: '1234567890'), TextSpan(text: '👨👩👧'), TextSpan(text: '👋🏿'), TextSpan(text: '🇭🇺'), TextSpan(text: '一二三四五六七八九十'), TextSpan( text: '\uD83D\uDE03\uD83D\uDE0A\uD83D\uDE1C\uD83D\uDE01\uD83D\uDE2C\uD83D\uDE2E\uD83D\uDC34\uD83D\uDC02\uD83D\uDC2B\uD83D\uDC11\uD83D\uDC10'), TextSpan(text: '①②③㉑㊿〖汉字〗한국어モンゴル語English? ︽ᠮᠣᠩᠭᠣᠯ︖︾'), ], );
This is a problem with the line-breaking. Flutter doesn't give access to a good line-breaker so the current solution in this package just breaks lines on single emojis, CJK characters, newlines, and spaces. The implementation is here:
https://github.com/suragch/mongol/blob/master/lib/src/base/mongol_paragraph.dart#L1108
To solve this, we would need a more sophisticated algorithm that breaks long words (both English and Mongolian) and numbers across lines. Ideally it would prefer breaking at certain characters such as /
, -
, etc.
See also:
ver 8.0.0