René's URL Explorer Experiment


Title: [FEATURE]: accept font data (a URL or the bytes) for export and text measurement · Issue #8056 · plotly/plotly.js · GitHub

Open Graph Title: [FEATURE]: accept font data (a URL or the bytes) for export and text measurement · Issue #8056 · plotly/plotly.js

X Title: [FEATURE]: accept font data (a URL or the bytes) for export and text measurement · Issue #8056 · plotly/plotly.js

Description: Description We want charts to render with a font that isn't installed on the machine doing the rendering - Kaleido in a container, in our case. This all started in plotly/kaleido#464 but @camdecoster has pointed me here and I found a sim...

Open Graph Description: Description We want charts to render with a font that isn't installed on the machine doing the rendering - Kaleido in a container, in our case. This all started in plotly/kaleido#464 but @camdecost...

X Description: Description We want charts to render with a font that isn't installed on the machine doing the rendering - Kaleido in a container, in our case. This all started in plotly/kaleido#464 but @camde...

Opengraph URL: https://github.com/plotly/plotly.js/issues/8056

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[FEATURE]: accept font data (a URL or the bytes) for export and text measurement","articleBody":"### Description\n\nWe want charts to render with a font that isn't installed on the machine doing the rendering - Kaleido in a container, in our case. This all started in https://github.com/plotly/Kaleido/issues/464 but @camdecoster has pointed me here and I found a similar issue - #4885, but we then concluded it would make sense to create a narrower one, so here it is. \n\nThe request is a way to hand plotly.js a font, as either a URL or the raw bytes, and have it do two things with whichever it gets: register the face\nbefore it measures text, and inline `@font-face` with base64 into the exported SVG.\n\n### Why should this feature be added?\n\nWell, people are still hitting #4885 that has been open since 2020. I just tried with plotly.py 7.1.0 (plotly.js 4.1.1) and a font that isn't installed on my machine:\n\n```python\nfig.update_layout(font=dict(family=\"Fira Sans Condensed\"))\nfig.write_image(\"out.svg\")\n```\n\nand the resulting SVG names that family 7 times but carries no `@font-face` and no base64anywhere. The name travels, but the bytes don't.\n\nIt's two bugs though, not one. The other is WilliamMayor's 2023 comment in the same thread - the font also isn't loaded when plotly.js measures text, so ticks, margins and legends get sized on some kind of \"fallback\" and the layout is wrong before anything is exported. Taking the font as input could fix both, I believe, because both come from it not being in the page.\n\nI saw @alexcjohnson proposing a cheaper alternative in #4885 - to read the `@font-face` rules already active in the document instead of having users declare fonts. I tested that: with a plain `\u003clink>` to fonts.googleapis.com, `cssRules` throws `SecurityError`, and it's only readable when the link carries `crossorigin=\"anonymous\"` (at least in the one browser and the one Google family we've checked).\n\n### Mocks/Designs\n\nRough, and I'm not attached to the naming:\n\n```js\nPlotly.newPlot(gd, data, layout, {\n  fonts: [\n    // a google fonts css url - the same string that's already in the \u003clink>\n    {family: 'Open Sans', url: 'https://fonts.googleapis.com/css2?family=Open+Sans'},\n\n    // a direct font file, nothing to parse\n    {family: 'Open Sans', weight: 700, url: '/static/OpenSans-Bold.woff2'},\n\n    // or the bytes, for offline and headless\n    {family: 'Open Sans', weight: 700, data: arrayBufferOrBase64}\n  ]\n})\n```\n\nThe first form is the convenient one and it's the only one that needs extra work: a Google Fonts URL returns CSS rather than a font, so something has to read the src out of that CSS and fetch the file it points at. The other two skip that step - the second is already a font file, the third is already bytes. So the CSS reading could come later, or never, and the feature still works.\n\n### Notes\n\nMy motivation is Kaleido, which has no user CSS and no network, so it would pass bytes. The same option would cover a browser user passing the Google Fonts URL they already have in their `\u003clink>`.\n\nIn case it comes up: I've grep'ed the latest plotly.js bundle and maplibre-gl does this already, and it's in the tree, but I don't think chart text can borrow it. Its loader is wired into maplibre's own style system, and `plotly-basic` and `plotly-cartesian` contain 0 `FontFace` - only the full bundle has it - so depending on it would put a map renderer in every build.\n\nOne case I'd leave out on purpose: pulling the bytes of a font that's only installed on the system. No browser API exposes them, so those users would have to supply the file.\n\nOne question we would need to agree on: how much of the URL side is needed? The bytes form needs no network at all, so it could land on its own. A direct `.woff2` URL adds a fetch, which would need a timeout and a warn-and-continue fallback so it can never hang a render. A Google Fonts CSS URL (which would add reading the `src` out of that CSS) looks a bit more complicated - from what I saw, google splits one family across several `@font-face` blocks, one per script, each pointing at a different file, so taking just the first gets you Latin and drops Cyrillic or Greek without saying anything.","author":{"url":"https://github.com/nul0m","@type":"Person","name":"nul0m"},"datePublished":"2026-09-18T15:28:18Z","url":"https://github.com/plotly/plotly.js/issues/8056"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ba4c1945-8f7f-cdf4-c150-70c8237142f5
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id80A2:2E5652:2ACBD7C:3681594:6B01ADF6
html-safe-noncee44a17527a1860f47fb16ece92d5a1ff16e578cddb1d3b837521fdd8ad7dcb7b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MEEyOjJFNTY1MjoyQUNCRDdDOjM2ODE1OTQ6NkIwMUFERjYiLCJ2aXNpdG9yX2lkIjoiODQyMDY3NTAyNjQ5MTEyNTIzOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac2ceecf58ed0c64be9e80cbdebff27dbb06baa40f02ae23bf524bc1ef9be01d5c
hovercard-subject-tagissue:5501378529
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/plotly/plotly.js/8056/issue_layout
twitter:imagehttps://opengraph.githubassets.com/324b94a236cd1c2cc73676af84692cadae8d80351b87fc903e1a2eedf9e05f1b/plotly/plotly.js/issues/8056
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/324b94a236cd1c2cc73676af84692cadae8d80351b87fc903e1a2eedf9e05f1b/plotly/plotly.js/issues/8056
og:image:altDescription We want charts to render with a font that isn't installed on the machine doing the rendering - Kaleido in a container, in our case. This all started in plotly/kaleido#464 but @camdecost...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamenul0m
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/plotly/plotly.js git https://github.com/plotly/plotly.js.git
octolytics-dimension-user_id5997976
octolytics-dimension-user_loginplotly
octolytics-dimension-repository_id45646037
octolytics-dimension-repository_nwoplotly/plotly.js
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id45646037
octolytics-dimension-repository_network_root_nwoplotly/plotly.js
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/plotly/plotly.js/issues/8056#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fplotly%2Fplotly.js%2Fissues%2F8056
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fplotly%2Fplotly.js%2Fissues%2F8056
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=plotly%2Fplotly.js
Reloadhttps://github.com/plotly/plotly.js/issues/8056
Reloadhttps://github.com/plotly/plotly.js/issues/8056
Reloadhttps://github.com/plotly/plotly.js/issues/8056
plotlyhttps://github.com/plotly
plotly.jshttps://github.com/plotly/plotly.js
Codehttps://github.com/plotly/plotly.js
Issues726 (726)https://github.com/plotly/plotly.js/issues
Pull requests84 (84)https://github.com/plotly/plotly.js/pulls
Actionshttps://github.com/plotly/plotly.js/actions
Security and qualityhttps://github.com/plotly/plotly.js/security
Insightshttps://github.com/plotly/plotly.js/insights
https://github.com/plotly/plotly.js
New issuehttps://github.com/login?return_to=https://github.com/plotly/plotly.js/issues/8056
New issuehttps://github.com/login?return_to=https://github.com/plotly/plotly.js/issues/8056
#8172https://github.com/plotly/plotly.js/pull/8172
[FEATURE]: accept font data (a URL or the bytes) for export and text measurementhttps://github.com/plotly/plotly.js/issues/8056#top
#8172https://github.com/plotly/plotly.js/pull/8172
P2considered for next cyclehttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22P2%22
enhancementhttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22enhancement%22
featuresomething newhttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22feature%22
size: 5https://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22size%3A%205%22
https://github.com/nul0m
nul0mhttps://github.com/nul0m
on Sep 18, 2026https://github.com/plotly/plotly.js/issues/8056#issue-5501378529
plotly/kaleido#464https://github.com/plotly/kaleido/issues/464
@camdecosterhttps://github.com/camdecoster
#4885https://github.com/plotly/plotly.js/issues/4885
#4885https://github.com/plotly/plotly.js/issues/4885
@alexcjohnsonhttps://github.com/alexcjohnson
#4885https://github.com/plotly/plotly.js/issues/4885
nul0mhttps://github.com/nul0m
featuresomething newhttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22feature%22
on Sep 18, 2026https://github.com/plotly/plotly.js/issues/8056#event-31399618158
camdecosterhttps://github.com/camdecoster
P2considered for next cyclehttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22P2%22
size: 5https://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22size%3A%205%22
on Sep 21, 2026https://github.com/plotly/plotly.js/issues/8056#event-31553227390
robertclaushttps://github.com/robertclaus
enhancementhttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22enhancement%22
on Sep 22, 2026https://github.com/plotly/plotly.js/issues/8056#event-31623088317
https://github.com/camdecoster
camdecosterhttps://github.com/camdecoster
on Sep 28, 2026https://github.com/plotly/plotly.js/issues/8056#issuecomment-5880689518
https://github.com/camdecoster
camdecosterhttps://github.com/camdecoster
on Sep 29, 2026https://github.com/plotly/plotly.js/issues/8056#issuecomment-5894378686
#8089https://github.com/plotly/plotly.js/issues/8089
https://github.com/camdecoster
camdecosterhttps://github.com/camdecoster
on Oct 6, 2026https://github.com/plotly/plotly.js/issues/8056#issuecomment-6019213680
#8089https://github.com/plotly/plotly.js/issues/8089
loadingdonehttps://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet/loadingdone_event
https://github.com/nul0m
nul0mhttps://github.com/nul0m
on Oct 12, 2026https://github.com/plotly/plotly.js/issues/8056#issuecomment-6127926693
@camdecosterhttps://github.com/camdecoster
Sign up for freehttps://github.com/signup?return_to=https://github.com/plotly/plotly.js/issues/8056
Sign in to commenthttps://github.com/login?return_to=https://github.com/plotly/plotly.js/issues/8056
P2considered for next cyclehttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22P2%22
enhancementhttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22enhancement%22
featuresomething newhttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22feature%22
size: 5https://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22size%3A%205%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.