Repository navigation
feat(preview): take resolveFamily in renderSlideToImage / renderSlideToRgba - #486
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
Why
The PNG path (
@office-kit/pptx-preview/node) maps every authored font name throughsubstituteFamily. A caller that measures a deck's font with its own face — e.g. abuildFontkitMeasureralias from the template's font (Meiryo) to a face infontFiles— gets lines wrapped for that face but painted in Carlito, so measured and drawn line breaks disagree.renderSlideSvgalready takesresolveFamily;rasterizedidn't forward it.What
RenderImageOptions.resolveFamily?: RenderSlideOptions['resolveFamily'](same type as the SVG option, optional like the other fields), forwarded torenderSlideSvg.eastAsianFamily(fix(preview): draw bold Japanese text with the bold face in PNG renders #481): East Asian characters takeeastAsianFamily(the first kana face infontFiles); the rest of the run takes theresolveFamilyresult. Fixed by a test.substituteFamily), so the fidelity baseline should not move.Tests
test/preview-raster-resolve-family.test.tsMeiryorun resolved to a loaded family draws a wider ink bbox (and a different ink count) than the Carlito default; uses bundledLiberation Monoas the stand-in so CI needs no extra fontsubstituteFamily, byte-identical PNGeastAsianFamilyand Latin pieces in the resolved family (SVG + measurer)Both raster tests fail when the forwarding line is removed.