![]() Maybe it helps to remove and re-install the fonts. ![]() The fonts work here, so there is nothing wrong with them either. It was designed to be metrically compatible with the MS Sans bitmap font that ship. I don't see a problem in your code fragment. Microsoft Sans Serif Regular is a very legible User Interface (UI) font. To me it looks as if the correct fonts are used (looking at Q, j and g). New XRect(0, 30 + 2 * page.Height / 3, page.Width, page.Height / 3),Ĭonst string filename = "HelloWorld_tempfile.pdf" New XRect(0, 2 * page.Height / 3, page.Width, page.Height / 3), New XRect(0, 30 + page.Height / 3, page.Width, page.Height / 3),įont = new XFont("CHSans-Bold", 20, XFontStyle.Regular, options) New XRect(0, page.Height / 3, page.Width, page.Height / 3), By the way, if you think Futura looks like typefaces named Intertype and Spartan, youre right. New XRect(0, 30, page.Width, page.Height / 3),įont = new XFont("CHSans-Regular", 20, XFontStyle.Regular, options) The appealing spikiness of both fonts, however, makes for clean-looking headlines and text as easy to read as any sans serif face can be. Gfx.DrawString("Hello, World! abcdefghijklmnopqrstuvwxyz", font, XBrushes.Black, New XRect(0, 0, page.Width, page.Height / 3), Gfx.DrawString("Hello, World! ABCDEFGHIJKLMNOPQRSTUVWXYZ", font, XBrushes.Black, XFont font = new XFont("CHSans-Light", 20, XFontStyle.Regular, options) XFont font = new XFont("Verdana", 20, XFontStyle.BoldItalic) XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.WinAnsi, PdfFontEmbedding.None) XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode, PdfFontEmbedding.Always) XGraphics gfx = XGraphics.FromPdfPage(page) PdfDocument document = new PdfDocument() ĭ = "Created with PDFsharp" So please tell me how to add this font (CHSans-Light,etc,) to this FontFamily.Families. there is no such font - CHSans-Light is listed out. The result for this font which is below shows "Microsoft Sans Serif" not "CHSans-Light".But if the above code works for other fonts.Ex.If pass "Arial" then the below output is retreived as "Arial".įontFamily: Īnd i checked FontFamily.Families. Return new XFont("CHSans-Light",20.0,XFontStyle.Regular,new XPdfFontOptions(, )) The below code is using for to create the font. I installed this font in Windows 7 and checked Microsoft Word which shows this installed font - CHSans-Light,CHSans-Bold,CHSans-Regular.īut the pdf does not show these fonts even after installation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |