mono / SkiaSharp

SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
MIT License
4.41k stars 536 forks source link

[QUESTION] Shaping Arabic Date #926

Open martin-df opened 5 years ago

martin-df commented 5 years ago

I am using SkiaSharp with SkiaSharp.Harfbuzz in a Xamarin App and it works fine with RTL languages like arabic.

I am currently facing a problem displaying an arabic date. It works fine if it starts with arabic characters, but if it starts with a number it does not shape the text correctly.

The following date shows up correctly in canvas: 8 yluJ

In this example yluJ is July in arabic.

This date is not shaped correctly: yluJ 8

I figured out it is a problem if the text starts with an LTR-Text following by an RTL text.

Is there any way to force SkiaSharp.Hafbuzz to use arabic shaping? Or is there any other way around this?

Gillibald commented 5 years ago

I need the actual encoded text to explain / investigate this further. In general HarfBuzz doesn't apply the BiDi algorithm and also just checks the first character of the text for Unicode properties. If the text starts with a LTR character the whole buffer is shaped with this direction.