PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Dec 11, 2017 6:57 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Fri Jul 08, 2016 3:10 pm 
Offline

Joined: Fri Jul 08, 2016 2:59 pm
Posts: 3
I had a very strange problem today with a custom IFontResolver.


Code:
public FontResolverInfo ResolveTypeface(string familyName, bool isBold, bool isItalic)


The first time the method is called with a private Arial font in bold here is how it is called:

Code:
ResolveTypeface("Arial", true, false)


the computed facename is : arial-b

The second time this method is called with Arial and bold here is the call:

Code:
ResolveTypeface("arial-b", true, false)


Looking at the github repo to the SegoeWpFontResolver class line #83 we have this:

Code:
if (lowerFamilyName.StartsWith("segoe wp"))


Which means that ResolveTypeFace is not always called with familyName but also with faceName.

Is this right or is it a bug?


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 08, 2016 6:59 pm 
Offline
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 299
Hi!

We recently fixed a bug with font resolvers under Silverlight.
AFAIK only the Silverlight build was affected.

Which build do you use?

Please use the Issue Submission Template to make this bug reproducible.
See also:
viewtopic.php?f=2&t=832

_________________
Ă–hmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 13, 2016 8:11 am 
Offline

Joined: Fri Jul 08, 2016 2:59 pm
Posts: 3
Hi, I'm using the classic version on an Azure WebApp.

I'll try to make a sample to reproduce the error.


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 16, 2016 1:09 pm 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2740
Location: Cologne, Germany
We discovered this bug under Silverlight, but it applies to all versions.

In file XGlyphTypeface.cs around line 219 is this old code:
Code:
fontFamily = XFontFamily.CreateSolitary(fontResolverInfo.FaceName);


The changed version is this:
Code:
fontFamily = XFontFamily.CreateSolitary(familyName);


ResolveTypeFace should only be called with the family name.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 01, 2016 3:13 pm 
Offline

Joined: Fri Jul 08, 2016 2:59 pm
Posts: 3
Great thanks! Sorry for not being able to give a poc.

I don't see any changes on github is this normal?

Is there any ETA for shipping?

Thanks a lot guys!


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 01, 2016 4:02 pm 
Offline
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 308
Location: CCAA
swell wrote:
I don't see any changes on github is this normal?
Yep, it was not updated yet.

swell wrote:
Is there any ETA for shipping?
Not yet.

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


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 2 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:  
Powered by phpBB® Forum Software © phpBB Group