PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Can't get Magneto font to work
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3527
Page 1 of 1

Author:  Smith5646 [ Thu Jan 12, 2017 7:08 pm ]
Post subject:  Can't get Magneto font to work

I added the following code to my program so I could print using the Magneto font. When xfont is created, it says it is Magneto (using the debugger) but the text is not printed with the Magneto font. I found I can copy and paste text from the PDF into Word and Word is showing that the font is Arial. When I pasted other text that uses other fonts, they paste with the correct font. Have I done something wrong?

Code:
XFont xfont = new XFont("Magneto", 10, XFontStyle.Regular);
gfx.DrawString("Test String", xfont, XBrushes.Black, 36, 10, XStringFormats.TopLeft);

Author:  TH-Soft [ Fri Jan 13, 2017 8:36 am ]
Post subject:  Re: Can't get Magneto font to work

Is "Magneto" the correct font name? Does it have a supported format (not PostScript)?
If you only installed "Magneto Bold", you may have to use Bold instead of Regular or a different font name.

See also:
viewtopic.php?f=2&t=832

Author:  Smith5646 [ Fri Jan 13, 2017 6:56 pm ]
Post subject:  Re: Can't get Magneto font to work

TH-Soft wrote:
Is "Magneto" the correct font name? Does it have a supported format (not PostScript)?
If you only installed "Magneto Bold", you may have to use Bold instead of Regular or a different font name.

See also:
viewtopic.php?f=2&t=832


When I dump the XFontFamily, it is entry number 116 so I am assuming it is valid and available natively to PDFSharp and that I have have to do is reference it. Am I wrong on that assumption? That is what I did for the other fonts that do work.

Author:  TH-Soft [ Sat Jan 14, 2017 9:58 am ]
Post subject:  Re: Can't get Magneto font to work

Smith5646 wrote:
When I dump the XFontFamily, it is entry number 116 so I am assuming it is valid and available natively to PDFSharp and that I have have to do is reference it. Am I wrong on that assumption?
I assume nothing.

Without a complete VS solution that allows me to replicate the issue I won't do anything about it.
There are many different versions of PDFsharp, there are many sources that offer a "Magneto" font for download.

Have you tried the GDI build and the WPF build of 1.50 beta 3b? Do both fail?

See also:
viewtopic.php?f=2&t=832

Author:  Smith5646 [ Sat Jan 14, 2017 3:10 pm ]
Post subject:  Re: Can't get Magneto font to work

TH-Soft wrote:
Smith5646 wrote:
When I dump the XFontFamily, it is entry number 116 so I am assuming it is valid and available natively to PDFSharp and that I have have to do is reference it. Am I wrong on that assumption?
I assume nothing.

Without a complete VS solution that allows me to replicate the issue I won't do anything about it.
There are many different versions of PDFsharp, there are many sources that offer a "Magneto" font for download.

Have you tried the GDI build and the WPF build of 1.50 beta 3b? Do both fail?

See also:
viewtopic.php?f=2&t=832


I'm confused with your comment that you assume nothing. Are you saying that just because a font is listed in XFontFamily does not mean it is available to PDFSharp?

Based on the download file name (PDFSharp-MigraDocFoundation-1_32), I believe I am using version 1.32. That is the version the download link "PDFsharp Downloads at sourceforge.net" provides. I now see I can get to 1.50 through NuGet so I will try it this weekend and post my results.

Author:  Thomas Hoevel [ Mon Jan 16, 2017 11:05 am ]
Post subject:  Re: Can't get Magneto font to work

Smith5646 wrote:
Are you saying that just because a font is listed in XFontFamily does not mean it is available to PDFSharp?
You see something in your debugger. We have nothing we can run in a debugger.
I don't know what the XFontFamily entry you see may signify.

Font handling has changed fundamentally with version 1.50, so you should try the latest release of 1.50.
Font handling is different between GDI build and WPF build, so it might be worth trying both (i.e. try the other if one fails).

You also find 1.50 on SourceForge:
https://sourceforge.net/projects/pdfsha ... ta%203%29/

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/