Flutter web rtl语言+html渲染器的括号问题

问题描述 投票:0回答:0

当包含括号 () 符号(或 <> 符号)的 RTL 语言(波斯语)文本放置在

Text
小部件中并且我们使用 html 渲染器 (
flutter run --web-renderer html
) 为 Web 构建时,问题就会出现。

这是代码(如图所示按原样显示 RTL。文本代码如下):

这是默认渲染器(桌面上的canvaskit)的结果,一切听起来都很好:

与 html 渲染器相同的代码:

如果我们在带括号的单词前添加 RTL/LTR(分别)unicode 标记,我们会得到:

这显然解决了“推”这个词的问题。

这是文本代码:

const Text('You have pushed the button this (many) times:'),
const Text('You have pushed the (دکمه) this (many) times:'),
const Text('تعداد (دفعات) فشار دادن دکمه:', textDirection: TextDirection.rtl),
const Text('تعداد (دفعات) فشار (push) دکمه:', textDirection: TextDirection.rtl),

有没有办法解决html渲染器的问题?

flutter right-to-left parentheses farsi
© www.soinside.com 2019 - 2024. All rights reserved.