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

Strange behavior with FontResolverInfo ResolveTypeface
http://forum.pdfsharp.com/viewtopic.php?f=3&t=3389
Page 1 of 1

Author:  swell [ Fri Jul 08, 2016 3:10 pm ]
Post subject:  Strange behavior with FontResolverInfo ResolveTypeface

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?

Author:  () => true [ Fri Jul 08, 2016 6:59 pm ]
Post subject:  Re: Strange behavior with FontResolverInfo ResolveTypeface

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

Author:  swell [ Wed Jul 13, 2016 8:11 am ]
Post subject:  Re: Strange behavior with FontResolverInfo ResolveTypeface

Hi, I'm using the classic version on an Azure WebApp.

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

Author:  Thomas Hoevel [ Tue Aug 16, 2016 1:09 pm ]
Post subject:  Re: Strange behavior with FontResolverInfo ResolveTypeface

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.

Author:  swell [ Thu Sep 01, 2016 3:13 pm ]
Post subject:  Re: Strange behavior with FontResolverInfo ResolveTypeface

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!

Author:  TH-Soft [ Thu Sep 01, 2016 4:02 pm ]
Post subject:  Re: Strange behavior with FontResolverInfo ResolveTypeface

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.

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