From 2d7338aa767e734c01141f13d61954b8c0c573f3 Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Fri, 18 Feb 2022 18:48:03 +0100 Subject: [PATCH] added underline in text --- Instructions/TextInstruction.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Instructions/TextInstruction.cs b/Instructions/TextInstruction.cs index 0355008..a135d77 100644 --- a/Instructions/TextInstruction.cs +++ b/Instructions/TextInstruction.cs @@ -10,6 +10,8 @@ public class TextInstruction : BaseInstruction [JsonConverter(typeof(JsonStringEnumConverter))] public Alignment alignment {get; set; } = Alignment.Left; + public bool underline {get; set; } = false; + public bool newLine { get; set; } = true; public override List GetInstructions() { @@ -18,6 +20,10 @@ public class TextInstruction : BaseInstruction commands.Add(alignmentCommand(alignment)); + if (underline){ + commands.Add(e.SetStyles(PrintStyle.Underline)); + } + if (newLine) { commands.Add(e.PrintLine(text)); @@ -27,6 +33,10 @@ public class TextInstruction : BaseInstruction commands.Add(e.Print(text)); } + if (underline){ + commands.Add(e.SetStyles(PrintStyle.None)); + } + return commands; } } \ No newline at end of file