# ProfileView (Cairo? Gtk4?) started using some odd font, but why?

**URL:** <https://discourse.julialang.org/t/profileview-cairo-gtk4-started-using-some-odd-font-but-why/125780>\
**Category:** General Usage\
**Tags:** gtk, artifacts, cairo\
**Created:** [February 11, 2025, 8:45am UTC](https://discourse.julialang.org/t/profileview-cairo-gtk4-started-using-some-odd-font-but-why/125780 "2025-02-11T08:45:27Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![HanD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hand/32/213908_2.png) [@HanD](https://discourse.julialang.org/u/HanD)\
**Post date:** [February 11, 2025, 8:45am UTC](https://discourse.julialang.org/t/profileview-cairo-gtk4-started-using-some-odd-font-but-why/125780/1 "2025-02-11T08:45:27Z")

</div>

I’v been using ProfileView.jl for some time now, with success. However, recently, the display changed, and the tooltips and various other displayed strings started using some font which doesn’t have regular ASCII characters. Based on the codes in the little boxes, the characters it draws are fine, they just don’t have proper glyphs in the used font.

```julia
julia> using ProfileView; @profview rand(100,100) * rand(100,100)

```

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

I don’t really know if this was caused by a package upgrade or some of my other actions, but the issue seems to be persistent. I tried downgrading ProfileView to the previous, 1.8.1, version, it didn’t help.

I don’t even know where to start looking for the root cause. Whether this is an issue with Cairo.jl, or Gtk4.jl, or some of my own hidden settings…

I also get a warning when displaying the first profile window:

```julia
(julia:3208466): Gtk-WARNING **: 09:37:10.062: No IM module matching GTK_IM_MODULE=ibus found

```

But I’m guessing this is unrelated. Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [February 11, 2025, 10:09am UTC](https://discourse.julialang.org/t/profileview-cairo-gtk4-started-using-some-odd-font-but-why/125780/2 "2025-02-11T10:09:14Z")

</div>

Does the same happen with ProfileCanvas.jl?

---

<div class="post-metadata">

**Author:** ![HanD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hand/32/213908_2.png) [@HanD](https://discourse.julialang.org/u/HanD)\
**Post date:** [February 11, 2025, 12:11pm UTC](https://discourse.julialang.org/t/profileview-cairo-gtk4-started-using-some-odd-font-but-why/125780/3 "2025-02-11T12:11:01Z")

</div>

ProfileCanvas.jl works ok, the result is displayed correctly in the browser.

---

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [February 11, 2025, 12:25pm UTC](https://discourse.julialang.org/t/profileview-cairo-gtk4-started-using-some-odd-font-but-why/125780/4 "2025-02-11T12:25:08Z")

</div>

> [@HanD](#):
>
> I also get a warning when displaying the first profile window:
> 
> ```none
> (julia:3208466): Gtk-WARNING **: 09:37:10.062: No IM module matching GTK_IM_MODULE=ibus found
> 
> ```

I think the GTK warning is saying that you have requested to use ibus, by setting the environment variable `GTK_IM_MODULE` to `ibus`, but ibus isn’t installed. I don’t know if this is related, however it can be a serious issue, I remember @Oscar_Smith used to have the same warning and it made his ProfileView.jl segfault. Try either installing ibus or unsetting the environment variable.

---

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [February 11, 2025, 12:55pm UTC](https://discourse.julialang.org/t/profileview-cairo-gtk4-started-using-some-odd-font-but-why/125780/5 "2025-02-11T12:55:28Z")

</div>

It appears to be a lack of font support. The “characters” are tofu/character-not-supported/.notdef glyphs. They may appear as rectangles or filled diamonds, possibly blank or with things like `?` or `X` in the middle. In this case, it seems to be a rectangle holding codepoints, or rather attempts. I had to use some substitute characters for the failed codepoints, but here’s part of the characters:

```julia
julia> "\u41\u60\u60\u54\u68\u72\u65\u61\u64\u73"
"A``Threads"

julia> "\u63\u60\u60\u70\u69\u60\u65\u72/\u74\u79\u70\u65\u69\u60\u66\u65\u72.\u60\u60:923, \u40\u65\u74\u68\u60\u64\u49\u60\u73\u74\u61\u60\u63\u65"
"c``pi`er/typei`fer.``:923, @eth`dI`sta`ce"

julia> "\u74\u79\u70\u65\u69\u60\u66\u65\u72.\u60\u60, \u74\u79\u70\u65\u69\u60\u66_\u65\u64\u67\u65: \u60\u69\u60\u65 923"
"typei`fer.``, typei`f_edge: `i`e 923"

```

I can guess that’s trying to say `All Threads, compiler/typeinfer.jl, MethodInstance, typeinf_edge, line 923`. Never used ProfileView so I don’t know if those are supposed to show up there.

---

<div class="post-metadata">

**Author:** ![HanD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hand/32/213908_2.png) [@HanD](https://discourse.julialang.org/u/HanD)\
**Post date:** [February 11, 2025, 1:40pm UTC](https://discourse.julialang.org/t/profileview-cairo-gtk4-started-using-some-odd-font-but-why/125780/6 "2025-02-11T13:40:23Z")

</div>

> [@nsajko](#):
>
> I think the GTK warning is saying that you have requested to use ibus, by setting the environment variable `GTK_IM_MODULE` to `ibus`, but ibus isn’t installed.

Not only it is installed, but it’s also running:

```julia-auto
$ psg ibus
david 5443 ? sh -c /usr/bin/ibus-daemon --panel disable $(["$XDG_SESSION_TYPE" = "x11"] && echo "--xim")
david 5446 ? /usr/bin/ibus-daemon --panel disable --xim
david 5558 ? /usr/libexec/ibus-memconf
david 5559 ? /usr/libexec/ibus-extension-gtk3
david 5569 ? /usr/libexec/ibus-x11 --kill-daemon
david 5584 ? /usr/libexec/ibus-portal
david 6039 ? /usr/libexec/ibus-engine-simple

```

I also have this:

```julia-auto
/usr/lib/x86_64-linux-gnu/gtk-4.0/4.0.0/immodules/libim-ibus.so

```

Note that I’m using Gnome desktop, so GTK should be ok. So the question is, why is Gtk4.jl unable to find this lib.

---

<div class="post-metadata">

**Author:** ![HanD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hand/32/213908_2.png) [@HanD](https://discourse.julialang.org/u/HanD)\
**Post date:** [February 11, 2025, 1:41pm UTC](https://discourse.julialang.org/t/profileview-cairo-gtk4-started-using-some-odd-font-but-why/125780/7 "2025-02-11T13:41:45Z")

</div>

> [@Benny](#):
>
> It appears to be a lack of font support. The “characters” are tofu/character-not-supported/.notdef glyphs.

Yeah, totally, that’s what I also wrote in the post itself. What’s odd is that it worked well until about two days ago, and then yesterday, it went poof. I will try a restart, maybe it will solve the issue.

---

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [February 11, 2025, 2:07pm UTC](https://discourse.julialang.org/t/profileview-cairo-gtk4-started-using-some-odd-font-but-why/125780/8 "2025-02-11T14:07:49Z")

</div>

> [@HanD](#):
>
> So the question is, why is [Gtk4.jl](https://juliaregistries.github.io/General/packages/redirect_to_repo/Gtk4) unable to find this lib.

NB:

- Gtk4.jl probably uses the BinaryBuilder.jl -packaged [GTK4\_jll](https://juliahub.com/ui/Packages/General/GTK4_jll), instead of your system-wide GTK4 installation
- I see there’s no ibus packaged for BinaryBuilder.jl. Don’t known if that’s important.

Two ideas for a diagnosis:

- try unsetting the environment variable and see if that helps
- try using the system-wide GTK4 instead of the one provided by Julia: [Overriding artifact locations](https://pkgdocs.julialang.org/v1/artifacts/#Overriding-artifact-locations)

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [February 11, 2025, 4:40pm UTC](https://discourse.julialang.org/t/profileview-cairo-gtk4-started-using-some-odd-font-but-why/125780/9 "2025-02-11T16:40:40Z")

</div>

Did you upgrade any font intentionally (meaning from outside of Julia likely)? Are you on Windows (or which platform, I’m not implicating, just asking), and which font do you think you’re using?

I would think this is a bug, i.e. in some upgraded (or downgraded) package dependency, so it would be nice if you have some old Manifest.toml file to test. But I’m not sure if the packages provide fonts, i.e. a given dependency always uses the same one, or refers to some system install.

---

<div class="post-metadata">

**Author:** ![HanD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hand/32/213908_2.png) [@HanD](https://discourse.julialang.org/u/HanD)\
**Post date:** [February 11, 2025, 4:52pm UTC](https://discourse.julialang.org/t/profileview-cairo-gtk4-started-using-some-odd-font-but-why/125780/10 "2025-02-11T16:52:17Z")

</div>

> [@nsajko](#):
>
> Two ideas for a diagnosis:
> 
> - try unsetting the environment variable and see if that helps
> - try using the system-wide GTK4 instead of the one provided by Julia: [Overriding artifact locations](https://pkgdocs.julialang.org/v1/artifacts/#Overriding-artifact-locations)

I tried unsetting the envvar, the warning disappeared, but the issue remained.

I checked the overriding document, but it doesn’t seem trivial, because the system layout of the gtk4 lib differs significantly from the artifact’s. Hence it is not just a matter of `3ee0f31a7c7548d37e6bf688b682c088c50f506f = "/usr"`

> [@Palli](#):
>
> Did you upgrade any font intentionally (meaning from outside of Julia likely)? Are you on Windows (or which platform, I’m not implicating, just asking), and which font do you think you’re using?
> 
> I would think this is a bug, i.e. in some upgraded (or downgraded) package dependency, so it would be nice if you have some old Manifest.toml file to test. But I’m not sure if the packages provide fonts, i.e. a given dependency always uses the same one, or refers to some system install.

No, I haven’t touched the fonts. This is a Debian 12 system, with Gnome desktop. I have no idea what the font picked by ProfileView/Gtk in this case could be. Otherwise, I’m using Gnome default system fonts.

* * *

Reboot didn’t help. I tried it with a fresh depot, to make sure that it’s not caused by a corrupted artifact or precompiled lib, using Julia 1.11.2:

```julia-auto
$ JULIA_DEPOT_PATH=/tmp/julia julia 
julia> using Pkg; Pkg.add("ProfileView"); using ProfileView
...
julia> @profview rand(100,100) * rand(100,100)

```

Still wrong. The same thing happens with Julia 1.10 as well.

---

<div class="post-metadata">

**Author:** ![HanD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hand/32/213908_2.png) [@HanD](https://discourse.julialang.org/u/HanD)\
**Post date:** [February 11, 2025, 5:36pm UTC](https://discourse.julialang.org/t/profileview-cairo-gtk4-started-using-some-odd-font-but-why/125780/12 "2025-02-11T17:36:40Z")

</div>

I found the culprit.

For some reason, Gtk4.jl v0.7.2 is installed, as opposed to the newest v0.7.4. `Pkg.status()` says that it can be upgraded, but `Pkg.upgrade()` doesn’t do anything with it. If I manually set its version to v0.7.4, however, it is able to install it:

```julia
(@v1.11) pkg> st --outdated -m
Status `/tmp/julia/environments/v1.11/Manifest.toml`
⌃ [9db2cae5] Gtk4 v0.7.2 (<v0.7.4)
⌅ [e9f186c6] Libffi_jll v3.2.2+2 (<v3.4.6+4): Glib_jll, HarfBuzz_jll, Wayland_jll
⌅ [30392449] Pixman_jll v0.43.4+0 (<v0.44.2+0): Cairo_jll
⌅ [b53b4c65] libpng_jll v1.6.40+0 (<v1.6.46+0): Gtk4

(@v1.11) pkg> up -m
    Updating registry at `/tmp/julia/registries/General.toml`
  No Changes to `/tmp/julia/environments/v1.11/Project.toml`
  No Changes to `/tmp/julia/environments/v1.11/Manifest.toml`

(@v1.11) pkg> up Gtk4
    Updating registry at `/tmp/julia/registries/General.toml`
  No Changes to `/tmp/julia/environments/v1.11/Project.toml`
  No Changes to `/tmp/julia/environments/v1.11/Manifest.toml`

(@v1.11) pkg> up Gtk4 @0.7.4
    Updating registry at `/tmp/julia/registries/General.toml`
  No Changes to `/tmp/julia/environments/v1.11/Project.toml`
  No Changes to `/tmp/julia/environments/v1.11/Manifest.toml`

(@v1.11) pkg> up -m Gtk4 @0.7.4
    Updating registry at `/tmp/julia/registries/General.toml`
  No Changes to `/tmp/julia/environments/v1.11/Project.toml`
  No Changes to `/tmp/julia/environments/v1.11/Manifest.toml`

(@v1.11) pkg> add Gtk4@0.7.4
   Resolving package versions...
   Installed Pango_jll ─ v1.54.1+0
   Installed Gtk4 ────── v0.7.4
  Downloaded artifact: Pango
    Updating `~/.julia/environments/profile/Project.toml`
  [9db2cae5] + Gtk4 v0.7.4
    Updating `~/.julia/environments/profile/Manifest.toml`
  [9db2cae5] ↑ Gtk4 v0.7.2 ⇒ v0.7.4
⌅ [36c8627f] ↓ Pango_jll v1.55.5+0 ⇒ v1.54.1+0
        Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`
Precompiling project...
  10 dependencies successfully precompiled in 46 seconds. 132 already precompiled.

```

And if I load ProfileView after this, the texts display correctly!

Now I don’t know why Pango\_jll.jl prohibits the use of the newest version of Gtk4.jl. Here is what `Pkg.why()` says, although this doesn’t really help:

```julia
pkg> why Pango_jll
  Gtk4 → Cairo → Pango_jll
  Gtk4 → GTK4_jll → Pango_jll
  Gtk4 → Librsvg_jll → Pango_jll
  Gtk4 → Pango_jll
  PProf → pprof_jll → Graphviz_jll → Pango_jll
  ProfileView → Cairo → Pango_jll
  ProfileView → Gtk4 → Cairo → Pango_jll
  ProfileView → Gtk4 → GTK4_jll → Pango_jll
  ProfileView → Gtk4 → Librsvg_jll → Pango_jll
  ProfileView → Gtk4 → Pango_jll
  ProfileView → GtkObservables → Cairo → Pango_jll
  ProfileView → GtkObservables → Gtk4 → Cairo → Pango_jll
  ProfileView → GtkObservables → Gtk4 → GTK4_jll → Pango_jll
  ProfileView → GtkObservables → Gtk4 → Librsvg_jll → Pango_jll
  ProfileView → GtkObservables → Gtk4 → Pango_jll

```

**Update:** Just for reference, here’s the screenshot of the same profiling output, with correctly displayed font:

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

---

<div class="post-metadata">

**Author:** ![danielwe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielwe/32/35657_2.png) [@danielwe](https://discourse.julialang.org/u/danielwe)\
**Post date:** [February 11, 2025, 8:38pm UTC](https://discourse.julialang.org/t/profileview-cairo-gtk4-started-using-some-odd-font-but-why/125780/13 "2025-02-11T20:38:06Z")

</div>

> [@HanD](#):
>
> Now I don’t know why [Pango\_jll.jl](https://juliaregistries.github.io/General/packages/redirect_to_repo/Pango_jll) prohibits the use of the newest version of [Gtk4.jl](https://juliaregistries.github.io/General/packages/redirect_to_repo/Gtk4).

Gtk4.jl version 0.7.3 and newer upper bounds Pango\_jll.jl due to some issue the maintainer had with Pango 1.55: [version 0.7.3 by jwahlstrand · Pull Request #80 · JuliaGtk/Gtk4.jl · GitHub](https://github.com/JuliaGtk/Gtk4.jl/pull/80)

---

<div class="post-metadata">

**Author:** ![HanD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hand/32/213908_2.png) [@HanD](https://discourse.julialang.org/u/HanD)\
**Post date:** [February 12, 2025, 7:31am UTC](https://discourse.julialang.org/t/profileview-cairo-gtk4-started-using-some-odd-font-but-why/125780/14 "2025-02-12T07:31:35Z")

</div>

> [@danielwe](#):
>
> [Gtk4.jl](https://juliaregistries.github.io/General/packages/redirect_to_repo/Gtk4) version 0.7.3 and newer upper bounds [Pango\_jll.jl](https://juliaregistries.github.io/General/packages/redirect_to_repo/Pango_jll) due to some issue the maintainer had with Pango 1.55: [version 0.7.3 by jwahlstrand · Pull Request #80 · JuliaGtk/Gtk4.jl · GitHub](https://github.com/JuliaGtk/Gtk4.jl/pull/80)

That sort of explains it. What I still don’t get, though, is why the package manager decides to upgrade Pango\_jll and keep Gtk4 downgraded, and not vice versa. Gtk4 is a more direct dependency of my manually added package than Pango\_jll. I guess don’t understand how the version resolution works in Pkg.jl.

Anyhow, I added a [comment](https://github.com/JuliaGtk/Gtk4.jl/pull/80#issuecomment-2652885925) to the (closed) Gtk4 PR to explain the situation.

---

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [February 12, 2025, 7:55am UTC](https://discourse.julialang.org/t/profileview-cairo-gtk4-started-using-some-odd-font-but-why/125780/15 "2025-02-12T07:55:23Z")

</div>

> [@HanD](#):
>
> I guess don’t understand how the version resolution works in [Pkg.jl](https://juliaregistries.github.io/General/packages/redirect_to_repo/Pkg).

> [@What is the Pkg.jl package dependency resolver (solver algorithm)?](https://discourse.julialang.org/t/what-is-the-pkg-jl-package-dependency-resolver-solver-algorithm/77821):
>
> According to its [source code](https://github.com/JuliaLang/Pkg.jl/tree/master/src/Resolve), Pkg.jl uses a dependency resolving algorithm called MaxSum to resolve the package dependency graph. However, I was not able to find any documentation about this algorithm, or any concrete reference to some scientific paper describing it. Can someone add or provide some documentation on this algorithm and maybe some discussion what are the rationales and design decisions behind it? What are the advantages of MaxSum compared to other dependency resolvers, such as [PubG…](https://github.com/dart-lang/pub/blob/master/doc/solver.md)

---

<div class="post-metadata">

**Author:** ![HanD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hand/32/213908_2.png) [@HanD](https://discourse.julialang.org/u/HanD)\
**Post date:** [February 12, 2025, 8:10am UTC](https://discourse.julialang.org/t/profileview-cairo-gtk4-started-using-some-odd-font-but-why/125780/16 "2025-02-12T08:10:39Z")

</div>

So the proper solution in this case would be to add a compatibility requirement to ProfileView.jl that limits Gtk4 to \>=0.7.3 ?
