fix(preview): stop shrinking text in shapes without normAutofit - #293
Merged
Conversation
PowerPoint never shrinks text in shapes that lack <a:normAutofit>: noAutofit (or no autofit element) overflows the box, and spAutoFit grows the box instead of the text. The heuristic shrink-to-fit estimator rendered template placeholders (size inherited from layout/master, box authored tightly around sample text) at down to 0.4x of their PowerPoint size. Remove the estimator; only authored normAutofit shrinks text. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016az3UDqDkcNbCmWe3LoGnm
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.
Summary
PowerPoint never shrinks text in shapes that lack
<a:normAutofit>:<a:noAutofit>(or no autofit element at all) simply overflows the box<a:spAutoFit>grows the box to fit the text — the text keeps its sizeThe preview applied a heuristic shrink-to-fit estimate to such shapes to keep
text inside the authored box. For template decks this is a fidelity break:
placeholders inherit their font size from the layout/master while the box is
authored tightly around the sample text, so the preview rendered them at down
to 0.4× of their PowerPoint size (real case: a cover title authored at 22pt in
the layout rendered at ~12.8pt, subtitles at the 0.4 floor).
This removes the heuristic estimator. Only an authored
<a:normAutofit>(baked
fontScale, or the measured shrink for a bare tag) scales text,matching PowerPoint's rendering.
Test plan
vitest run— all 1299 tests pass(was 12.8pt), subtitle at 14pt (was 5.6pt), master footer badge text at
authored size
🤖 Generated with Claude Code
https://claude.ai/code/session_016az3UDqDkcNbCmWe3LoGnm