-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Any use of FindFontWithLocalizedName
is broken and requires refactoring
#16943
Comments
* Since `FindFontWithLocalizedName` is broken (intentionally and temporarily until #16943 is fixed) we have to be extra be careful not to return a nullptr `Font`. * Portable builds may not have a broken font cache, but also not have the given font (Cascadia Mono for instance) installed. This requires us to load the nearby fonts even if there aren't any exceptions. ## Validation Steps Performed * Open `src/cascadia/CascadiaResources.build.items` and remove the `Condition` for .ttf files * Deploy on a clean Windows 10 VM * Cascadia Mono loads without issues ✅ * Open the `Settings > Defaults > Appearance`, enter a non-existing font and hit Save * Doesn't crash ✅
@lhecker I was told this was blocking for 1.21 - are we fine shipping 1.21 with this? |
No. I'm currently working on this issue. Technically this should be a trivial change but funneling this into XAML turns out is harder than writing the renderer lol. "Oh this doesn't have a ItemsSource you need to instantiate UI elements yourself. Oh this is only a getter, needs a manual injection. Oh you can't set Items in the Click handler or it gets unresponsive. Oh you can't have generic types in a DataTemplate, needs a custom wrapper. Oh you can't reference the VM from inside a DataTemplate. Oh…" Hilarious lol. |
FindFontWithLocalizedName
is broken and requires refactoringFindFontWithLocalizedName
is broken and requires refactoring
Due to #16821 everything about #16104 broke. This PR rights the wrongs by rewriting all the `Font`-based code to not use `Font` at all. Instead we split the font spec once into font families, do a lot of complex logic to split font axes/features into used and unused ones and construct all the UI elements. So. much. boilerplate. code. Closes #16943 ## Validation Steps Performed There are more edge cases than I can list here... Some ideas: * Edit the settings.json with invalid axis/feature keys ✅ * ...out of range values ✅ * Settings UI reloads when the settings.json changes ✅ * Adding axes/features works ✅ * Removing axes/features works ✅ * Resetting axes/features works ✅ * Axes/features apply in the renderer when saving ✅
From #16821
The text was updated successfully, but these errors were encountered: