F2021-053: BNPP Alarm – need ability to have super/sub scripts in the text of Alarm Tables (ROs)

This commit is contained in:
2021-10-25 12:18:49 +00:00
parent 6a10408a94
commit 2b25136036
6 changed files with 78 additions and 9 deletions

View File

@@ -681,7 +681,10 @@ namespace Volian.Svg.Library
ct.Go();
cb.RestoreState();
}
// F2021-053: Do replace words for Page List items. Format flags to use for compressing and locating sub/super scripts
public static bool CompressSuper = false;
public static bool CompressSub = false;
public static bool CompressPropSubSup = false;
private Phrase BuildPhrase(string text, float fontSize, int fontStyle, iTextSharp.text.Font font)
{
//if (text == "Caution")
@@ -747,8 +750,23 @@ namespace Volian.Svg.Library
else if (m.Value.Contains(@"\ul"))
fontUnderline = true;
if (m.Value.Contains(@"\up0") || m.Value.Contains(@"\dn0")) fontTextRise = 0;
else if (m.Value.Contains(@"\up")) fontTextRise = .25F;
else if (m.Value.Contains(@"\dn")) fontTextRise = -.25F;
else if (m.Value.Contains(@"\up"))
{
fontTextRise = .25F;
// F2021-053: Do replace words for Page List items. size and locate superscript
if (CompressSuper || CompressPropSubSup)
{
font = FontFactory.GetFont(font.Familyname, BaseFont.IDENTITY_H, BaseFont.EMBEDDED, fontSize * .75f, fontStyle, new Color(FillColor)); ;
fontTextRise = .33F;
}
}
else if (m.Value.Contains(@"\dn"))
{
fontTextRise = -.25F;
// F2021-053: Do replace words for Page List items. size subscript
if (CompressSub || CompressPropSubSup)
font = FontFactory.GetFont(font.Familyname, BaseFont.IDENTITY_H, BaseFont.EMBEDDED, fontSize * .75f, fontStyle, new Color(FillColor)); ;
}
if (m.Value.Contains(@"\b0"))
{
fontStyle ^= iTextSharp.text.Font.BOLD;