B2020-080 fixes an issue where table cells text that consists of superscript text that begins with a dash was not printing that text superscripted.

This commit is contained in:
John Jenko 2020-06-09 19:20:05 +00:00
parent d0e2eda999
commit 921d25c380

View File

@ -637,13 +637,15 @@ public string Path
Chunk chk1 = (Chunk)myPara[hype - 1];
if (hype > 1 && chk1.Content.Equals("\n"))
chk1 = (Chunk)myPara[hype - 2];
fnt = chk1.Font; // use the font of the text that follows the hyphen (dash)
// use the font of the text that precedes the hyphen (dash)
fnt = new Font(chk1.Font); //B2020-80 create new instance of the font else previous myPara chunks font size may change
}
else if (hype < myPara.Count - 1)
{
Chunk chk2 = (Chunk)myPara[hype + 1];
if (hype != 0 && !chk2.Content.Equals("\n"))
fnt = chk2.Font; // use the font of the text that follows the hyphen (dash)
// use the font of the text that follows the hyphen (dash)
fnt = new Font(chk2.Font); //B2020-80 create new instance of the font else previous myPara chunks font size may change
}
if (fnt == null)
{
@ -682,7 +684,37 @@ public string Path
prefix = "-";
}
myPara.RemoveAt(hype);
myPara.Insert(hype, new Chunk(prefix + chk.Content.Replace("\u2011", "-"), fnt));
// B2020-080 Wolf Creek procedure STS-IC-231 at Step 4.3 1st row in the I&C folder under Maintenance Procedures,
// equation text that has a "-10" that is superscript, is not printing superscript in a table cell.
// When we replace the symbol font dash character with the Ascii dash character, we need to
// check for super/subscript attributes of the text following the dash. If that text
// is super/subscripted then we need to set those attributes in the new chunk.
Chunk chkJ = new Chunk(prefix + chk.Content.Replace("\u2011", "-"), fnt);
float? subsup = (float?)chk.Attributes["SUBSUPSCRIPT"];
if (subsup != null)
{
if (subsup > 0.0) // superscript
if (PrintOverride.CompressPropSubSup)
{
chkJ.SetTextRise(.33F * chkJ.Font.Size);
chkJ.Font.Size *= .75f;
}
else
{
chkJ.SetTextRise(.25F * chkJ.Font.Size);
if (PrintOverride.CompressSuper) chkJ.Font.Size = 9;
}
else if (subsup < 0.0) // subscript
if (PrintOverride.CompressPropSubSup)
chkJ.Font.Size *= .75f;
else
{
// if the subscript is not compressed or if it is compress but not underlined, then move it down
if (!PrintOverride.CompressSub || !fnt.IsUnderlined()) chkJ.SetTextRise(-.25F * chkJ.Font.Size);
if (PrintOverride.CompressSub) chkJ.Font.Size = 9;
}
}
myPara.Insert(hype,chkJ);
}
}