-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
Not sure if I'm doing right to left correctly but when I render a multi line text, any line that isn't the end of the paragraph has an extra space at the beginning of the line. Here are a few examples:
In this example you can see the first 4 lines there is a slight space at the beginning but the last line is more right.
In this example the first line of the second paragraph has a slight space but the second line is flush with the other lines.
Here's the code I'm using to create the string:
public void DrawText(
SKCanvas canvas,
string text,
SkiaTextLayoutOptions layoutOptions
)
{
if (string.IsNullOrWhiteSpace(text))
{
return;
}
var richString = new RichString
{
MaxWidth = layoutOptions.MaxWidthPixels,
MaxHeight = layoutOptions.MaxHeightPixels,
};
var margin = layoutOptions.MarginPixels;
richString.MarginTop(margin).MarginBottom(margin).MarginLeft(margin).MarginRight(margin);
richString.Add(text, layoutOptions.FontFamily, fontSize: DefaultFontSize);
richString.Alignment(TextAlignment.Right);
var options = new TextPaintOptions
{
Edging = SKFontEdging.Antialias,
};
var startingPoint = new SKPoint(layoutOptions.StartingX, layoutOptions.StartingY);
richString.Paint(canvas, startingPoint, options);
}
Metadata
Metadata
Assignees
Labels
No labels

