Skip to content

Axis labels and tick labels in 3D plots do not use fonts loaded from remote server #7413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wasimxyz opened this issue May 2, 2025 · 3 comments
Labels
bug something broken P2 considered for next cycle

Comments

@wasimxyz
Copy link

wasimxyz commented May 2, 2025

I have an HTML export of a 3D figure created using the Python API. For website embedding, I load a custom font from a server. For the example here, I'll just use a Google Font with a distinct style:

<link
  href="http://fonts.googleapis.com/css?family=Audiowide"
  rel="stylesheet"
  type="text/css"
/>

I include a template in the plot layout so that this font is used for axis labels, tick labels, and et cetera. For 2D plots, this works as expected. For 3D plots, the axis and tick labels do not use the font at all.

I can't share the HTML export, but I recreated a minimal example from scratch to demonstrate this using Plotly.js:

plotly-3d-graph-font-issue.html.zip

Image
@wasimxyz
Copy link
Author

wasimxyz commented May 2, 2025

Another note that may be helpful to add here is that if I install the Audiowide font on my local machine and remove the <link> tag, all fonts are properly applied. The problem seems to be specifically with loading the font from a remote server.

I tried to call Plotly.newPlot after the fonts have loaded via document.fonts.ready.then((fontFaceSet) => { ... }, but this doesn't make a difference.

@gvwilson gvwilson added bug something broken P2 considered for next cycle labels May 8, 2025
@gvwilson
Copy link
Contributor

gvwilson commented May 8, 2025

Thanks for reporting this @wasimsandhu - it's definitely a bug, but it may be some time before we can get to it.

@wasimxyz
Copy link
Author

wasimxyz commented May 8, 2025

@gvwilson No problem, thanks for triaging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P2 considered for next cycle
Projects
None yet
Development

No branches or pull requests

2 participants