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

Font problem moving from WPF to GDI
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1168
Page 1 of 1

Author:  foxwoodDesign [ Wed May 05, 2010 2:16 pm ]
Post subject:  Font problem moving from WPF to GDI

Hi, I was having issues with WPF on our live server so I moved to the GDI build and all seemed well.

Since moving to GDI I have noticed that setting my required font is not working. The following code worked fine in the WPF build:
Code:
        para.Format.Font.Color = Color.FromCmyk(4, 94, 90, 1)
        para.Format.Font.Size = 15
        para.Format.Font.Bold = False
        para.Format.Font.Name = "FS Albert Bold"


If i change the font to a standard font (ie verdana) it works ok, it just seems to be this custom font.

Can you suggest anything?

Kind regards

Author:  Thomas Hoevel [ Wed May 05, 2010 2:34 pm ]
Post subject:  Re: Font problem moving from WPF to GDI

Hi!

If the font is in a PrivateFontCollection: don't use PrivateFontCollection, install the font locally on your server.

IIRC PrivateFontCollection work with the GDI build of PDFsharp 1.1 and with the WPF builds of PDFsharp 1.2/1.3.
Therefore switching to an older version could solve this problem.
This bug shall be fixed with the next release. Sorry for the inconvenience.

If it fails with the font installed locally on the server: could be a rights problem.

Author:  foxwoodDesign [ Wed May 05, 2010 2:42 pm ]
Post subject:  Re: Font problem moving from WPF to GDI

Thank you for the quick response.

The font is installed on the server - where can I get an older version of the build?

If it's a rights issue, where can I rectify this - as I mentioned, it loaded the font in fine in the WPF build.

Regards

Author:  Thomas Hoevel [ Wed May 05, 2010 2:56 pm ]
Post subject:  Re: Font problem moving from WPF to GDI

If you don't use PrivateFontCollections there's no need to go back to an old version.
(But all versions are still there: https://sourceforge.net/projects/pdfsharp/files/ )

I presume it runs on a web server?
Every web application belongs to an application pool that gets its rights from an identity.
For a try you can create a new application pool running on the Local System account for your application.
It's probably not a rights problem if it still fails then.

Maybe the font must be converted for use with our GDI build:
http://www.pdfsharp.net/wiki/PostScript_fonts.ashx

Author:  foxwoodDesign [ Wed May 05, 2010 3:09 pm ]
Post subject:  Re: Font problem moving from WPF to GDI

Hi,

Thanks again - Unfortunately this did not resolve the issue. The font has also be converted to openType (I have attached the font).

Any other suggestions would be greatly appreciated.

Kind regards


Admin sez: attachment removed ...

Author:  Thomas Hoevel [ Wed May 05, 2010 3:15 pm ]
Post subject:  Re: Font problem moving from WPF to GDI

OpenType is a container for PostScript and True Type fonts.

Only True Type fonts will work with the GDI build. You have PostScript fonts.
See here:
http://www.pdfsharp.net/wiki/PostScript_fonts.ashx

Author:  foxwoodDesign [ Wed May 05, 2010 3:45 pm ]
Post subject:  Re: Font problem moving from WPF to GDI

Hey,

Sorry to be a pain - I have converted now to TTF and still no joy.

Attached is the TTF version - Any thoughts?

Attachments:
FSALBEEB.zip [49.48 KiB]
Downloaded 513 times

Author:  foxwoodDesign [ Wed May 05, 2010 3:46 pm ]
Post subject:  Re: Font problem moving from WPF to GDI

..

I'm not sure if this is helpful, bit if I change the font to Wingdings, it works, and it looks like wingdings is an opentype?

Regards

Author:  foxwoodDesign [ Wed May 05, 2010 5:16 pm ]
Post subject:  Re: Font problem moving from WPF to GDI

I am not sure if this is going to be possible - I have converted the font to TTF using multiple converters and still no joy.

The font works fine if I go back to WPF build but I cannot run this in the server 2003 live environment.

Do you know how I can resolve this.

I have a large client awaiting delivery and this is the final piece in a huge project - I am to make a donation if we can get this fully resolved.

Regards

Author:  Thomas Hoevel [ Thu May 06, 2010 11:06 am ]
Post subject:  Re: Font problem moving from WPF to GDI

foxwoodDesign wrote:
I'm not sure if this is helpful, bit if I change the font to Wingdings, it works, and it looks like wingdings is an opentype?

There are OpenType files with True Type outlines (like Wingdings) that do work - and there are OpenType files with PostScript outlines (like your Albert font) that do not work.

Your converted font appears to be True Type and should work.

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