Skip to content

XpsSerialization in presentationcore.dll throws System.IO.FileFormatException #1511

Closed
@rladuca

Description

@rladuca

When working with XPS documents WPF will subset fonts in order to reduce their size during embedding. In certain cases, this can result in the font growing during subsetting.

This results in us returning ERR_WOULD_GROW:

We already know what to do in this case (as the comments in the code above suggest), use the original font. However, we seem to be ignoring that:

if (errCode != NO_ERROR)
throw gcnew FileFormatException(sourceUri);

The fix is pretty straightforward, simply copy the font into the result buffer when we detect ERR_WOULD_GROW and return as usual.

Metadata

Metadata

Assignees

Labels

.NET FrameworkBugProduct bug (most likely)netfx-servicing-approvedNetfx Approved for Servicingtell-modeIssues and PR's that require notice to .NET Core Shiproom

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions