Windows support in SaraSuite

This commit is contained in:
sarah committed 2026-10-09 13:59:08 +02:00
1 parent 3998dfde74
commit 92033f3bf6
9 files changed
+627 -75

No files matched your search

+9 -2
View File
@@ -8,7 +8,7 @@ from typing import Callable
import flet as ft
from Core import (
AppConfig, BundledFontFamily, ChildEnvironment, ChipButtonStyle, LoadSharedSettings, Palette,
AppConfig, BundledFontFamily, ChildEnvironment, ChipButtonStyle, IsWindows, LoadSharedSettings, Palette,
SharedSettings, ThemesDir,
)
from Installer import DefaultAnswers, DefaultOptions
@@ -31,7 +31,14 @@ def _Themes() -> list[str]:
def _Fonts() -> list[str]:
"""Installed font families (fontconfig), with the bundled font first."""
"""Installed font families (fontconfig, or the registry on Windows), with
the bundled font first."""
if IsWindows:
import WindowsSupport
Families = WindowsSupport.FontFamilies()
Families.discard(BundledFontFamily)
return [BundledFontFamily] + sorted(Families, key=str.lower)
try:
Result = subprocess.run(
["fc-list", ":", "family"], capture_output=True, text=True, timeout=5, env=ChildEnvironment(),