Add font picker (Segoe UI, Tahoma, Tw Cen MT, Nunito, Quicksand, Varela Round), bump to 0.1.10

Each channel window's settings panel gets a Font list, and wIRC main gets a Font
button that opens the same list for the server messages box. Every name is drawn
in its own font as a preview. The choice is saved per window in window_prefs.json
(fontId) and applies to the scrollback, user list, input box and title.

- Segoe UI, Tahoma and Tw Cen MT are Microsoft-licensed, so they aren't bundled:
  they load from the Windows font folders at runtime and are only listed when
  present (Tw Cen MT comes with Office).
- Nunito, Quicksand and Varela Round are SIL OFL fonts, bundled in
  resources/fonts with their license files.
- A missing or unloadable font falls back to Monospace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
weishaupt
2026-10-09 19:18:31 -04:00
co-authored by Claude Opus 5.5
parent 3538274805
commit efad80e141
15 changed files with 442 additions and 10 deletions
@@ -14,6 +14,7 @@ data class WindowDisplaySettings(
val backgroundAlpha: Float = 0.85f, // 0f = fully transparent, 1f = fully opaque
val textColorMircIndex: Int = 0, // index into the standard mIRC palette; 0 = white
val fontSize: Float = 14f,
val fontId: String = "monospace", // see ui/AppFonts.kt; unknown/missing ids fall back to monospace
val showUserList: Boolean = true,
val mentionHighlightColorArgb: Int = 0x40FFA500.toInt(), // translucent orange
val nickColorsEnabled: Boolean = true,
@@ -64,6 +65,8 @@ class WindowPrefsRepository(rootDir: File) {
fun setFontSize(bufferKeyId: String, fontSize: Float) = update(bufferKeyId) { it.copy(fontSize = fontSize) }
fun setFontId(bufferKeyId: String, fontId: String) = update(bufferKeyId) { it.copy(fontId = fontId) }
fun setShowUserList(bufferKeyId: String, show: Boolean) = update(bufferKeyId) { it.copy(showUserList = show) }
fun setMentionHighlightColor(bufferKeyId: String, colorArgb: Int) = update(bufferKeyId) { it.copy(mentionHighlightColorArgb = colorArgb) }
@@ -107,6 +110,7 @@ class WindowPrefsRepository(rootDir: File) {
backgroundAlpha = o.optDouble("backgroundAlpha", 0.85).toFloat(),
textColorMircIndex = o.optInt("textColorMircIndex", 0),
fontSize = o.optDouble("fontSize", 14.0).toFloat(),
fontId = o.optString("fontId", "monospace"),
showUserList = o.optBoolean("showUserList", true),
mentionHighlightColorArgb = o.optLong("mentionHighlightColorArgb", 0x40FFA500L).toInt(),
nickColorsEnabled = o.optBoolean("nickColorsEnabled", true),
@@ -138,6 +142,7 @@ class WindowPrefsRepository(rootDir: File) {
put("backgroundAlpha", settings.backgroundAlpha)
put("textColorMircIndex", settings.textColorMircIndex)
put("fontSize", settings.fontSize)
put("fontId", settings.fontId)
put("showUserList", settings.showUserList)
put("mentionHighlightColorArgb", settings.mentionHighlightColorArgb)
put("nickColorsEnabled", settings.nickColorsEnabled)