Repository navigation
Track the scope of @font-face families in PDF as a gap - #303
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
CSS Fonts 4 §4.2 says, that an
@font-facefamily named like an installed family hides the installed one "for documents that use the stylesheet". The PdfSharp backend gets both halves of that wrong, so#font-family-descgoes fromsupportedtopartialwith two gaps and an ignored test each:@font-face"Book Antiqua" with only a 400 face still resolves bold to the installed "Book Antiqua Bold", instead of the registered face with synthesized bold.PdfSharpAdapteris a singleton with a singleFontResolverand nothing ever removes a face. A later document that uses the same family name without declaring it still embeds the webfont.The second one is the more serious one, on a server one user's document can change the fonts of another user's PDF. Fixing it needs a font set per document instead of per adapter, which is a bigger change, as such this PR only tracks it. The screen adapters likely have the same leak through the shared
FontsHandler, that's not tested yet.How to test this PR?
CI should succeed. Removing the
[Ignore]from the two tests inFontFaceFamilyTestsmakes both fail at their assertion.