MigraDoc 斜体文本重叠
对于下面的代码,双引号内和双引号之后的文本是重叠的。这似乎与字体选择有关,但我可能无法更改它。
有没有办法或属性可以增加字符之间的宽度?或者一些解决方法?
Document document = new Document();
Section section = document.AddSection();
Paragraph paragraph = section.AddParagraph();
Font _fontTimes14Italic = new Font("Times New Roman", "14pt") { Italic = true };
paragraph.AddFormattedText("This is a test \"The Broken\" should display incorrectly", _fontTimes14Italic);
PdfDocumentRenderer renderer = new PdfDocumentRenderer(true,
PdfSharp.Pdf.PdfFontEmbedding.Always);
renderer.Document = document;
renderer.RenderDocument();
renderer.PdfDocument.Save(filePath);
With the following code below, the text within and after the double quotes is overlapping. It seems related to the font selection, however I may not be able to change that.
Is there a way or property available to increase the width between characters? Or some workaround?
Document document = new Document();
Section section = document.AddSection();
Paragraph paragraph = section.AddParagraph();
Font _fontTimes14Italic = new Font("Times New Roman", "14pt") { Italic = true };
paragraph.AddFormattedText("This is a test \"The Broken\" should display incorrectly", _fontTimes14Italic);
PdfDocumentRenderer renderer = new PdfDocumentRenderer(true,
PdfSharp.Pdf.PdfFontEmbedding.Always);
renderer.Document = document;
renderer.RenderDocument();
renderer.PdfDocument.Save(filePath);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是 PDFsharp 的 WPF 版本的错误。
切换到 GDI+ 版本(也可用于 WPF 应用程序),文本将正确呈现。
这个错误将在 PDFsharp 的下一个版本中得到修复(这是早就应该的,但我不能说它什么时候会到来)。
This is a bug of the WPF build of PDFsharp.
Switch to the GDI+ build (can also be used for WPF applications) and the text will render correctly.
This bug will be fixed with the next release of PDFsharp (which is long overdue but I cannot say when it will come).