client: default config fails with Font(NoFont) on Debian and Ubuntu #362

Closed
opened 2026-09-23 04:21:02 +09:00 by natsukium · 0 comments
Owner

Found while smoking the Linux release archive (#360, PR #361) in an ubuntu:24.04 container with fonts-dejavu-core and fontconfig-config installed.

With the default configuration, felis-client fails to open with Font(NoFont). fc-match monospace on the same host resolves to DejaVu Sans Mono, so the host's fontconfig rules do resolve the generic; felis's own resolution (fontdb with its fontconfig feature, which parses the fontconfig XML itself and applies its own matching) does not, against Debian's rule set. Naming a face ([font] family = "DejaVu Sans Mono") makes the same binary paint normally.

Effect: a default-config felis is unusable on Debian and Ubuntu, and likely on other distributions whose fontconfig aliases route monospace through rules fontdb's parser does not apply. On NixOS the generic resolves, which is why nobody saw it.

The archive smoke works around it by writing that config line before the GUI step (tools/release/linux-archive-smoke.sh), and install.md names a monospace font as a host requirement. Both are stopgaps.

Options, not yet weighed:

  • resolve the generic through the host's rules by shelling out to fc-match when fontdb finds nothing (adds a runtime dependency on fontconfig's CLI);
  • carry a fallback list of well-known monospace family names tried in order when the generic resolves to nothing (DejaVu Sans Mono, Liberation Mono, Noto Sans Mono, Ubuntu Mono, Menlo, Consolas), the way font.fallback already works for symbol fonts;
  • link libfontconfig and ask it for the match (fontdb's feature was chosen to avoid that; nix/package.nix still lists fontconfig in buildInputs for no reason today).

Acceptance: a default-config felis-client opens on a stock Ubuntu 24.04 with fonts-dejavu-core installed, and the archive smoke's config workaround is removed.

Found while smoking the Linux release archive (#360, PR #361) in an `ubuntu:24.04` container with `fonts-dejavu-core` and `fontconfig-config` installed. With the default configuration, `felis-client` fails to open with `Font(NoFont)`. `fc-match monospace` on the same host resolves to DejaVu Sans Mono, so the host's fontconfig rules do resolve the generic; felis's own resolution (`fontdb` with its `fontconfig` feature, which parses the fontconfig XML itself and applies its own matching) does not, against Debian's rule set. Naming a face (`[font] family = "DejaVu Sans Mono"`) makes the same binary paint normally. Effect: a default-config felis is unusable on Debian and Ubuntu, and likely on other distributions whose fontconfig aliases route `monospace` through rules `fontdb`'s parser does not apply. On NixOS the generic resolves, which is why nobody saw it. The archive smoke works around it by writing that config line before the GUI step (`tools/release/linux-archive-smoke.sh`), and install.md names a monospace font as a host requirement. Both are stopgaps. Options, not yet weighed: - resolve the generic through the host's rules by shelling out to `fc-match` when `fontdb` finds nothing (adds a runtime dependency on fontconfig's CLI); - carry a fallback list of well-known monospace family names tried in order when the generic resolves to nothing (`DejaVu Sans Mono`, `Liberation Mono`, `Noto Sans Mono`, `Ubuntu Mono`, `Menlo`, `Consolas`), the way `font.fallback` already works for symbol fonts; - link libfontconfig and ask it for the match (fontdb's feature was chosen to avoid that; `nix/package.nix` still lists fontconfig in `buildInputs` for no reason today). Acceptance: a default-config `felis-client` opens on a stock Ubuntu 24.04 with `fonts-dejavu-core` installed, and the archive smoke's config workaround is removed.
Commenting is not possible because the repository is archived.
No description provided.