After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 773350 - Source view doesn't use monospace font
Source view doesn't use monospace font
Status: RESOLVED NOTGNOME
Product: gitg
Classification: Applications
Component: gui
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: gitg-maint
gitg-maint
Depends on:
Blocks:
 
 
Reported: 2016-10-22 12:23 UTC by Nguyễn Hồng Quân
Modified: 2017-09-30 20:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gitg log with gtk theme "numix-archblue" (3.38 KB, text/plain)
2016-11-15 07:45 UTC, Adam Hirst
Details

Description Nguyễn Hồng Quân 2016-10-22 12:23:00 UTC
I use gitg 3.20.3 on Ubuntu 16.10. Gitg doesn't display source code with monospace font.

My setting for monospace font is:

```
$ gsettings get org.gnome.desktop.interface monospace-font-name
'Ubuntu Mono 13'
```
Comment 1 Adam Hirst 2016-11-01 11:09:28 UTC
I'm experiencing the same issue.

```
$ gsettings get org.gnome.desktop.interface monospace-font-name
'Monospace 11'
```

Affected is not only the source view, but also the diff and commit views.

I'm not a GNOME user, so I'm not sure which app is supposed to even set this specific gsettings key, or if it's only set by the presence of a gnome-session; so I would of course appreciate a solution to this issue which will still work in my case. Being able to set the font in gitg itself would be even better.
Comment 2 Adam Hirst 2016-11-15 07:45:15 UTC
Created attachment 339895 [details]
gitg log with gtk theme "numix-archblue"

I did some experimenting earlier, and it seemed that this bug did NOT occur if I changed my GTK theme to Adwaita (set using lxappearance as, as mentioned, I am not a user of 'full GNOME', nor of 'full LXDE').

When running `gitg` with Adwaita set, I got the minimal console output of: 

```
[adam@rakka ~]$ gitg
(gitg:6966): Gtk-WARNING **: Failed to get the GNOME session proxy: The name org.gnome.SessionManager is not owned
(gitg:6966): Gtk-WARNING **: Failed to get the Xfce session proxy: The name org.xfce.SessionManager is not owned
(gitg:6966): Gtk-WARNING **: Failed to get an inhibit portal proxy: The name org.freedesktop.portal.Desktop is not owned
(gitg:6966): Gtk-WARNING **: A tag named 'invalid-char-style' is already in the tag table.
(gitg:6966): GtkSourceView-CRITICAL **: gtk_source_style_apply: assertion 'GTK_IS_TEXT_TAG (tag)' failed
(gitg:6966): Gtk-CRITICAL **: gtk_text_tag_set_priority: assertion 'GTK_IS_TEXT_TAG (tag)' failed
(gitg:6966): Gtk-CRITICAL **: gtk_text_buffer_apply_tag: assertion 'GTK_IS_TEXT_TAG (tag)' failed
```

along with one or two warnings about strange characters in one of my repo's source files, which I won't duplicate. But the important thing was that the monospace fonts were working as expected.

However, when I ran with either of the GTK themes I normally use (namely Numix-ArchBlue or the sadly currently abandoned Shiki-Brave-Classic/Revival, the output was as in the attached file.

I decided thus to try updating Numix-ArchBlue, which it seems was installed on my system from -git, and was at least a few weeks (probably months) out of date. After doing this, and setting that again to be the currently active GTK theme, lo and behold: monospace fonts started working!

I therefore consider this bug to be fixed "for me", but instead of just leaving it at that, I thought it might at least be useful to post a little info about what I found out. Maybe this will assist either the gitg developers, or be useful for other affected users using GTK themes which still trigger this behaviour.
Comment 3 Nguyễn Hồng Quân 2017-06-24 06:08:19 UTC
I found a fix, by hacking the Ambiance theme: https://quan.hoabinh.vn/blog/2017/6/46-fix-gitg-doesn-t-use-monospace-font-in-ubuntu
Comment 4 Alexandre Franke 2017-09-30 20:28:56 UTC
So this is actually a bug in themes that are not Adwaita, not in gitg. Closing, feel free to report to the relevant tracker for the themes that exhibit the issue.