Skip to content

Fix poster figure shrinkage during HTML backfill - #40

Open
LingAo Xiao (ArmandXiao) wants to merge 1 commit into
microsoft:mainfrom
ArmandXiao:codex/fix-poster-font-metrics
Open

Fix poster figure shrinkage during HTML backfill#40
LingAo Xiao (ArmandXiao) wants to merge 1 commit into
microsoft:mainfrom
ArmandXiao:codex/fix-poster-font-metrics

Conversation

@ArmandXiao

Copy link
Copy Markdown
Contributor

Summary

  • replace the Arial browser fallback with bundled Arimo Regular/Bold, which is metrically compatible with Arial
  • validate every card media item immediately before and after font freezing, including direct images, multi-image figures, and legacy figure blocks
  • abort the staged render transaction when font freezing changes media identity, crosses the 90% fill floor, or introduces more than 101% axis overflow
  • keep the existing soft settle behavior and preserve legacy posters that were already outside the finishing band

Root cause

PR #37 fixed the durable HTML reload path, but it also froze Arial to DejaVu Sans before the expand baseline was captured. On the real MSRA 117 poster, that metric change reflowed the layout and reduced a figure from 95.20% fill to 79.16%. The later validator saw only the already-shrunken 79.16% baseline, so it could not detect the regression.

With bundled Arimo, the same four figures render at 95.18%, 95.25%, 95.25%, and 95.25%.

Validation

  • python -m py_compile passed for the modified Python modules
  • git diff --check passed
  • 4 existing real posters audited: MSRA 117, P01 portrait, RSR-X1, and DesignAsCode
    • PNG versus independent cold-open HTML screenshot: RMSE 0 for all four
    • repeated cold-context figure geometry drift: 0 px
  • explicit two-pass rerender on P01 portrait and DesignAsCode
    • run 1 versus run 2 figure geometry drift: 0 px
    • run 1 versus run 2 PNG: pixel-identical
    • each rerendered PNG versus cold-open HTML: pixel-identical
    • only one font-fidelity block and one Arimo asset set remained after both passes
  • 6 fresh posters audited across landscape half, landscape 3-column, portrait half, and portrait full layouts
    • all renderer runs completed
    • all PDF dimension verify-final checks passed
    • all PNG versus cold-open HTML comparisons had RMSE 0
    • all repeated cold-context geometry checks had 0 px drift
  • negative fault injection changed the Arial mapping back to DejaVu Sans
    • gate reported 95.20% -> 79.16% and exited 2
    • original HTML, PDF, and PNG SHA256 values were unchanged after the rejected render

PR hygiene

This PR contains only production code, skill documentation, and the OFL-licensed Arimo font assets. Test scripts, screenshots, logs, and audit results are intentionally not included.

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.

1 participant