# GeoMakie: Could not find font regular, using TeX Gyre Heros Makie

**URL:** <https://discourse.julialang.org/t/geomakie-could-not-find-font-regular-using-tex-gyre-heros-makie/100092>\
**Category:** Visualization\
**Tags:** geo, fonts, makie\
**Created:** [June 9, 2023, 10:22am UTC](https://discourse.julialang.org/t/geomakie-could-not-find-font-regular-using-tex-gyre-heros-makie/100092 "2023-06-09T10:22:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![thunderclouds](https://avatars.discourse-cdn.com/v4/letter/t/3ec8ea/32.png) [@thunderclouds](https://discourse.julialang.org/u/thunderclouds)\
**Post date:** [June 9, 2023, 10:22am UTC](https://discourse.julialang.org/t/geomakie-could-not-find-font-regular-using-tex-gyre-heros-makie/100092/1 "2023-06-09T10:22:31Z")

</div>

I have a question about the fonts in GeoMakie.jl. When I run the following sample code, I get the error “ **Warning: Could not find font regular, using TeX Gyre Heros Makie** ”.  
It seems that this error occurs at the timing when GeoAxis is called.  
Is there any way to avoid this warning?

```julia
using GeoMakie, CairoMakie

lons = -180:180
lats = -90:90
field = [exp(cosd(l)) + 3(y/90) for l in lons, y in lats]

fig = Figure()
ax = GeoAxis(fig[1,1])
surface!(ax, lons, lats, field; shading = false)
save("surf_example.png", fig; px_per_unit=2)

```

---

<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:** [June 9, 2023, 10:27am UTC](https://discourse.julialang.org/t/geomakie-could-not-find-font-regular-using-tex-gyre-heros-makie/100092/2 "2023-06-09T10:27:05Z")

</div>

`font = :regular` is the default in Makie and that is usually translated to TeX Gyre Heros Makie (unless overridden). So that message is kind of surprising, it looks almost like `font = "regular"` was passed instead

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [June 9, 2023, 10:29am UTC](https://discourse.julialang.org/t/geomakie-could-not-find-font-regular-using-tex-gyre-heros-makie/100092/3 "2023-06-09T10:29:33Z")

</div>

I debugged this at some point, but it’s a small bug (geomakie didn’t update the use of makie internal apis for fonts), but there was a problem with creating a clean fix… Will need to revisit to see what the problem was.

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [June 9, 2023, 10:41am UTC](https://discourse.julialang.org/t/geomakie-could-not-find-font-regular-using-tex-gyre-heros-makie/100092/4 "2023-06-09T10:41:05Z")

</div>

GeoMakie calls the internal function `layout_text` explicitly here:

> <https://github.com/MakieOrg/GeoMakie.jl/blob/89e700fcf1df83b4e5c253e08c435f04d6da6243/src/utils.jl#L231-L236>

We’ve been kind of deprecating `layout_text(fontname, fonts, ...)`, and instead all makie internal functions call now `layout_text(actual_font, unused)`,  
So in the function, we need to either call `to_font(font, fonts)` [here](https://github.com/MakieOrg/Makie.jl/blob/master/src/layouting/layouting.jl#L49), which would make it work for GeoMakie, but would stop working for internal functions, or we remove `fonts` from the arguments, and create 2 overloads for final resolved fonts and for the `font, fonts` signature. A simple fix would be to call `layout_text` with a resolved font in GeoMakie, but that would just perpetuate this unclean use of `layout_text`.  
I think I couldn’t decide what to do quickly enough and then run out of time to fix this nicely.

---

<div class="post-metadata">

**Author:** ![thunderclouds](https://avatars.discourse-cdn.com/v4/letter/t/3ec8ea/32.png) [@thunderclouds](https://discourse.julialang.org/u/thunderclouds)\
**Post date:** [June 11, 2023, 12:24am UTC](https://discourse.julialang.org/t/geomakie-could-not-find-font-regular-using-tex-gyre-heros-makie/100092/5 "2023-06-11T00:24:32Z")

</div>

> [@sdanisch](#):
>
> `.)`, and instead all makie internal functions call now `layout_text(actual_font, unused)`,  
> So in the function, we need to either call `to_font(font, fonts)` [here](https://github.com/MakieOrg/Makie.jl/blob/master/src/layouting/layouting.jl#L49), which would make it work for GeoMakie, but would stop working for internal functions, or we remove `fonts` from the arguments, a

Thanks for the explanation. I understand the current situation.
