PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 5:21 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sun Feb 28, 2010 9:57 am 
Offline

Joined: Sun Feb 28, 2010 9:38 am
Posts: 2
Hi All PDFSharp gurus, have gone thru the forum but cant get any hint on the issue that i have face.

I have sample code to load private fonts, but its not working, any highlight pls?

Dim fontFileName As String = "G:\WebSite\Fonts\Century.TTF"
Dim privateFonts As New XPrivateFontCollection
Dim fontData As Byte() = File.ReadAllBytes(fontFileName)
privateFonts.AddFont(fontData, "#Century")

Dim fontstyles As New XFont("Century", FontSize, FontStyle, options)
GFX.DrawString(Val, fontstyles, XBrushes.Black, X, Y)

Suppossing if have added the font thru "XPrivateFontCollection" should i then can directly use the font?
But some how it cant display the font (Century) that i requires.

Version PDFSharp : 1.31 GDI+
Development Environtment : ASP.NET

Thanks you in advance.
Cheers.


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 01, 2010 9:18 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
Hi!

Use the WPF build if you need private fonts (C# sample included).

Private fonts currently do not work in the GDI+ build.
I have that on our TODO list, but cannot fix it immediately.

Or use PDFsharp 1.1 if you need a GDI+ build with private fonts.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 02, 2010 2:05 pm 
Offline

Joined: Sun Feb 28, 2010 9:38 am
Posts: 2
Thanks thomas for the advice.


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 03, 2010 9:43 pm 
Offline

Joined: Thu Oct 21, 2010 7:37 pm
Posts: 5
So are you saying that you removed the support for Private Fonts in build 1.31? How well does it work in 1.1?


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 04, 2010 8:21 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
iandawg wrote:
So are you saying that you removed the support for Private Fonts in build 1.31??

It wasn't removed, it no longer works in the GDI+ build. I'm pretty sure it'll work again in the future.

If you need private fonts and use PDFsharp 1.31 then use the WPF build.
If you need private fonts and need the GDI+ build then use the PDFsharp 1.1.

Our application uses private fonts. That worked fine with the old PDFsharp version (while we were using the GDI+ build) and it works fine with the current version (we moved to the WPF build meanwhile).

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 136 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