Title: [BUG]: Text first drawn outside a full redraw keeps fallback font sizes after its web font loads · Issue #8099 · plotly/plotly.js · GitHub
Open Graph Title: [BUG]: Text first drawn outside a full redraw keeps fallback font sizes after its web font loads · Issue #8099 · plotly/plotly.js
X Title: [BUG]: Text first drawn outside a full redraw keeps fallback font sizes after its web font loads · Issue #8099 · plotly/plotly.js
Description: Description #8094 redraws a plot when a web font loads during its draw. Text that is first drawn outside _doPlot still keeps its fallback font sizes. One example is a treemap that zooms through Plotly.animate with redraw: false. Drawing....
Open Graph Description: Description #8094 redraws a plot when a web font loads during its draw. Text that is first drawn outside _doPlot still keeps its fallback font sizes. One example is a treemap that zooms through Plo...
X Description: Description #8094 redraws a plot when a web font loads during its draw. Text that is first drawn outside _doPlot still keeps its fallback font sizes. One example is a treemap that zooms through Plo...
Opengraph URL: https://github.com/plotly/plotly.js/issues/8099
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[BUG]: Text first drawn outside a full redraw keeps fallback font sizes after its web font loads","articleBody":"### Description\n\n#8094 redraws a plot when a web font loads during its draw. Text that is first drawn outside `_doPlot` still keeps its fallback font sizes. One example is a treemap that zooms through `Plotly.animate` with `redraw: false`. `Drawing.bBox` caches the fallback sizes, so the text stays wrong after the user zooms away and back. Hover labels also measure with the fallback font, but they correct themselves on the next hover because they are not cached.\n\n### Screenshots/Video\n\n\u003cimg width=\"700\" height=\"500\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/049e772a-1a4d-40c9-88c4-64c3ea18f89f\" />\n\n### Steps to reproduce\n\n- Run Plotly devtools and open the browser devtools console\n- Run the following snippet to create a treemap starting on level B:\n ```js\n const family = `JetBrainsMono`;\n document.fonts.add(\n new FontFace(\n family,\n `url(https://cdn.jsdelivr.net/npm/@fontsource/jetbrains-mono@5.0.20/files/jetbrains-mono-latin-400-normal.woff2)`,\n ),\n );\n\n const label = \"I am Lrrr, of the planet Omicron Persei 8.\";\n Plotly.newPlot(\n gd,\n [\n {\n type: \"treemap\",\n ids: [\"root\", \"A\", \"B\", \"a1\", \"a2\", \"b1\"],\n labels: [\"root\", \"A\", \"B\", label, label, label],\n parents: [\"\", \"root\", \"root\", \"A\", \"A\", \"B\"],\n values: [0, 0, 0, 30, 20, 25],\n // Start zoomed into B. Only the leaves of A use the web font.\n level: \"B\",\n textfont: {\n family: [\"Arial\", \"Arial\", \"Arial\", family, family, \"Arial\"],\n },\n },\n ],\n { width: 700, height: 500 },\n );\n ```\n- Click the root to zoom out. The leaves of `A` draw for the first time, and the font starts to load.\n- Note that the labels in A overflow the containers\n\n### Notes\n\n- A fix that skips the `bBox` cache while `document.fonts.status` is `loading` corrects the second view. It also turns off the cache for all text on the page during font loads, which makes first draws 20-30% slower. Clearing the cache entries for a font when that font loads can be a cheaper option.\n- The issue is rare. The font must be used only by text that a partial redraw draws first.","author":{"url":"https://github.com/camdecoster","@type":"Person","name":"camdecoster"},"datePublished":"2026-10-02T17:00:38Z","url":"https://github.com/plotly/plotly.js/issues/8099"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ad086b6d-3a2d-3982-1718-8efd24d92594 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E71A:3DCD28:7EE835:A85863:6B01ADA6 |
| html-safe-nonce | 4ace5727b5f8595c9d65acdb5bc575b54eca9e0ae7345eda42b70902bd718652 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzFBOjNEQ0QyODo3RUU4MzU6QTg1ODYzOjZCMDFBREE2IiwidmlzaXRvcl9pZCI6Ijg4MTY1MjYyNDA3MTk2Nzg4ODciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 95304648321382b80a9f11f23f7c43ac54b24a26b81e4a0bcd6af34a38419c69 |
| hovercard-subject-tag | issue:5680672016 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/plotly/plotly.js/8099/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ab2175511c46c9a47effd4c64352b96d1693d113f02660916cca72b5f251a824/plotly/plotly.js/issues/8099 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ab2175511c46c9a47effd4c64352b96d1693d113f02660916cca72b5f251a824/plotly/plotly.js/issues/8099 |
| og:image:alt | Description #8094 redraws a plot when a web font loads during its draw. Text that is first drawn outside _doPlot still keeps its fallback font sizes. One example is a treemap that zooms through Plo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | camdecoster |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/plotly/plotly.js git https://github.com/plotly/plotly.js.git |
| octolytics-dimension-user_id | 5997976 |
| octolytics-dimension-user_login | plotly |
| octolytics-dimension-repository_id | 45646037 |
| octolytics-dimension-repository_nwo | plotly/plotly.js |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 45646037 |
| octolytics-dimension-repository_network_root_nwo | plotly/plotly.js |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width