-
Notifications
You must be signed in to change notification settings - Fork 768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WASM: 'Segoe UI' not observed if UnoDefaultFont is set to None (Windows) #19636
Comments
Thanks for the report. Could you tell why you need this font to be used specifically? Note that forcing this font will not work on non-windows systems. |
Segoe UI is only used for Windows, see Fonts.css file in a default Uno.Sdk project. |
I see, thanks. On Wasm, platform specific is not particularly relevant, unless you'll use the browser agent to determine which font to load. Is that the case? |
Please see default Fonts.css:
With that style the platform-specific font is used, no code needed. For that, 'UnoDefaultFont' must be set to 'None', see Custom Fonts: Disabling Open Sans. But without overwriting WinUI/UWP resources with 'XamlAutoFontFamily' as font family the CSS is not applied, because the font family is wrongly set to "font-{random_number}". Then, in my bug case, 'Times New Roman' is used as default font family. This describes the bug in this issue. |
I see. Indeed, we changed this behavior recently so that the right fonts are set everywhere, regardless of The code that handles this part is: uno/src/Uno.UI/UI/Xaml/UIElement.TextHelper.wasm.cs Lines 80 to 99 in 676a751
Which probably would need to be changed to something else when |
Current behavior
Expected behavior
How to reproduce it (as minimally and precisely as possible)
Workaround
<wasm:FontFamily x:Key="ContentControlThemeFontFamily">Segoe UI</wasm:FontFamily>
Works on UWP/WinUI
Yes
Environment
Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia
NuGet package version(s)
No response
Affected platforms
WebAssembly
IDE
Visual Studio 2022
IDE version
No response
Relevant plugins
No response
Anything else we need to know?
No response
The text was updated successfully, but these errors were encountered: