B2015- 076: underlining overwrites text below (occurred on compressed steps with larger font)

This commit is contained in:
Kathy Ruffing 2015-06-22 14:42:46 +00:00
parent 7bc11c7fb6
commit a038fe06e9
3 changed files with 23 additions and 10 deletions

View File

@ -227,12 +227,20 @@ namespace Volian.Print.Library
if (visualText.Format.IsUnderline)
if (visualText.Format.SuperScript < 0)
;// Don't Underline Subscripts
//if (PrintOverride.CompressSub)
// chk.SetUnderline(font.Color, 0, 0.0666F, 0, -.425F, PdfContentByte.LINE_CAP_ROUND); // Relative Based upon font size
//else
// chk.SetUnderline(font.Color, 0, 0.05F, 0, -.381F, PdfContentByte.LINE_CAP_ROUND); // Relative Based upon font size
//if (PrintOverride.CompressSub)
// chk.SetUnderline(font.Color, 0, 0.0666F, 0, -.425F, PdfContentByte.LINE_CAP_ROUND); // Relative Based upon font size
//else
// chk.SetUnderline(font.Color, 0, 0.05F, 0, -.381F, PdfContentByte.LINE_CAP_ROUND); // Relative Based upon font size
else
chk.SetUnderline(font.Color, 0, 0.05F, 0, -.131F, PdfContentByte.LINE_CAP_ROUND); // Relative Based upon font size
{
// If on a compressed printed step (Leading < 12) and a larger underlined font, then set the underlining
// a little less far down the page. Without this, the underline was touching the 2nd line of text, if it existed.
// Any plant that had compressed steps with the font size/underline would have this problem. An example
// was Braidwood FSG-6, high level steps.
float yoffund = (_MyParagraph.Leading < 12 && font.Size >= 12) ? -0.06F : -0.131F;
chk.SetUnderline(font.Color, 0, 0.05F, 0, yoffund, PdfContentByte.LINE_CAP_ROUND); // Relative Based upon font size
}
if (visualText.Format.SuperScript > 0)
{
if (PrintOverride.CompressPropSubSup)

View File

@ -560,6 +560,7 @@ namespace Volian.Print.Library
if (doprint)
{
int profileDepth = ProfileTimer.Push(">>>> vlnParagraph.DrawText");
IsCompressed = (MyPageHelper.YMultiplier != 1 && MyItemInfo != null && MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.Font.Size >= 12 && (MyItemInfo.FormatStepData.Font.Style & E_Style.Underline) != 0);
retval = DrawText(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation);
// Wolf Creek Training format puts a separator line after printing the section number/title
if (MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.WCNTraining)
@ -861,7 +862,6 @@ namespace Volian.Print.Library
private float DrawText(PdfContentByte cb, ref float yPageStart, float yTopMargin, float yBottomMargin, ref float yLocation)
{
// KBR (6/17/15): Fix for underline location in compressed steps: PrintOverride.StepCompress = false;
if(DebugText.IsOpen)DebugText.WriteLine("{0},'{1}','{2}','<<END>>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, FormattedText);
//Console.WriteLine("{0},{1},'{2}','<<END>>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, IParagraph.Content);
float retval = yLocation;
@ -954,10 +954,7 @@ namespace Volian.Print.Library
//if (MyItemInfo.InList(39048)) Console.WriteLine("Here");
}
MyPageHelper.BottomContent = yLocation - (Height * MyPageHelper.YMultiplier);
// KBR (6/17/15): Fix for underline location in compressed steps:
// KBR (6/17/15): if (MyPageHelper.YMultiplier != 1) PrintOverride.StepCompress = true;
retval = Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, DebugInfo + string.Format(",YLines = {0}", YSize / SixLinesPerInch), yBottomMargin);
// KBR (6/17/15): PrintOverride.StepCompress = true;
ProfileTimer.Pop(profileDepth);
if (retval == 0) // problem occurred - paragraph was not able to be printed on page
{ // pagination logic needs to be fixed.

View File

@ -72,6 +72,12 @@ namespace Volian.Print.Library
get { return _HasIndent; }
set { _HasIndent = value; }
}
private bool _IsCompressed = false;
public bool IsCompressed
{
get { return _IsCompressed; }
set { _IsCompressed = value; }
}
private string _ImageText; // ro definition, value part of #Link in case of image/figure
public string ImageText
{
@ -101,7 +107,9 @@ namespace Volian.Print.Library
{
get
{
if (_IParagraph == null)
// If the paragraph iscompressed, it may have been created as not compressed since compression
// is not set when paragraph is initially created, it is set during pagination tests.
if (_IParagraph == null || IsCompressed)
{
int profileDepth = ProfileTimer.Push(">>>> VlnPrintObject.IParagraph");
string myRtf = Rtf;