Hello,
Thanks for your inquiry!
I linked to the HelveticaNeueLTStd-Cn.otf font and drew some string to a PDF with the following code, but did not reproduce your issue, I also attached my result file for reference.
- Code: Select all
PdfDocument pdf = new PdfDocument();
PdfPageBase page = pdf.Pages.Add();
//Draw text - brush
String text = "Test String";
PdfPen pen = PdfPens.DeepSkyBlue;
PdfSolidBrush brush = new PdfSolidBrush(Color.White);
PdfStringFormat format = new PdfStringFormat();
PdfTrueTypeFont truetypeFont = new PdfTrueTypeFont(@"E:\testdoc\HelveticaNeueLTStd-Cn\HelveticaNeueLTStd-Cn.otf", 10f, PdfFontStyle.Bold);
SizeF size = truetypeFont.MeasureString(text, format);
RectangleF rctg = new RectangleF(page.Canvas.ClientSize.Width / 2 + 10, 180, size.Width / 3 * 2, size.Height * 2);
page.Canvas.DrawString(text, truetypeFont, pen, brush, rctg, format);
pdf.SaveToFile("UseOtf.pdf", FileFormat.PDF);
First, please make sure that the font file can be read by your program. If so, and the issue still exists, to help us reproduce and investigate your issue quickly and efficiently, please provide us with the following information. Thanks in advance.
1. Your font file
2. Your testing code
3. Your target framework
4. Your system information (E.g. Win7, 64 bit) and region setting (E.g. China, Chinese)
Sincerely,
Marcia
E-iceblue support team
Login to view the files attached to this post.