From 966089e47128a1413caedc9efe29a213e5c97d98 Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Sun, 14 Sep 2025 20:47:36 +0200 Subject: [PATCH] FontService: more mono font fixes --- Services/FontService.qml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Services/FontService.qml b/Services/FontService.qml index 64b4297..dfa12d3 100644 --- a/Services/FontService.qml +++ b/Services/FontService.qml @@ -185,10 +185,22 @@ Singleton { for (var i = 0; i < lines.length; i++) { var line = lines[i].trim() if (line && line !== "") { - // Extract font family name (remove any style info in brackets) - var familyName = line.split(',')[0].trim() - if (familyName && fontconfigMonospaceFonts.indexOf(familyName) === -1) { - fontconfigMonospaceFonts.push(familyName) + // Parse format: /path/to/font.ttf: Font Family Name:style=Style + // Extract the font family name between the colon and the style + var colonIndex = line.indexOf(':') + if (colonIndex !== -1) { + var afterColon = line.substring(colonIndex + 1).trim() + var styleIndex = afterColon.indexOf(':style=') + var familyName + if (styleIndex !== -1) { + familyName = afterColon.substring(0, styleIndex).trim() + } else { + // Fallback: if no style info, use the whole string after the colon + familyName = afterColon.trim() + } + if (familyName && fontconfigMonospaceFonts.indexOf(familyName) === -1) { + fontconfigMonospaceFonts.push(familyName) + } } } }