|
|
|
@ -417,7 +417,6 @@ namespace Avalonia.Skia.UnitTests.Media.TextFormatting |
|
|
|
|
|
|
|
[Theory] |
|
|
|
[InlineData("abcde\r\n", 7)] // Carriage Return + Line Feed
|
|
|
|
[InlineData("abcde\n\r", 7)] // This isn't valid but we somehow have to support it.
|
|
|
|
[InlineData("abcde\u000A", 6)] // Line Feed
|
|
|
|
[InlineData("abcde\u000B", 6)] // Vertical Tab
|
|
|
|
[InlineData("abcde\u000C", 6)] // Form Feed
|
|
|
|
@ -575,6 +574,27 @@ namespace Avalonia.Skia.UnitTests.Media.TextFormatting |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public void Should_Process_Multiple_NewLines_Properly() |
|
|
|
{ |
|
|
|
using (Start()) |
|
|
|
{ |
|
|
|
var text = "123\r\n\r\n456\r\n\r\n"; |
|
|
|
var layout = new TextLayout( |
|
|
|
text, |
|
|
|
Typeface.Default, |
|
|
|
12.0f, |
|
|
|
Brushes.Black); |
|
|
|
|
|
|
|
Assert.Equal(5, layout.TextLines.Count); |
|
|
|
|
|
|
|
Assert.Equal("123\r\n", layout.TextLines[0].TextRuns[0].Text); |
|
|
|
Assert.Equal("\r\n", layout.TextLines[1].TextRuns[0].Text); |
|
|
|
Assert.Equal("456\r\n", layout.TextLines[2].TextRuns[0].Text); |
|
|
|
Assert.Equal("\r\n", layout.TextLines[3].TextRuns[0].Text); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public void Should_Wrap_Min_OneCharacter_EveryLine() |
|
|
|
{ |
|
|
|
|