B2017-105 – adjust the y position of a symbol character when its size is greater than the normal font size

This commit is contained in:
2017-06-21 18:25:47 +00:00
parent c1c5bfd081
commit 43dffa55cb
2 changed files with 21 additions and 1 deletions

View File

@@ -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();