# Font styling in Python using custom font

**URL:** https://community.plotly.com/t/font-styling-in-python-using-custom-font/15125
**Category:** 📊 Plotly Python
**Created:** [October 30, 2018, 4:11pm UTC](https://community.plotly.com/t/font-styling-in-python-using-custom-font/15125 "2018-10-30T16:11:01Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![julied20](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/julied20/32/4609_2.png) [@julied20](https://community.plotly.com/u/julied20)
#### Post date: [October 30, 2018, 4:11pm UTC](https://community.plotly.com/t/font-styling-in-python-using-custom-font/15125/1 "2018-10-30T16:11:01Z")

</div>

Hello everyone,

I am trying to edit the font title of my graph in Plotly. I’ve read this article on how to change the title font: [https://plot.ly/python/font/](https://plot.ly/python/font/) but I can’t manage to make it work with the font I want (Franklin Gothic) which is installed on my computer. I don’t have any error but my title is written with the default font.

Is there a way to find all the available fonts in Plotly? And is it possible to add new custom fonts?

I am working with plotly 3.3.0 on jupyter notebook.

Thanks for your help!

---

<div class="post-metadata">

### Author: ![empet](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@empet](https://community.plotly.com/u/empet)
#### Post date: [October 30, 2018, 4:42pm UTC](https://community.plotly.com/t/font-styling-in-python-using-custom-font/15125/2 "2018-10-30T16:42:02Z")

</div>

Hi @julied20, The font you set in your code is displayed only if it’s installed on your computer.

I ran this code:

```auto
import plotly.graph_objs as go

data = [
    go.Scatter(
        x=[0, 1, 2, 3, 4, 5, 6, 7, 8],
        y=[0, 1, 2, 3, 4, 5, 6, 7, 8]
    )
]
layout = go.Layout(width=500, height=300,
    title='Franklin Gothic Font',
    font=dict(family="Franklin Gothic", size=18)
)
fig = go.FigureWidget(data=data, layout=layout)
fig

```

and here is the plot:

 ![Franklin-Gothic](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/8/855d5e35623b10f26744c243b10f7cc325129adf.png)

It seems to be Franklin Gothic. Hence it is installed on my system.

---

<div class="post-metadata">

### Author: ![mohizzle](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/mohizzle/32/14006_2.png) [@mohizzle](https://community.plotly.com/u/mohizzle)
#### Post date: [February 19, 2021, 7:20pm UTC](https://community.plotly.com/t/font-styling-in-python-using-custom-font/15125/3 "2021-02-19T19:20:41Z")

</div>

I’m encountering the same problem. I have the custom font I want installed on my server on EC2, but figures fail to render the custom font.

The custom font renders correctly on my local machine but not on the server. Is there a way to check what fonts are available to plotly? And where it tried to load them from?

---

<div class="post-metadata">

### Author: ![HC-85](https://avatars.discourse-cdn.com/v4/letter/h/51bf81/32.png) [@HC-85](https://community.plotly.com/u/HC-85)
#### Post date: [January 12, 2022, 2:00am UTC](https://community.plotly.com/t/font-styling-in-python-using-custom-font/15125/4 "2022-01-12T02:00:29Z")

</div>

Hey empet, do you know a way of setting the font only for the title? (without affecting the axes)

---

<div class="post-metadata">

### Author: ![empet](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@empet](https://community.plotly.com/u/empet)
#### Post date: [January 12, 2022, 9:09am UTC](https://community.plotly.com/t/font-styling-in-python-using-custom-font/15125/5 "2022-01-12T09:09:41Z")

</div>

Hi @HC-85  
Yes, I know: 🙂

```auto
import plotly.graph_objects as go
import numpy as np
fig=go.Figure(go.Scatter(x=np.arange(5), y=np.random.rand(5)))
fig.update_layout(width=600, height=400,
                 title=dict(text="This is my title",
                            x=0.5, y=0.93,
                            font_family="Open Sherif",
                            font_size=20,
                            font_color="red"),
                 font_family="Open Sherif",
                 font_size=10)

```

![title](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/3/7/37ce41efa7c8f62890b50f970fc4c0265b6b40d2.png)

---

<div class="post-metadata">

### Author: ![charelstoncrabb](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@charelstoncrabb](https://community.plotly.com/u/charelstoncrabb)
#### Post date: [March 15, 2022, 9:52pm UTC](https://community.plotly.com/t/font-styling-in-python-using-custom-font/15125/6 "2022-03-15T21:52:32Z")

</div>

Were you able to solve this problem? I am also having trouble finding which fonts are actually available and how to support custom fonts (\*.ttf e.g.)  
@empet ?

---

<div class="post-metadata">

### Author: ![empet](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@empet](https://community.plotly.com/u/empet)
#### Post date: [March 16, 2022, 1:02pm UTC](https://community.plotly.com/t/font-styling-in-python-using-custom-font/15125/7 "2022-03-16T13:02:54Z")

</div>

@charelstoncrabb  
I’m sorry, but I don’t know such a “secret”. Maybe someone skilled in web programming could give you an advice.
