|
|
|
@ -994,6 +994,33 @@ namespace Avalonia.Skia.UnitTests.Media.TextFormatting |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public void Should_GetTextBounds_With_EndOfParagraph_RightToLeft() |
|
|
|
{ |
|
|
|
var text = "لوحة المفاتيح العربية"; |
|
|
|
|
|
|
|
using (Start()) |
|
|
|
{ |
|
|
|
var defaultProperties = new GenericTextRunProperties(Typeface.Default); |
|
|
|
var textSource = new SingleBufferTextSource(text, defaultProperties, true); |
|
|
|
|
|
|
|
var formatter = new TextFormatterImpl(); |
|
|
|
|
|
|
|
var textLine = |
|
|
|
formatter.FormatLine(textSource, 0, double.PositiveInfinity, |
|
|
|
new GenericTextParagraphProperties(FlowDirection.LeftToRight, TextAlignment.Left, |
|
|
|
true, true, defaultProperties, TextWrapping.NoWrap, 0, 0, 0)); |
|
|
|
|
|
|
|
var textBounds = textLine.GetTextBounds(0, 1); |
|
|
|
|
|
|
|
Assert.Equal(1, textBounds.Count); |
|
|
|
|
|
|
|
var firstBounds = textBounds.First(); |
|
|
|
|
|
|
|
Assert.True(firstBounds.TextRunBounds.Count > 0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private class FixedRunsTextSource : ITextSource |
|
|
|
{ |
|
|
|
private readonly IReadOnlyList<TextRun> _textRuns; |
|
|
|
|