Corrected logic for the CoverProcTitle pagelist token. We now use the format element “CoverTitleLenth” instead of “TitleLenth”

This commit is contained in:
John Jenko 2013-05-06 17:21:11 +00:00
parent 87494ae0ed
commit a303303074

View File

@ -884,7 +884,9 @@ namespace Volian.Print.Library
case "[PROCTITLE2]": case "[PROCTITLE2]":
case "{COVERPROCTITLE}": case "{COVERPROCTITLE}":
case "[COVERPROCTITLE]": case "[COVERPROCTITLE]":
float linelen = (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength * (float)pageItem.Font.CPI / 12; int tlen = (token.Contains("COVERPROCTITLE"))?(int)section.ActiveFormat.PlantFormat.FormatData.ProcData.CoverTitleLength : (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength;
//float linelen = (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength * (float)pageItem.Font.CPI / 12;
float linelen = tlen * (float)pageItem.Font.CPI / 12;
plstr = SplitTitle(svgGroup, pageItem, section.MyProcedure.MyContent.Text.ToUpper(), (int)linelen, token, plstr); //,rowAdj); plstr = SplitTitle(svgGroup, pageItem, section.MyProcedure.MyContent.Text.ToUpper(), (int)linelen, token, plstr); //,rowAdj);
break; break;
case "{COVERTITLE1}": case "{COVERTITLE1}":
@ -1053,6 +1055,29 @@ namespace Volian.Print.Library
return plstr; return plstr;
} }
//private string symblsStr = "\u25CF\u0394"; // string of possible symbol character in a tab
//// add symbol characters as needed
//// "\u25CF" - solid bullet
//// \x0394 - delta
//private float GetTextWidth(VE_Font vefont, string txt, string symblFontName)
//{
// System.Drawing.Font font = new System.Drawing.Font(vefont.Family, (float)vefont.Size, GetSysFontStyle(vefont));
// System.Drawing.Font symbFont = new System.Drawing.Font(symblFontName, (float)vefont.Size);
// iTextSharp.text.Font iFont = Volian.Svg.Library.VolianPdf.GetFont(font);
// iTextSharp.text.Font iSymblFont = Volian.Svg.Library.VolianPdf.GetFont(symbFont);
// float w = 0;
// foreach (char c in txt)
// {
// int idx = symblsStr.IndexOf(c);
// if (idx >= 0) // symbol character - use symbol font to find its width
// w += iSymblFont.BaseFont.GetWidthPointKerned(symblsStr[idx].ToString(), (float)vefont.Size);
// else
// w += iFont.BaseFont.GetWidthPointKerned(c.ToString(), (float)vefont.Size);
// }
// //float w = iFont.BaseFont.GetWidthPointKerned(Text.Replace("\u25CF","@"), (float)vefont.Size);
// return w;
//}
private string SplitCoverTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match, string plstr) private string SplitCoverTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match, string plstr)
{ {
if (len == null || ItemInfo.StripRtfFormatting(title).Length < len) if (len == null || ItemInfo.StripRtfFormatting(title).Length < len)