我在我的网页的 CSS 中使用 Google 字体“Open Sans,sans-serif”。我正在使用 evo pdf 生成 PDF。在此使用 TextElement 动态创建页眉和页脚。
我的问题是在 c# fontfamily 中没有这样的 Google 字体。如何在 c# fontfamily 中获得“Open Sans,sans-serif”?
TextElement footerText = new TextElement(0, 15, "Page &p; of &P; ",
new System.Drawing.Font(this.OpenSans,12, FontStyle.Regular, GraphicsUnit.Pixel));
footerText.TextAlign = HorizontalTextAlign.Right;
footerText.ForeColor = Color.Black;
footerText.EmbedSysFont = true;
htmlToPdfConverter.PdfFooterOptions.AddElement(footerText);
最佳答案
TextElement footerText = new TextElement(0, pdfConverter.PdfFooterOptions.FooterHeight - 15,
"This is page &p; of &P; ",
new System.Drawing.Font(new System.Drawing.FontFamily("Times New Roman"),
这不是您要找的吗:evo guide to using fonts
关于c# - C# 中的 FontFamily 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28424508/