Skip to content

Commit

Permalink
Properly fall back to Segoe MDL2 for our icons on Win10 (#12438)
Browse files Browse the repository at this point in the history
Segoe Fluent isn't available on Windows 10, and doesn't stealthily ship with WinUI. So if we manually set the font family to `"Segoe Fluent Icons"`, then that will just display boxes in Win10.

This instead uses the resource `"{ThemeResource SymbolThemeFontFamily}"` which will gracefully fall back on Win10.

See:
* microsoft/microsoft-ui-xaml#3745, which inspired this solution.

Guess what! The backgound image icons were also manually specifying this font, so they had to get updated too. I couldn't find any other `Segoe Fluent` references in the code.

* [x] Closes #12350
* [x] Checked Windows 11 locally
* [x] Checked Win10 (screenshots incoming from other machine)
  • Loading branch information
zadjii-msft authored Feb 8, 2022
1 parent dbb7077 commit 27a1b9d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/cascadia/TerminalSettingsEditor/Appearances.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
<x:Int32>17</x:Int32>
</ToggleButton.Tag>
<ToggleButton.Content>
<FontIcon FontFamily="Segoe Fluent Icons"
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
Glyph="&#xE744;"
RenderTransformOrigin="0.5,0.5">
<FontIcon.RenderTransform>
Expand All @@ -312,7 +312,7 @@
<x:Int32>16</x:Int32>
</ToggleButton.Tag>
<ToggleButton.Content>
<FontIcon FontFamily="Segoe Fluent Icons"
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
Glyph="&#xE745;"
RenderTransformOrigin="0.5,0.5">
<FontIcon.RenderTransform>
Expand All @@ -332,7 +332,7 @@
<x:Int32>18</x:Int32>
</ToggleButton.Tag>
<ToggleButton.Content>
<FontIcon FontFamily="Segoe Fluent Icons"
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
Glyph="&#xEA5F;"
RenderTransformOrigin="0.5,0.5">
<FontIcon.RenderTransform>
Expand All @@ -354,7 +354,7 @@
<x:Int32>1</x:Int32>
</ToggleButton.Tag>
<ToggleButton.Content>
<FontIcon FontFamily="Segoe Fluent Icons"
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
Glyph="&#xE746;" />
</ToggleButton.Content>
</ToggleButton>
Expand All @@ -369,7 +369,7 @@
<x:Int32>0</x:Int32>
</ToggleButton.Tag>
<ToggleButton.Content>
<FontIcon FontFamily="Segoe Fluent Icons"
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
Glyph="&#xF16E;" />
</ToggleButton.Content>
</ToggleButton>
Expand All @@ -384,7 +384,7 @@
<x:Int32>2</x:Int32>
</ToggleButton.Tag>
<ToggleButton.Content>
<FontIcon FontFamily="Segoe Fluent Icons"
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
Glyph="&#xEA61;" />
</ToggleButton.Content>
</ToggleButton>
Expand All @@ -401,7 +401,7 @@
<x:Int32>33</x:Int32>
</ToggleButton.Tag>
<ToggleButton.Content>
<FontIcon FontFamily="Segoe Fluent Icons"
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
Glyph="&#xE744;" />
</ToggleButton.Content>
</ToggleButton>
Expand All @@ -416,7 +416,7 @@
<x:Int32>32</x:Int32>
</ToggleButton.Tag>
<ToggleButton.Content>
<FontIcon FontFamily="Segoe Fluent Icons"
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
Glyph="&#xE745;" />
</ToggleButton.Content>
</ToggleButton>
Expand All @@ -431,7 +431,7 @@
<x:Int32>34</x:Int32>
</ToggleButton.Tag>
<ToggleButton.Content>
<FontIcon FontFamily="Segoe Fluent Icons"
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
Glyph="&#xEA5F;" />
</ToggleButton.Content>
</ToggleButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
TargetType="FontIcon">
<Setter Property="Foreground" Value="{StaticResource SystemAccentColor}" />
<Setter Property="FontSize" Value="11" />
<Setter Property="FontFamily" Value="Segoe Fluent Icons" />
<Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" />
</Style>

<Style x:Key="NonExpanderGrid"
Expand Down

0 comments on commit 27a1b9d

Please sign in to comment.