git.lucas.co / cce-terminal
terminal emulator
git clone https://git.lucas.co/cce-terminal.git

commit4e8a7098a85443865854f1fd93e2135c6e4219bb
parent2d1641f177
authorLucas Galante <[email protected]>
date2026-08-22 23:56
fix: read the terminal family from the shared config, not fontconfig

The font came from a `terminal` alias in ~/.config/fontconfig/fonts.conf —
a cce invention squatting in fontconfig's family namespace, written there by
the settings app's Fonts page. That page is gone and the DE's families now
live in a `fonts { }` block in config.kdl, so this reads `fonts { terminal }`
via read_preferred_fonts's fourth slot instead of its old seventh.

Shadow-verified end to end: with `terminal "Berkeley Mono"` the terminal
renders monospaced; changing the key to "Circe Slab C" and relaunching moves
it to that slab serif, so the new key is genuinely the source rather than
something silently falling back.

Co-Authored-By: Claude <[email protected]>

 src/main.rs | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index 7ae1bad..8165cc1 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -24,8 +24,8 @@
 //! `~/.config/cce/cce-terminal/config.kdl` (app file wins) with `font_size`,
 //! `scrollback`, and a `colors { … }` block naming `foreground`, `background`,
 //! `cursor`, `selection`, and the 16 ANSI slots (`black` … `bright_white`)
-//! as hex strings. The font family comes from fontconfig's `terminal` alias,
-//! like the rest of the DE's font routing.
+//! as hex strings. The font family comes from the shared config's
+//! `fonts { terminal }` key, like the rest of the DE's font routing.
 //!
 //! Not yet: measured cell metrics (0.60 em / 1.2 em estimates — exact for
 //! Berkeley Mono in practice).
@@ -454,9 +454,10 @@ impl Application for TerminalApp {
         sender: calloop::channel::Sender<Self::Message>,
     ) -> Self {
         let pad = cce_ui::layout::backplate_padding();
-        // Index 6 of the preferred-fonts tuple is the `terminal` alias
-        // (~/.config/fontconfig/fonts.conf), falling back to Noto Sans Mono.
-        let font = cce_ui::layout::read_preferred_fonts().6;
+        // `.3` is the `fonts { terminal }` family (this was the 7-tuple's
+        // fontconfig `terminal` alias before the DE's fonts moved into the
+        // shared KDL config), falling back to Noto Sans Mono.
+        let font = cce_ui::layout::read_preferred_fonts().3;
         let settings = Settings::load(&font);
         let config_stamp = cce_ui::config::config_files_modified();
         let (cols, rows) = grid_dims(INIT_W as f32, INIT_H as f32, pad, &settings);