From 4345ce857f82e3d128cfe06353f26074f7e2781c Mon Sep 17 00:00:00 2001 From: Bennet Bo Fenner <53836821+Bebo-Maker@users.noreply.github.com> Date: Thu, 3 Nov 2022 16:45:49 +0100 Subject: [PATCH] add example for letter spacing --- QuestPDF.Examples/TextExamples.cs | 44 ++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/QuestPDF.Examples/TextExamples.cs b/QuestPDF.Examples/TextExamples.cs index a3c0c12..ed818f5 100644 --- a/QuestPDF.Examples/TextExamples.cs +++ b/QuestPDF.Examples/TextExamples.cs @@ -122,7 +122,49 @@ namespace QuestPDF.Examples }); }); } - + + [Test] + public void LetterSpacing() + { + RenderingTest + .Create() + .PageSize(500, 700) + .ProduceImages() + .ShowResults() + .Render(container => + { + container + .Padding(20) + .Column(column => + { + var letterSpacing = new[] { -1f, 0f, 2f }; + var paragraph = Placeholders.Sentence(); + + foreach (var spacing in letterSpacing) + { + column + .Item() + .Border(1) + .Padding(10) + .Column(nestedColumn => + { + nestedColumn.Item() + .Text(paragraph) + .FontSize(16) + .LetterSpacing(spacing); + + nestedColumn.Item() + .Text($"Letter spacing of {spacing} pt") + .FontSize(10) + .Italic() + .FontColor(Colors.Blue.Medium); + }); + + } + }); + }); + } + [Test] public void SuperscriptSubscript_Simple() {