PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.de/

XPrivateFontCollection Help
http://forum.pdfsharp.de/viewtopic.php?f=2&t=1075
Page 1 of 1

Author:  darrenw [ Sun Feb 28, 2010 9:57 am ]
Post subject:  XPrivateFontCollection Help

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.

Author:  Thomas Hoevel [ Mon Mar 01, 2010 9:18 am ]
Post subject:  Re: XPrivateFontCollection Help

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.

Author:  darrenw [ Tue Mar 02, 2010 2:05 pm ]
Post subject:  Re: XPrivateFontCollection Help

Thanks thomas for the advice.

Author:  iandawg [ Wed Nov 03, 2010 9:43 pm ]
Post subject:  Re: XPrivateFontCollection Help

So are you saying that you removed the support for Private Fonts in build 1.31? How well does it work in 1.1?

Author:  Thomas Hoevel [ Thu Nov 04, 2010 8:21 am ]
Post subject:  Re: XPrivateFontCollection Help

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).

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