Skip to content

fix(preview): stop shrinking text in shapes without normAutofit - #293

Merged
baseballyama merged 1 commit into
mainfrom
fix/preview-no-heuristic-autofit-shrink
Jul 31, 2026
Merged

fix(preview): stop shrinking text in shapes without normAutofit#293
baseballyama merged 1 commit into
mainfrom
fix/preview-no-heuristic-autofit-shrink

Conversation

@baseballyama

Copy link
Copy Markdown
Collaborator

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 size

The 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
  • Verified against a real template deck: cover title now renders at 22pt
    (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

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
Copilot AI review requested due to automatic review settings July 31, 2026 09:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@baseballyama
baseballyama merged commit 553e3d9 into main Jul 31, 2026
8 checks passed
@baseballyama
baseballyama deleted the fix/preview-no-heuristic-autofit-shrink branch July 31, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants