☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Font "roboto" support

Community Support
VASKOTechDesign
VASKOTechDesign

Hello Bryan,

Can you help me more with this?

I thought I already do it by parameters like:

  1. Axes: major_label_text_font
  2. Label: label_text_font
    …
    image

I put into this parameter “roboto”, but result was a differnet one. When there is “helvetica” it works, must probably because this is default one.

Bokeh: 3.3.4
Python: 3.11.2
Browser: Edge - Version 122.0.2365.92

Thank you

Jan

⌁   Link to post
mateusz
mateusz

One can use any font with text_font and similar properties. However, one has to make sure that the font is available on the page. Bokeh prefers Helvetica and falls backs to Arial and then generic sans-serif font if not available. This also happens when the font chosen by the user is not available.

To include an external font, one way may be to link to google fonts like this:

from bokeh.models import GlobalInlineStyleSheet
stylesheet = GlobalInlineStyleSheet(css="""
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap')
""")
plot.stylesheets.append(stylesheet)

Finally there’s an important caveat. Bokeh renders to HTML5 canvas, which means that we can’t take advantage of CSS’ ability to re-renderer when new fonts are loaded. Thus if fonts are not loaded before bokehjs, then these new fonts will be picked up by bokehjs on the next rendering iteration, which may require user interaction.

⌁   Link to post

End of archived discussion · Replies are disabled