PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Wed Oct 23, 2019 1:21 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu Jan 12, 2017 7:08 pm 
Offline

Joined: Thu Jan 12, 2017 6:50 pm
Posts: 3
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);


Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 13, 2017 8:36 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 483
Location: CCAA
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

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 13, 2017 6:56 pm 
Offline

Joined: Thu Jan 12, 2017 6:50 pm
Posts: 3
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.


Top
 Profile  
Reply with quote  
PostPosted: Sat Jan 14, 2017 9:58 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 483
Location: CCAA
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

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Sat Jan 14, 2017 3:10 pm 
Offline

Joined: Thu Jan 12, 2017 6:50 pm
Posts: 3
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.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 16, 2017 11:05 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2980
Location: Cologne, Germany
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/

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 370 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group