Makie fonts not always behaving as expected - Arial Bold and Symbol fonts

This is an extremely minor inconvinience, so if there is no fix it doesn’t really matter, but if there is a simple fix / I’m being dumb I’d like to know

  1. I can’t get Arial Bold to work, only Arial Rounded MT Bold
julia> Makie.to_font("Arial Bold")
FTFont (family = Arial Rounded MT Bold, style = Regular)

julia> Makie.to_font(raw"C:\Windows\Fonts\Arial\Arial Bold.tff")
FTFont (family = Arial Rounded MT Bold, style = Regular)
  1. The Symbol font doesn’t seem to work for me. The SymbolPi font seems to work, but that is ever-so-slightly different to the Symbol font, and I don’t understand why passing the exact path to the font doesn’t seem to work
f = Figure()
ax1 = Axis(f[1,1],title="abcef",titlefont=raw"C:\Windows\Fonts\Symbol Regular.ttf")
ax2 = Axis(f[1,2],title="abcdef",titlefont=raw"C:\Windows\Fonts\SymbolPi Regular.ttf")


Hm I was going to say “because we don’t support font collections yet” but you’re on windows and I usually see these ttc files on Mac (in the common case of Arial). So then you might be hitting a bug in the font finding algorithm, there is an open PR in FreeTypeAbstraction to improve this but it’s currently a bit stalled Better font-finding heuristics, with a shortcut and a few caches. by tecosaur · Pull Request #84 · JuliaGraphics/FreeTypeAbstraction.jl · GitHub

I’m not quite sure what’s going on in your second example but you could as a test try to sidestep Makie’s font resolution/caching mechanism and open the FTFont handle yourself. Then you can be sure that you get the right one. If that doesn’t give you the expected results then it might be something about the file:

font = Makie.FreeTypeAbstraction.FTFont(raw"C:\Windows\Fonts\Symbol Regular.ttf")
ax1 = Axis(f[1,1],title="abcef",titlefont = font)

Something was wrong with the files as calling

font = Makie.FreeTypeAbstraction.FTFont(raw"C:\Windows\Fonts\Symbol Regular.ttf")

gave an error. Turns out the filename of the fonts is not what is showed by windows in the Fonts folder, and you have to actually open the properties of the file to see the true filename. Using the true filename for arial bold worked

julia> Makie.to_font(raw"C:\Windows\Fonts\Arial\arialbd.ttf")
FTFont (family = Arial, style = Black)

with the symbol font, it seems it is getting the right font,

julia> font = Makie.FreeTypeAbstraction.FTFont(raw"C:\Windows\Fonts\symbol.ttf")
FTFont (family = Symbol, style = Regular)

but still not working in the figure.

Thanks for your help! I’ll just keep using the SymbolPi font as it’s very similar