From 28beb8a9600b6e74cab454401cc94c664d90bfe5 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 29 Oct 2026 09:55:20 +0100 Subject: fonts: one font size for the desktop, with per-system overrides A settings page under Appearance > Fonts holds one pixel size for the whole desktop and an override wherever a system needs its own, saved as ~/.config/keystone/fonts.json, all in px. At scale 1 the logical DPI is 96, so a point is 4/3 px, and each system is written in its own unit: Theme.fontSize reads the json itself, so every shell follows live; qt5ct/qt6ct and the GTK settings files are edited in place, size only, plus gsettings; kitty, rofi and hyprlock read generated files under ~/.config/keystone that their configs include over designed fallbacks; the groupbar is a keystone.lua line. rofi and hyprlock are sections of designed sizes that scale together from their body text, the smallest entry, each keeping its ratio unless given its own size. The design is read from the fallbacks themselves, var(kf-..., "Family N") in the rofi files and $kf_... = N in hyprlock.conf, so a new entry appears on the page with no list to keep. With no fonts.json the page starts from what the files say, base 16 and an override per system at its current size, so the first save changes nothing; seeded to 0.01px, since 0.1 scaled rofi's 72pt glyph to 72.2. Each stepper shows px then pt in fixed columns, the system's own unit highlighted. Check: node desktop/modules/fonts/test_fonts.js Co-Authored-By: Claude Opus 5.5 --- desktop/modules/fonts/README.md | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 desktop/modules/fonts/README.md (limited to 'desktop/modules/fonts/README.md') diff --git a/desktop/modules/fonts/README.md b/desktop/modules/fonts/README.md new file mode 100644 index 0000000..b887060 --- /dev/null +++ b/desktop/modules/fonts/README.md @@ -0,0 +1,49 @@ +# fonts + +One pixel size for the desktop, in the settings window under Appearance > +Fonts, and an override wherever a system needs its own. Saved as +`~/.config/keystone/fonts.json`: + + { "base": 16, "override": { "qt": 18.67, "rofi:kf-launcher-entry": 22 } } + +Everything is stored in px. At scale 1 Wayland's logical DPI is 96 +(`gtk-xft-dpi` reads 98304, 96 * 1024), so a point is 4/3 of a pixel and +16 px is 12 pt. Each system is written in its own unit: + +| System | Written to | Unit | Seen | +| --- | --- | --- | --- | +| Quickshell | `Theme.fontSize` reads `fonts.json` itself | px | at once | +| Qt | `qt6ct.conf`, `qt5ct.conf`, `general=` and `fixed=` size field | pt | when an app starts | +| GTK | gtk-3.0 and gtk-4.0 `settings.ini`, `.gtkrc-2.0`, gsettings `font-name` | pt | at once for GTK 3 and 4 | +| kitty | `~/.config/keystone/kitty-fonts.conf`, included last by `kitty.conf`; SIGUSR1 reloads | pt | at once | +| Hyprland groupbar | `group:groupbar:font_size` line in `keystone.lua` | px | at once | +| rofi | `~/.config/keystone/rofi-fonts.rasi`, imported by udt's `common.rasi` | pt | next open | +| hyprlock | `~/.config/keystone/hyprlock-fonts.conf`, sourced by `hyprlock.conf` | pt | next lock | + +Qt and GTK files are edited in place, size only; the family stays what it +is. unified-desktop-theme's templates no longer carry those keys, so a +re-install does not undo the page. Hyprland's text is pixels +(`pango_font_description_set_absolute_size`), hyprlock's points +(`pango_font_description_set_size`). + +rofi and hyprlock are sections: sets of designed sizes that scale together. +Every rofi font in the udt files is `var(kf--, "Family N")`, +and every hyprlock label is `font_size = $kf_