If font is not proportional, set default font to VESymbFix to be used in pdf generation code (without this, the default was set to Helvetica)
If 1st character output for chunk, in a table cell, is a hard space (or various other special characters), set font to default (VESymbFix) font. (For HLP)
This commit is contained in:
@@ -403,7 +403,16 @@ namespace Volian.Print.Library
|
||||
DisplayText dt = new DisplayText(MyFlexGrid.GetMyItemInfo(), str, false);
|
||||
str = dt.StartText;
|
||||
str = PreProcessRTF(w, str);
|
||||
iTextSharp.text.Paragraph myPara = RtfToParagraph(str);
|
||||
|
||||
// If the font is not proportional, pass the symbol font through to RtfToParagraph. It is needed
|
||||
// in underlying code to set the chunk's font if the first character of a cell is a hardspace. Without
|
||||
// this, pdfs were using the Helvetica font, which is a default itextsharp font.
|
||||
ItemInfo ii = MyFlexGrid.GetMyItemInfo();
|
||||
iTextSharp.text.Font ff = null;
|
||||
if (!ii.FormatStepData.Font.FontIsProportional())
|
||||
ff = Volian.Svg.Library.VolianPdf.GetFont("VESymbFix", (int)ii.FormatStepData.Font.Size, (int)ii.FormatStepData.Font.WindowsFont.Style);
|
||||
iTextSharp.text.Paragraph myPara = RtfToParagraph(str, ff);
|
||||
|
||||
myColumnText1.SetSimpleColumn(0, 0, w-2, MyContentByte.PdfDocument.PageSize.Top); // Padding = 4
|
||||
if (str.Contains(@"\'05"))
|
||||
{
|
||||
@@ -648,10 +657,11 @@ namespace Volian.Print.Library
|
||||
str = _StatRTB.Rtf;
|
||||
return str;
|
||||
}
|
||||
public static iTextSharp.text.Paragraph RtfToParagraph(string rtf)
|
||||
public static iTextSharp.text.Paragraph RtfToParagraph(string rtf, iTextSharp.text.Font mySymFont)
|
||||
{
|
||||
IRtfDocument rtfDoc = RtfInterpreterTool.BuildDoc(rtf);
|
||||
Rtf2iTextSharp rtf2IText = new Rtf2iTextSharp(rtfDoc);
|
||||
rtf2IText.DefaultFont = mySymFont;
|
||||
iTextSharp.text.Paragraph para = rtf2IText.Convert();
|
||||
para.SetLeading(_SixLinesPerInch, 0);
|
||||
return para;
|
||||
|
Reference in New Issue
Block a user