Added flag CompressPropSubSup for compressing proportional fonts sub & superscript (used by Calvert)

Use CompressPropSubSup
Use  CompressPropSubSup
This commit is contained in:
2014-06-27 12:16:10 +00:00
parent 4b476ebd48
commit 9fb17c103c
6 changed files with 44 additions and 5 deletions

View File

@@ -433,6 +433,8 @@ namespace Volian.Print.Library
if (myFoldoutSection != null && myFoldoutSection.ItemID != mySection.ItemID) continue;
PrintOverride.CompressSuper = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSuper;
PrintOverride.CompressSub = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSub;
PrintOverride.CompressPropSubSup = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressPropSubSup;
OnStatusChanged((mySection.DisplayNumber ?? "") == "" ? mySection.DisplayText : mySection.DisplayNumber, PromsPrinterStatusType.Progress, progress++);
// Set up Helper for the particular Section
if (_MyHelper == null)

View File

@@ -17,6 +17,7 @@ namespace Volian.Print.Library
{
public static bool CompressSub = false;
public static bool CompressSuper = false;
public static bool CompressPropSubSup = false;
private static System.Drawing.Color _TextColor = System.Drawing.Color.Empty;
public static System.Drawing.Color TextColor
{
@@ -205,13 +206,27 @@ namespace Volian.Print.Library
chk.SetUnderline(font.Color, 0, 0.05F, 0, -.131F, PdfContentByte.LINE_CAP_ROUND); // Relative Based upon font size
if (visualText.Format.SuperScript > 0)
{
chk.SetTextRise(.25F * chk.Font.Size);
if (PrintOverride.CompressSuper) chk.Font.Size = 9;
if (PrintOverride.CompressPropSubSup)
{
chk.SetTextRise(.33F * chk.Font.Size);
chk.Font.Size *= .5f;
}
else
{
chk.SetTextRise(.25F * chk.Font.Size);
if (PrintOverride.CompressSuper) chk.Font.Size = 9;
}
}
else if (visualText.Format.SuperScript < 0)
{
chk.SetTextRise(-.25F * chk.Font.Size);
if (PrintOverride.CompressSub) chk.Font.Size = 9;
if (PrintOverride.CompressPropSubSup)
chk.Font.Size *= .5f;
else
{
chk.SetTextRise(-.25F * chk.Font.Size);
if (PrintOverride.CompressSub) chk.Font.Size = 9;
}
}
else
chk.SetTextRise(0);