From 43dffa55cbcd33217a10185853b76141effe7f66 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 21 Jun 2017 18:25:47 +0000 Subject: [PATCH] =?UTF-8?q?B2017-105=20=E2=80=93=20adjust=20the=20y=20posi?= =?UTF-8?q?tion=20of=20a=20symbol=20character=20when=20its=20size=20is=20g?= =?UTF-8?q?reater=20than=20the=20normal=20font=20size?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/Volian.Print.Library/Grid2Pdf.cs | 16 +++++++++++++++- PROMS/Volian.Print.Library/vlnParagraph.cs | 6 ++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/PROMS/Volian.Print.Library/Grid2Pdf.cs b/PROMS/Volian.Print.Library/Grid2Pdf.cs index c5810f80..0dd91c84 100644 --- a/PROMS/Volian.Print.Library/Grid2Pdf.cs +++ b/PROMS/Volian.Print.Library/Grid2Pdf.cs @@ -451,7 +451,8 @@ namespace Volian.Print.Library myPara.MultipliedLeading = 1.0f; // once there is valid value for TotalLeading (from previous line), you can use it to // calculate a MultipliedLeading to give 6 LPI (12 points) - myPara.MultipliedLeading = 12.0f / myPara.TotalLeading; + myPara.MultipliedLeading = 12.0f / myPara.TotalLeading; + myPara.MultipliedLeading = 12f / BiggestFontSize(myPara); // B2017-105, when box symbol size was increased, alignment in tables was off myPara.SpacingAfter = 8; // RHM 20120925 - Add a line to properly space text from lines. if(Rtf2Pdf.GetTableScrunchingStatus(TableScrunching.Phase2)) // RHM20150429 - Table Scrunch myPara.SpacingAfter = 0;// YAdjust_SpacingAfter; // RHM 20120925 - Add a line to properly space text from lines. @@ -493,6 +494,19 @@ namespace Volian.Print.Library } } } + + // B2017-105 if a symbol character was set to a bigger font size, then the positioning of the larger symbol character was printing too high on the line + // found with Wolf Creek use of the empty box symbol + private float BiggestFontSize(Paragraph myPara) + { + float fontSize = 12; + foreach (Chunk ck in myPara.Chunks) + { + fontSize = Math.Max(fontSize, ck.Font.Size); + if (ck.Font.Size > 12) ck.SetTextRise(-2f); + } + return fontSize; + } private void ShowChunks(System.Collections.ArrayList chunks) // RHM20150429 - Table Scrunch { StringBuilder sb = new StringBuilder(); diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index fd3c3363..221ef77e 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -471,6 +471,12 @@ namespace Volian.Print.Library // _MyLog.WarnFormat("NoteTab '{0}','{1}','{2}','{3}','{4}','{5}','{6}'", (PartsAbove[0] as vlnHeader).Text, (PartsLeft[0] as vlnTab).Text, MyItemInfo.MyProcedure.DisplayNumber, MyItemInfo.MyHLS.DisplayText, // MyItemInfo.ShortPath, MyItemInfo.FormatStepData.TabData.IdentPrint, MyItemInfo.FormatStepData.TabData.IdentEdit); // + // B2017-105 if a symbol character was set to a bigger font size, then the positioning of the larger symbol character was printing too high on the line + // found with Wolf Creek use of the empty box symbol + foreach (Chunk chk in IParagraph.Chunks) + { + if (chk.Font.Size > 16) chk.SetTextRise(-2f); + } if (MyItemInfo.IsFootnote && Processed) return yPageStart; int pagenumTran = 0; if ((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontCountFoldoutPgs) == E_DocStructStyle.DontCountFoldoutPgs)