2

In the file ~/.config/fontconfig/fonts.conf i have set monospace to DejaVuSansMono:

<alias>
  <family>monospace</family>
  <prefer><family>DejaVuSansMono</family></prefer>
</alias>

GTK applications (like the text editor Pluma) respect this setting and if I select the font Monospace I get DejaVu Sans Mono. In the Qt application TortoiseHg Workbench, however, the font Monospace is associated with Courier:

enter image description here

Here are the font settings in TortoiseHg:

enter image description here

Where do Qt applications retrieve their font associations from?

I can set the font in TortoiseHg to DejaVu Sans Mono but I believe it would be more advantageous to address the underlying issue so that DejaVu Sans Mono becomes the monospace font for all Qt applications. Do you have any suggestions?

I run Debian 12 and TortoiseHg version 6.3.1 which is built with Qt-5.15.8.

Edit: Before I installed the package ttf-mscorefonts-installer, DejaVu Sans Mono was the font associated with Monospace in TortoiseHg.

8
  • 1
    What is output from fc-match "monospace"?
    – memchr
    Jul 4, 2023 at 10:39
  • That's a useful command. The output is DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book". Apparently, TortoiseHg is not using this font association. Jul 5, 2023 at 13:23
  • 1
    It's wired. Your fontconfig has worked as intended. Do all other Qt applications behave the same way?
    – memchr
    Jul 5, 2023 at 15:17
  • Can you show the output from python -c "from PyQt5.QtGui import QFontDatabase; from PyQt5.QtWidgets import QApplication; app = QApplication([]); print(QFontDatabase.systemFont(QFontDatabase.FixedFont).family())" ? Of course you'll need python package PyQt5, but chances are it's already installed.
    – memchr
    Jul 5, 2023 at 15:36
  • @memchr The output from the command is monospace. Jul 6, 2023 at 12:27

2 Answers 2

1

This turned out to be a bug in TortoiseHg:

https://foss.heptapod.net/mercurial/tortoisehg/thg/-/issues/5911

The obvious workaround is to (explicitly) set the fonts to DejaVu Sans Mono in the TortoiseHg font settings.

0

Install and run qt5ct, or you can directly edit ~/.config/qt5ct/qt5ct.conf.

1
  • I installed qt5ct and set Fonts -> Fixed width to "Monospace 10" but the monospace font in TortoiseHg is still Courier (even after restarting X11). Jul 4, 2023 at 9:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .