diff --git a/app/monospacefontmanager.cpp b/app/monospacefontmanager.cpp index 95af0b7..e055387 100644 --- a/app/monospacefontmanager.cpp +++ b/app/monospacefontmanager.cpp @@ -33,8 +33,6 @@ void MonospaceFontManager::setFontSubstitution(const QString &family, const QStr QFont::removeSubstitutions(family); QFont::insertSubstitution(family, substitute); - - qDebug() << "Font substitution set:" << family << "->" << substitute; } void MonospaceFontManager::removeFontSubstitution(const QString &family) @@ -44,5 +42,4 @@ void MonospaceFontManager::removeFontSubstitution(const QString &family) } QFont::removeSubstitutions(family); - qDebug() << "Font substitution removed for:" << family; } diff --git a/app/qml/ApplicationSettings.qml b/app/qml/ApplicationSettings.qml index 9bed01f..6c138e6 100644 --- a/app/qml/ApplicationSettings.qml +++ b/app/qml/ApplicationSettings.qml @@ -132,11 +132,9 @@ QtObject { property var filteredFontList: ListModel {} - // Single method that updates the font list and applies changes to terminal function updateFont() { if (!fontManager.item || !fontlist) return - // Step 1: Update filtered font list filteredFontList.clear() var currentFontInList = false @@ -145,14 +143,14 @@ QtObject { var isBundled = !font.isSystemFont var isSystem = font.isSystemFont - // Filter by font source (bundled vs system) var matchesSource = (fontSource === bundled_fonts && isBundled) || (fontSource === system_fonts && isSystem) if (!matchesSource) continue - // For non-default rasterization, only show low-resolution fonts - var matchesRasterization = (rasterization === no_rasterization) || font.lowResolutionFont + var matchesRasterization = font.isSystemFont || + (rasterization === no_rasterization) || + font.lowResolutionFont if (matchesRasterization) { filteredFontList.append(font) @@ -162,12 +160,10 @@ QtObject { } } - // Step 2: If current font is not in the filtered list, select the first available font if (!currentFontInList && filteredFontList.count > 0) { fontName = filteredFontList.get(0).name } - // Step 3: Apply font to terminal var index = getIndexByName(fontName) if (index === undefined) return diff --git a/app/qml/Fonts.qml b/app/qml/Fonts.qml index 7b5c458..c470a4c 100644 --- a/app/qml/Fonts.qml +++ b/app/qml/Fonts.qml @@ -226,13 +226,14 @@ QtObject { Component.onCompleted: addSystemFonts() function addSystemFonts() { - var families = monospaceSystemFonts + var families = monospaceSystemFonts; for (var i = 0; i < families.length; i++) { if (verbose) { console.log("Adding system font: ", families[i]) } fontlist.append(convertToListElement(families[i])) } + appSettings.updateFont(); } function convertToListElement(family) {