skia4delphi / skia4delphi

Skia4Delphi is a cross-platform 2D graphics API for Delphi 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.
https://skia4delphi.org
MIT License
693 stars 141 forks source link

Drawing RTL Text needs to apply character shaping #245

Closed Lasibian closed 7 months ago

Lasibian commented 1 year ago

Displaying right-to-left text looks wrong, because character shaping is not applied. Compare the text output of MS Word with that of the demo application.

image

Tested with version 6.00 Beta 2.

randydom commented 1 year ago

Cause you're not using the same font .

viniciusfbb commented 7 months ago

@Lasibian Seems that @randydom is right. Are you using the same font family? Do you have more info?

Lasibian commented 7 months ago

@randydom got it right. It was because of the different font.

At the moment I still can't use skia with RTL text, because I need the glyph positions of the shaped text. I haven't found a way to get these from the ISkTextBlob.

viniciusfbb commented 7 months ago

At the moment I still can't use skia with RTL text, because I need the glyph positions of the shaped text. I haven't found a way to get these from the ISkTextBlob.

@Lasibian Are you using FMX or VCL? For FMX, I recomend you to use the TSkTextLayout from unit FMX.Skia.Canvas.

Lasibian commented 7 months ago

@viniciusfbb I'm using VCL.

viniciusfbb commented 7 months ago

@Lasibian The most complete and ideal text manipulation/rendering class (including multiple styles) is the SkParagraph class. There are some examples in our demo and in FMX's own TSkTextLayout (which also uses SkParagraph behind it) to render and manipulate texts, including get the glyph positions.

I will close this issue now because what was reported was not exactly a bug, but feel free to continue the conversation.