Setting overal font in figure

Hey out there!

I have the following problem. I want to set the font for all my plots in Make to a certain font, for example Times New Roman. The following is not working.

[276b4fcb] WGLMakie v0.8.3

julia> using WGLMakie

julia> function myplot()
           fig, ax, s = scatter(rand(10), rand(10))
           ax.xlabel = "Is this Times New Roman?"
           ax.ylabel = "Is this Times New Roman?"
           ax.title = "Is this Times New Roman?"
           fig
       end
myplot (generic function with 1 method)

julia> mytheme = Theme(font = "Times New Roman", fontsize=40, marker=:xcross, markersize=30)
Attributes with 4 entries:
  font => Times New Roman
  fontsize => 40
  marker => xcross
  markersize => 30

julia> with_theme(myplot, mytheme)

This sets everything, except the font. Where is the problem?

And secondly I would like to know, where I can find all available fonts for Makie how to add new ones.

Thanks a lot!

Recently, the way to specify fonts at the top level changed.

Now you do fonts = (; regular = "Times New Roman", bold = "Some bold font"), there’s also italic and bold_italic in the default theme but that’s not used anywhere so far. You can also define your own font categories if you want. Check this page: https://docs.makie.org/stable/documentation/fonts/#symbol

Makie should in principle find all fonts that FreeType can read which reside in the typical font directories on Linux, Windows and Mac. If you have fonts stored somewhere else, for example in a specific project asset directory, you can always use the path to the font directly like regular = "./assets/fonts/special_font.otf".

Thank you very much!