Skip to content

[Web][HTML] Parentheses aren't shown in the right place in rtl languages #108431

@navidprox

Description

@navidprox

The problem shows up when an RTL language (Persian) text containing parentheses () symbols (or <> symbols) is placed in a Text widget and we build for the web using html renderer (flutter run --web-renderer html).

This is the code (It's pictured to show the RTL as is. The text code is below):

image

Here's the result with default renderer (canvaskit on desktop) which everything sounds fine:

image

The same code with html renderer:

image

And if we add RTL/LTR (respectively) unicode marks before the words with parentheses, we get:

image

which apparently solves the problem with the word 'push'.

Here's the code as text:

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),

Is there a way to solve the problem in html renderer?

flutter doctor -v :

[√] Flutter (Channel stable, 3.0.2, on Microsoft Windows [Version 10.0.19043.1466], locale en-US)
• Flutter version 3.0.2 at D:\FlutterDev\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision cd41fdd (7 weeks ago), 2022-06-08 09:52:13 -0700
• Engine revision f15f824b57
• Dart version 2.17.3
• DevTools version 2.12.2

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: internationalizationSupporting other languages or locales. (aka i18n)a: typographyText rendering, possibly libtxte: web_htmlHTML rendering backend for Webengineflutter/engine related. See also e: labels.found in release: 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions