# Wrong font style being selected in Makie

**URL:** https://discourse.julialang.org/t/wrong-font-style-being-selected-in-makie/91640
**Category:** Visualization
**Tags:** plotting, makie, cairo
**Created:** [December 14, 2022, 12:57pm UTC](https://discourse.julialang.org/t/wrong-font-style-being-selected-in-makie/91640 "2022-12-14T12:57:55Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![vembha](https://avatars.discourse-cdn.com/v4/letter/v/5fc32e/32.png) [@vembha](https://discourse.julialang.org/u/vembha)
#### Post date: [December 14, 2022, 12:57pm UTC](https://discourse.julialang.org/t/wrong-font-style-being-selected-in-makie/91640/1 "2022-12-14T12:57:56Z")

</div>

Hello,

While plotting using ‘Makie.jl’, I am passing the command `titlefont = "Arial"` in `Axis()` command to change the title font to Arial, and as expected, I get to see Arial font being used. But when I pass `titlefont = "Arial Bold"`, instead of a bold-weighted regular Arial, the command is choosing the ‘Arial Rounded MT Bold’ font, as shown below:

![image](https://global.discourse-cdn.com/julialang/original/3X/c/c/cc656834e2992f38bee595fcbdd61b402925eb1d.png)

I pass the command `set_theme!(Theme(font = "Arial"))` at the beginning of the code, and thus you see regular Arial being used for tick labels. I’ve checked the `"C:\Windows\Fonts\Arial"` folder in my machine and ‘Arial Bold’ is indeed installed.

Can someone help me out?

---

<div class="post-metadata">

### Author: ![fatteneder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fatteneder/32/33991_2.png) [@fatteneder](https://discourse.julialang.org/u/fatteneder)
#### Post date: [December 14, 2022, 1:14pm UTC](https://discourse.julialang.org/t/wrong-font-style-being-selected-in-makie/91640/2 "2022-12-14T13:14:57Z")

</div>

Which version are you using?

The way you set fonts has been changed recently: [[ANN] Makie.jl 0.19 - #2 by jules](https://discourse.julialang.org/t/ann-makie-jl-0-19/91184/2)

---

<div class="post-metadata">

### Author: ![vembha](https://avatars.discourse-cdn.com/v4/letter/v/5fc32e/32.png) [@vembha](https://discourse.julialang.org/u/vembha)
#### Post date: [December 14, 2022, 1:28pm UTC](https://discourse.julialang.org/t/wrong-font-style-being-selected-in-makie/91640/3 "2022-12-14T13:28:49Z")

</div>

The version for CairoMakie and Makie are `[13f3f980] CairoMakie v0.8.13` and `[ee78f7c6] Makie v0.17.13` respectively.

I guess the change doesn’t apply to the version I am currently using. So, is there a way around?

Also, I am defining the weight of the font in the `Axis` attributes in the following way:

`ax = Axis(fig[i, j], title = plot_title, ... titlefont = "Arial Bold")`

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [December 14, 2022, 5:09pm UTC](https://discourse.julialang.org/t/wrong-font-style-being-selected-in-makie/91640/4 "2022-12-14T17:09:43Z")

</div>

Fonts are chosen by best match of the parts of the name, so if Arial Bold is not picked but Arial Rounded MT Bold is, that suggests that Arial Bold was not in the list of choices. Why that is, I don’t know, fonts are a complicated topic and there can be many things that go wrong.

What you could try is passing the complete path to the font instead of Arial Bold, that way you circumvent the font search algorithm.

Also, I think Makie currently can’t deal with fonts where one font file contains multiple styles. There’s an issue about that open in the repository already.

---

<div class="post-metadata">

### Author: ![vembha](https://avatars.discourse-cdn.com/v4/letter/v/5fc32e/32.png) [@vembha](https://discourse.julialang.org/u/vembha)
#### Post date: [December 14, 2022, 5:48pm UTC](https://discourse.julialang.org/t/wrong-font-style-being-selected-in-makie/91640/5 "2022-12-14T17:48:46Z")

</div>

Okay, I understand the issue…

I’ll try using the full path. Is this the correct way?

`ax = Axis(fig[i, j], ... titlefont = "<U+202A>C:/Windows/Fonts/arialbd.ttf")`

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [December 14, 2022, 6:19pm UTC](https://discourse.julialang.org/t/wrong-font-style-being-selected-in-makie/91640/6 "2022-12-14T18:19:41Z")

</div>

What’s `<U+202A>`? Other than that, looks correct.

---

<div class="post-metadata">

### Author: ![vembha](https://avatars.discourse-cdn.com/v4/letter/v/5fc32e/32.png) [@vembha](https://discourse.julialang.org/u/vembha)
#### Post date: [December 15, 2022, 2:34pm UTC](https://discourse.julialang.org/t/wrong-font-style-being-selected-in-makie/91640/7 "2022-12-15T14:34:08Z")

</div>

Sorry `<U+202A>` was a copying error. The address is `C:/Windows/Fonts/arialbd.ttf`. Thank you for the solution. 🙂
