maui icon indicating copy to clipboard operation
maui copied to clipboard

Automatic Flow Direction Change for Arabic Strings in When Drawing the String in MAUI on Android and Opposite Behavior in Windows.

Open anandhan-rajagopal opened this issue 1 year ago • 9 comments

Description

In .NET MAUI, when drawing a string, Arabic strings undergo an automatic flow direction alteration. However, the Windows platform demonstrates different behavior when using the DrawString method from the canvas. This inconsistency interferes with the desired rendering of Arabic text when we manage the custom control coordinates for RTL and LTR internally, and it adversely affects the user experience.

Note: My device language is in LTR.

https://github.com/dotnet/maui/assets/97146406/507fd381-ba70-4bc5-baaf-260ab63e9684

Is there any way to detect the language as RTL or LTR from string type property?

Steps to Reproduce

Step 1: Create a sample in .NET MAUI Step 2: Develop a custom control that utilizes the DrawString method from the canvas. Step 3: Pass an Arabic string as the text to be drawn. Step 4: Execute the application on Android and Windows devices.

Link to public reproduction project repository

https://github.com/anandhan-rajagopal/RTLLanguageSample/tree/main

Version with bug

7.0.92

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 5.0 and above

Did you find any workaround?

NA

Relevant log output

NA

anandhan-rajagopal avatar Sep 12 '23 13:09 anandhan-rajagopal

Verified this on Visual Studio Enterprise 17.8.0 Preview 1.0. Repro on Android 13.0-API33(8.0.0-preview.7.8842), not repro on Windows 11 and iOS 16.4 with below Project: RTLSample.zip

XamlTest avatar Sep 13 '23 08:09 XamlTest

Any update on this issue? Please consider prioritizing this issue.

BrundhaVelusamy avatar Oct 17 '23 07:10 BrundhaVelusamy

@jfversluis @davidortinau @PureWeen @jamesmontemagno @jsuarezruiz Guyz any workaround for this atleast?

waseem852 avatar Oct 17 '23 07:10 waseem852

Any update on this issue? Is there any workaround for this issue?

BrundhaVelusamy avatar Nov 15 '23 05:11 BrundhaVelusamy

Any luck with dotnet 8 ?

waseem852 avatar Nov 15 '23 20:11 waseem852

Please provide a high priority for this issue to be resolved.

BrundhaVelusamy avatar Nov 29 '23 06:11 BrundhaVelusamy

Is there any progress or recent information on this issue? Kindly prioritize its resolution with urgency.

BrundhaVelusamy avatar Dec 13 '23 05:12 BrundhaVelusamy

Is there any update or workaround to resolve the issue? Please give high priority to resolve the issue ASAP.

Ahamed-Ali avatar Dec 27 '23 05:12 Ahamed-Ali

@jfversluis @davidortinau @PureWeen @jamesmontemagno @jsuarezruiz Guyz, any update on this ?

waseem852 avatar Jan 12 '24 20:01 waseem852

Please prioritize its resolution with urgency.

BrundhaVelusamy avatar Jan 15 '24 05:01 BrundhaVelusamy

Is there any update or workaround to resolve the issue? Please give high priority to resolve the issue ASAP.

Arunachalam3641 avatar Jan 30 '24 06:01 Arunachalam3641

Any update on this issue? Please prioritize its resolution.

BrundhaVelusamy avatar May 10 '24 03:05 BrundhaVelusamy

Any update on this issue?

HariharanChokkalingam avatar Jun 21 '24 05:06 HariharanChokkalingam

Can you please prioritize this issue?

Choza-rajan avatar Jul 22 '24 04:07 Choza-rajan

Just add LTR char in XAML or in C# before the text for all TextBase controls

XAML: Text="‎سلام"
C#: Text="\u200Eسلام";

RezaKarimniaDev avatar Aug 05 '24 13:08 RezaKarimniaDev