From 5d4c9a5dd28b8a50b61a642ff5edd9b29d51626b Mon Sep 17 00:00:00 2001 From: MarcinZiabek Date: Sat, 1 Oct 2022 00:18:31 +0200 Subject: [PATCH] Added example for RTL text --- QuestPDF.Examples/TextExamples.cs | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/QuestPDF.Examples/TextExamples.cs b/QuestPDF.Examples/TextExamples.cs index 905bcb8..861079c 100644 --- a/QuestPDF.Examples/TextExamples.cs +++ b/QuestPDF.Examples/TextExamples.cs @@ -657,5 +657,43 @@ namespace QuestPDF.Examples }); }); } + + [Test] + public void TextDirectionality() + { + RenderingTest + .Create() + .PageSize(PageSizes.A4) + .ProducePdf() + .ShowResults() + .Render(container => + { + var text = "بسم الله الرحمن الرحيم" + + "\n" + + "الحمد لله رب العالمين (1) مالك يوم الدين"; + + container + .Padding(25) + .ContentFromRightToLeft() + .Column(column => + { + column.Spacing(20); + + foreach (var size in new[] { 14, 12, 11, 10, 8, 7 }) + { + column + .Item() + .ShowEntire() + .MaxWidth(size * 25) + .Background(Colors.Grey.Lighten3) + .MinimalBox() + .Background(Colors.Grey.Lighten2) + .Text(text) + .FontSize(20) + .FontFamily("Segoe UI").DirectionFromRightToLeft(); + } + }); + }); + } } } \ No newline at end of file