Skip to content

Fix font descent caching across device resolutions - #6931

Open
NaumanRafay wants to merge 3 commits into
tidyverse:mainfrom
NaumanRafay:fix-font-descent-dpi-6929
Open

NaumanRafay wants to merge 3 commits into
tidyverse:mainfrom
NaumanRafay:fix-font-descent-dpi-6929

Conversation

@NaumanRafay

Copy link
Copy Markdown

Fixes #6929.

Drawing a plot at 72 DPI could affect the text layout of a later 300-DPI export in the same R session. The font descent cache reused the low-resolution measurement because its key did not include the device resolution.

This change adds the horizontal and vertical device resolution to the cache key. It also adds a visual regression test that compares a 300-DPI export after a 72-DPI preview with a 300-DPI export from a clean cache, and a user-facing NEWS entry.

Testing

  • The regression test failed before the fix and passed afterward.
  • The margin and save test suites passed.
  • The package test suite reported 1,831 passes, zero failures, and 315 skips. The broader R CMD check could not complete the map examples because sf was unavailable in the local test environment.

AI assistance

I used OpenAI Codex to assist in fixing the bug.

This branch has not been deployed

No deployments
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.

Font descent cache is not keyed by device resolution, so a screen render changes a later high-dpi ggsave()

1 participant