forked from 1b-agent/opencadstudio-upstream
Follow the system UI font face
Detect the desktop's configured interface font and use its family for all application UI text, instead of iced's generic sans-serif. - sys::ui_font reads the setting per platform: GNOME/Cinnamon/MATE gsettings, KDE kdeglobals, Xfce xfconf, the XDG Settings portal, GTK settings.ini and a Fontconfig fallback on Linux; the non-client message font (SystemParametersInfoForDpi at 96 DPI) on Windows; the AppKit system font on macOS. - ui_font::apply remaps generic sans-serif in iced's shared font database to that family. iced's Font::DEFAULT is sans-serif, so every widget, canvas text, bold/italic variant and ribbon measurement follows it with no call-site changes. A family that is not installed (or a generic alias) keeps iced's own choice. The font's weight and style are ignored. - Live updates: portal SettingChanged on Linux, a 2 s poll on Windows. A change bumps the font-system version so laid-out text reshapes, and iced::font::set_defaults relays out every window; ribbon large-button widths re-measure. Without a portal, Linux needs a restart; macOS has no user-adjustable UI font. - Monospaced text, drawing text (own cosmic-text font systems) and the web build's font loading are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bec9e63679
commit
62175f4ed5
10 files changed
+1134
-7
No files matched your search
+3
-3
@@ -92,10 +92,10 @@ naga = { version = "27", features = ["wgsl-in"] }
|
||||
|
||||
[target.'cfg(target_os = "windows")'.dependencies]
|
||||
libloading = "0.8"
|
||||
windows-sys = { version = "0.61", features = ["Win32_UI_Shell", "Win32_UI_WindowsAndMessaging", "Win32_UI_Input", "Win32_System_LibraryLoader", "Win32_System_Threading", "Win32_Security", "Win32_System_Com", "Win32_System_Registry", "Win32_System_SystemInformation", "Win32_Storage_FileSystem", "Win32_Foundation", "Win32_Graphics_Printing", "Win32_Graphics_Gdi", "Win32_Storage_Xps", "Win32_Globalization", "Win32_Security_Authentication_Identity", "Win32_UI_Controls_Dialogs"] }
|
||||
windows-sys = { version = "0.61", features = ["Win32_UI_Shell", "Win32_UI_WindowsAndMessaging", "Win32_UI_HiDpi", "Win32_UI_Input", "Win32_System_LibraryLoader", "Win32_System_Threading", "Win32_Security", "Win32_System_Com", "Win32_System_Registry", "Win32_System_SystemInformation", "Win32_Storage_FileSystem", "Win32_Foundation", "Win32_Graphics_Printing", "Win32_Graphics_Gdi", "Win32_Storage_Xps", "Win32_Globalization", "Win32_Security_Authentication_Identity", "Win32_UI_Controls_Dialogs"] }
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
ashpd = { version = "0.13.13", default-features = false, features = ["async-io", "wayland"] }
|
||||
ashpd = { version = "0.13.13", default-features = false, features = ["async-io", "settings", "wayland"] }
|
||||
|
||||
# For `src/bin/ocs_launcher.rs` only (the .app's real CFBundleExecutable,
|
||||
# see that file for why) — already in the tree transitively via winit, pinned
|
||||
@@ -104,7 +104,7 @@ ashpd = { version = "0.13.13", default-features = false, features = ["async-io",
|
||||
objc2 = "0.5"
|
||||
# The `NSEvent`/`block2` features are for the trackpad pinch monitor in
|
||||
# `src/input/trackpad.rs` — see that file for why the gesture is read there.
|
||||
objc2-app-kit = { version = "0.2", features = ["NSApplication", "NSResponder", "NSRunningApplication", "NSEvent", "block2"] }
|
||||
objc2-app-kit = { version = "0.2", features = ["NSApplication", "NSFont", "NSResponder", "NSRunningApplication", "NSEvent", "block2"] }
|
||||
block2 = "0.5"
|
||||
objc2-foundation = { version = "0.2", features = ["NSArray", "NSURL", "NSString", "NSObject", "NSNotification", "NSThread", "NSEnumerator"] }
|
||||
|
||||
|
||||
Reference in new issue
Block a user