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
wasimsandhu opened this issue May 2, 2025 · 1 comment

Comments

@wasimsandhu
Copy link

wasimsandhu 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
@wasimsandhu
Copy link
Author

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.

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

No branches or pull requests

1 participant