Skip to content
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

Clarify Segoe MDL2 Assets Font Family Usage #4435

Closed
9 of 12 tasks
robloo opened this issue Oct 31, 2020 · 5 comments
Closed
9 of 12 tasks

Clarify Segoe MDL2 Assets Font Family Usage #4435

robloo opened this issue Oct 31, 2020 · 5 comments
Labels
difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/enhancement New feature or request project/text 🔤 Categorizes an issue or PR as relevant to text (TextBox, PasswordBox, TextBlock, Fonts, …)

Comments

@robloo
Copy link
Contributor

robloo commented Oct 31, 2020

What would you like to be added:

Running a previously UWP App in Uno, certain glyphs were not appearing correctly.

As a UWP-only code base, XAML such as FontFamily="Segoe MDL2 Assets" and code such as FontFamily = new FontFamily("Segoe MDL2 Assets") was throughout the source. However, even in UWP this is considered bad practice and instead UWP apps should generally use the SymbolThemeFontFamily -- fair enough. Source code was updated.

This still didn't work on Android though (and likely all other platforms). It was also necessary to specially define this resource key -- and it has to be done for each head separately considering how fonts currently work in Uno:

<android:FontFamily
    x:Key="SymbolThemeFontFamily">ms-appx:///Assets/Fonts/uno-fluentui-assets.ttf#Symbols</android:FontFamily>

So pulling it all together:

  1. Support the SymbolThemeFontFamily resource key automatically in Uno. Define this in the Uno fluent styles for every head.
  2. Modify all Uno Fluent UI styles to remove direct usage of "Segoe MDL2 Assets". This is kind-of a bug in the UWP source but within Uno it won't work correctly. (searching within https://github.com/unoplatform/uno/blob/master/src/Uno.UI.FluentTheme/themeresources.xaml returns results such as <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="&#xE8C1;" />.
  3. Update the docs to clearly recommend using SymbolThemeFontFamily

Why is this needed:

So symbol glyphs work right out-of-the-box if UWP apps correctly use SymbolThemeFontFamily

For which Platform:

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Skia
    • WPF
    • GTK (Linux)
    • Tizen
  • Windows
  • Build tasks
  • Solution Templates

Anything Else

For point number 2 above, it should also be possible to update the WinUI source directly.

@robloo robloo added kind/enhancement New feature or request triage/untriaged Indicates an issue requires triaging or verification labels Oct 31, 2020
@robloo
Copy link
Contributor Author

robloo commented Nov 1, 2020

As usual, as soon as I file an issue things start behaving :) It appears Uno does correctly support the SymbolThemeFontFamily. I'm not sure why it wasn't working originally but I assume it was a mistake on my part. Points 2 and 3 are still valid.

@robloo robloo changed the title Be Smarter about Segoe MDL2 Assets Font Family Clarify Segoe MDL2 Assets Font Family Usage Nov 1, 2020
@jeromelaban jeromelaban added project/text 🔤 Categorizes an issue or PR as relevant to text (TextBox, PasswordBox, TextBlock, Fonts, …) and removed triage/untriaged Indicates an issue requires triaging or verification labels Nov 2, 2020
@robloo
Copy link
Contributor Author

robloo commented Jan 12, 2021

Note that upstream WinUI just fixed usage of the font name directly (microsoft/microsoft-ui-xaml#3923). It is now using the symbol font resource instead. Whenever Uno applies the latest styles (likely after the Windows design refresh) this should fix the issue (except for the docs).

@MartinZikmund clarified the docs for this which may be enough: 5aa1202

@jeromelaban jeromelaban added the difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. label Feb 15, 2021
@MartinZikmund MartinZikmund added difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI and removed difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Jun 4, 2021
@robloo
Copy link
Contributor Author

robloo commented Jul 18, 2021

@MartinZikmund Are Fluent v1 styles getting updated as well with #6374? I'm still not entirely sure how Uno organizes default control styles so that's hard for me to confirm with certainty. If so, this issue can be closed as I'm sure that PR is going to get merged.

As stated, upstream WinUI fixed all default styles and is now using SymbolThemeFontFamily directly (except for a few places in UI tests). Uno will pull in all of these updates at least for Fluent 2 with the big 2.6 style updates as far as I'm aware.

@Youssef1313
Copy link
Member

Should this be closed?

@robloo
Copy link
Contributor Author

robloo commented Sep 16, 2021

Should this be closed?

Yes, I think so. With your commit to fix Fluent v1 and the release of Fluent v2 I think all instances of this have been fixed!

@robloo robloo closed this as completed Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/enhancement New feature or request project/text 🔤 Categorizes an issue or PR as relevant to text (TextBox, PasswordBox, TextBlock, Fonts, …)
Projects
None yet
Development

No branches or pull requests

4 participants