B2015-122: Fix HLS underlining of subscript & superscript

This commit is contained in:
Kathy Ruffing 2015-09-04 13:59:00 +00:00
parent 5586849ebc
commit 6fceccc6c1

View File

@ -299,11 +299,20 @@ namespace Volian.Print.Library
chk.SetUnderline(font.Color, 0, 0.05F, 0, .3F, PdfContentByte.LINE_CAP_ROUND); // Relative Based upon font size
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)
{
float yoffundx = (_MyParagraph.Leading < 12 && font.Size >= 12) ? -0.06F : -0.18F;
chk.SetUnderline(font.Color, 0, 0.07F, 0, yoffundx, 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 if (visualText.Format.SuperScript > 0 && PrintOverride.CompressSuper)
{
float yoffundx = (_MyParagraph.Leading < 12 && font.Size >= 12) ? -0.06F : -0.18F;
chk.SetUnderline(font.Color, 0, 0.07F, 0, yoffundx, PdfContentByte.LINE_CAP_ROUND);
}
else
{
// If on a compressed printed step (Leading < 12) and a larger underlined font, then set the underlining
@ -334,7 +343,8 @@ namespace Volian.Print.Library
chk.Font.Size *= .75f;
else
{
chk.SetTextRise(-.25F * chk.Font.Size);
// if the subscript is not compressed or if it is compress but not underlined, then move it down
if (!PrintOverride.CompressSub || !visualText.Format.IsUnderline) chk.SetTextRise(-.25F * chk.Font.Size);
if (PrintOverride.CompressSub) chk.Font.Size = 9;
}
}