Fixed text rendering corner case: measuring span with space at the end of the line may overflow available space

This commit is contained in:
MarcinZiabek
2022-03-08 18:33:34 +01:00
parent 69e268733c
commit fdf8e3eb1a
3 changed files with 32 additions and 6 deletions
+25
View File
@@ -267,5 +267,30 @@ namespace QuestPDF.Examples
});
});
}
[Test]
public void MeasureIssueWhenSpaceAtLineEnd()
{
// issue 135
RenderingTest
.Create()
.ProduceImages()
.ShowResults()
.RenderDocument(container =>
{
container.Page(page =>
{
page.Margin(50);
page.Background(Colors.White);
page.Size(PageSizes.A4);
page.Content().Text(
"This is a specially crafted sentence with a specially chosen length for demonstration of the bug that occurs ;;;;;. ",
TextStyle.Default.Size(11));
});
});
}
}
}