From a303303074072fab8ebddcaf15c83f968b949337 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 6 May 2013 17:21:11 +0000 Subject: [PATCH] =?UTF-8?q?Corrected=20logic=20for=20the=20CoverProcTitle?= =?UTF-8?q?=20pagelist=20token.=20We=20now=20use=20the=20format=20element?= =?UTF-8?q?=20=E2=80=9CCoverTitleLenth=E2=80=9D=20instead=20of=20=E2=80=9C?= =?UTF-8?q?TitleLenth=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Volian.Print.Library/VlnSvgPageHelper.cs | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index 7444b544..5571113d 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -884,7 +884,9 @@ namespace Volian.Print.Library case "[PROCTITLE2]": 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); break; case "{COVERTITLE1}": @@ -1053,6 +1055,29 @@ namespace Volian.Print.Library 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) { if (len == null || ItemInfo.StripRtfFormatting(title).Length < len)