CSharpMath icon indicating copy to clipboard operation
CSharpMath copied to clipboard

Support for Arabic and other RTL languages in TextView

Open dimonovdd opened this issue 4 years ago • 5 comments

Description

I use your plugin in a Xamarin.Froms project with Arabic language support. But unfortunately even if we add a font for Arabic the RTL of the text remains incorrect.

Description of the desired solution I would very much like the TextView to support RTL

Difficulty: Very Hard

Additional context Currently, the primary rendering of glyphs is done through the Typography. For the subsequent rendering you use SkiaSharp. Maybe if the full rendering process went through SkiaSharp you could use SkiaSharp.HarfBuzz.

Using the Skia we can also get a system TypeFace for drawing each character:

var charTypeface = SKFontManager.Default.MatchCharacter(numberChar);

dimonovdd avatar May 23 '21 18:05 dimonovdd

Hopefully MAUI Graphics can help in this area.

Happypig375 avatar May 24 '21 04:05 Happypig375

How exactly can it help with this issue? As I understand it the Microsoft.Maui.Graphics will use SkiaSharp.HarfBuzz for rendering text.

dimonovdd avatar May 24 '21 06:05 dimonovdd

MAUI Graphics has no mention of HarfBuzz anywhere.

Happypig375 avatar May 24 '21 08:05 Happypig375

I think I need to see how Microsoft.Maui.Graphics works with text. We found a temporary solution for RTL: https://github.com/fsufyan/BidiSharp Now we need to make the text go from the right edge

dimonovdd avatar May 24 '21 09:05 dimonovdd

For CSharpMath TextViews, there is a text alignment property.

Happypig375 avatar May 24 '21 09:05 Happypig375