microsoft / microsoft/microsoft-ui-xaml
Segoe Fluent Icon unable to render when using binding on Windows 10
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
So on Windows 10, we cannot package Segoe Fluent Icon font directly in the package. So I wrote a font downloader which download and extract the font to application local folder. Then I update the `FontFamily`. But it seems that using `{x:Bind}` to bind to `FontFamily` will have issues rendering on windows 10. It renders as a block character. Directly setting `FontFamily` in xaml have no such issues.
### Steps to reproduce the bug
1. Create a new WinUI3 Packaged project
2. Use this xaml
```xml
```
Code behind
```cpp
winrt::Microsoft::UI::Xaml::Media::FontFamily GlyphsPage::FluentIconFont()
{
return winrt::Microsoft::UI::Xaml::Media::FontFamily{
std::format(L"{}\\Segoe Fluent Icons.ttf#Segoe Fluent Icons", winrt::Windows::Storage::ApplicationData::Current().LocalFolder().Path())
};
}
winrt::Microsoft::UI::Xaml::Media::FontFamily GlyphsPage::MDLIconFont()
{
return winrt::Microsoft::UI::Xaml::Media::FontFamily{
std::format(L"{}\\segmdl2.ttf#Segoe MDL2 Assets", winrt::Windows::Storage::ApplicationData::Current().LocalFolder().Path())
};
}
```
3. Download and extract `Segoe Fluent Icons.ttf` to `AppData\Local\Packages\{...id...}\LocalState`
4. Build and run
### Expected behavior
_No response_
### Screenshots

### NuGet package version
WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002
### Windows version
Windows 10 (1809): Build 17763
### Additional context
_No response_
Contributor guide
Research direction
Reproduce the issue in a new WinUI 3 Packaged project on Windows 10 using the shown XAML and the GlyphsPage::FluentIconFont and MDLIconFont properties. Compare the direct FontFamily values with the {x:Bind} values for the two local fonts. Done means the bound Segoe Fluent Icons font renders the glyph instead of a block character.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100