Howdy Maintainer,
In a related issue, the Gargoyle fonts aren't being found even when
searching FontConfig.
I had wanted to zoom the font size to be a bit larger. The man page
says to run `gargoyle-free -e` to edit the configuration. However, if
you do that and save the file without making changes, gargoyle will
no longer function at all. Instead, a dialog box pops up reading,
Unable to find font "Gargoyle Mono" for Mono Regular,
and fallback Gargoyle-Mono.ttf not found
As a workaround, I extracted the fonts directory from the
gargoyle-2026.1.1.tar.gz file and placed it in
~/.local/share/fonts/gargoyle/. It contains the following
files:
Gargoyle-Mono-Bold-Italic.ttf Gargoyle-Serif-Italic.ttf
Gargoyle-Mono-Bold.ttf Gargoyle-Serif.ttf
Gargoyle-Mono-Italic.ttf README
Gargoyle-Mono.ttf unifont.otf
Gargoyle-Serif-Bold-Italic.ttf unifont_upper.otf
Gargoyle-Serif-Bold.ttf
Please install the fallback fonts so that they work out of the box.
------
I am not sure if this is a good idea, but since this package already
depends on fonts-go and fonts-sil-charis, it may make sense to use
aliases in /etc/fonts/conf.d instead of duplicating the font files.
Something like this ought to work:
--------------8<----------CUT HERE--------------------8<--------------
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias binding="same">
<family>Gargoyle Serif</family>
<prefer>
<family>Charis SIL</family>
<family>serif</family>
</prefer>
</alias>
<alias binding="same">
<family>Gargoyle Mono</family>
<accept>
<family>Go Mono</family>
<family>monospace</family>
</accept>
</alias>
</fontconfig>
--------------8<----------CUT HERE--------------------8<--------------
However, gargoyle currently seems to have a odd design choice in its
FontConfig code, or possibly a bug. The problem is that it uses
FcFontList (unsorted list of results) when it should use FcFontSort
(sorted list). Even better since gargoyle only looks at the first
result anyhow, one can use FcFontMatch (just the single font that
matches the criteria best) without needing to mess with FcObjectSets.
Gargoyle could be fixed so that fontconf aliases work as expect by
patching the file garglk/fontfc.cpp like so:
--------------8<----------CUT HERE--------------------8<--------------
--- garglk/fontfc.cpp.orig 2026-02-07 20:18:56.000000000 -0800
+++ garglk/fontfc.cpp 2026-03-14 14:15:27.660518305 -0700
@@ -34,23 +34,23 @@
static nonstd::optional<std::string> findfont(const std::string &fontname)
{
FcChar8 *strval = nullptr;
+ FcResult result;
auto p = garglk::unique(FcNameParse(reinterpret_cast<const FcChar8 *>(fontname.c_str())), FcPatternDestroy);
if (p == nullptr) {
return nonstd::nullopt;
}
- auto os = garglk::unique(FcObjectSetBuild(FC_FILE, static_cast<char *>(nullptr)), FcObjectSetDestroy);
- if (os == nullptr) {
+ if (FcConfigSubstitute(cfg, p.get(), FcMatchPattern) != FcTrue) {
return nonstd::nullopt;
}
-
- auto fs = garglk::unique(FcFontList(cfg, p.get(), os.get()), FcFontSetDestroy);
- if (fs->nfont == 0) {
+ FcConfigSetDefaultSubstitute(cfg, p.get());
+ auto fpat = FcFontMatch(cfg, p.get(), &result);
+ if (result != FcResultMatch || fpat == nullptr) {
return nonstd::nullopt;
}
- if (FcPatternGetString(fs->fonts[0], FC_FILE, 0, &strval) == FcResultTypeMismatch || strval == nullptr) {
+ if (FcPatternGetString(fpat, FC_FILE, 0, &strval) == FcResultTypeMismatch || strval == nullptr) {
return nonstd::nullopt;
}
--------------8<----------CUT HERE--------------------8<--------------
Thanks,