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

Add info font icons #1297

Merged
merged 7 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 60 additions & 32 deletions WinUIGallery/ControlPages/DesignGuidance/IconsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:AppUIBasics"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:labs="using:CommunityToolkit.Labs.WinUI"
mc:Ignorable="d">

<Page.Resources>
Expand Down Expand Up @@ -101,45 +102,74 @@
</DataTemplate>
</Page.Resources>

<Grid HorizontalAlignment="Stretch">
<Grid HorizontalAlignment="Stretch" RowSpacing="8">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical">
<RichTextBlock>
<Paragraph>
With the release of Windows 11, <Hyperlink NavigateUri="https://learn.microsoft.com/windows/apps/design/style/segoe-fluent-icons-font">Segoe Fluent Icons Font</Hyperlink>
is the recommended symbol icon font.<LineBreak />
</Paragraph>
</RichTextBlock>
<TextBlock
Margin="0,8,0,0"
Style="{ThemeResource BodyStrongTextBlockStyle}"
Text="How do I get the font?" />
<RichTextBlock>
<Paragraph>
On Windows 11: There's nothing you need to do, the font comes with Windows.<LineBreak />
On Windows 10: The Segoe Fluent Icons is not included by default on Windows 10. You can download it <Hyperlink NavigateUri="https://learn.microsoft.com/windows/apps/design/downloads/#fonts">here</Hyperlink>
.<LineBreak />
</Paragraph>
</RichTextBlock>
<TextBlock Text="With the release of Windows 11, Segoe Fluent Icons is the recommended icon font."/>
<labs:SettingsExpander Grid.Row="1"
IsExpanded="False"
Header="Instructions on how to use Segoe Fluent Icons">
<labs:SettingsExpander.Items>
<labs:SettingsCard ContentAlignment="Left" Padding="16,8">
<RichTextBlock TextWrapping="Wrap">
<Paragraph FontWeight="SemiBold">
How to get the font
</Paragraph>
<Paragraph>
On Windows 11: There's nothing you need to do, the font comes with Windows.<LineBreak />
On Windows 10: Segoe Fluent Icons is not included by default on Windows 10. You can download it
<Hyperlink NavigateUri="https://learn.microsoft.com/windows/apps/design/downloads/#fonts">here</Hyperlink>.
</Paragraph>
</RichTextBlock>
</labs:SettingsCard>
<labs:SettingsCard ContentAlignment="Left" Padding="16,8">
<StackPanel Orientation="Vertical" Spacing="8">
<RichTextBlock TextWrapping="Wrap">
<Paragraph FontWeight="SemiBold">
How to use the font
</Paragraph>
<Paragraph>
If you don't specify a FontFamily,
or you specify a FontFamily that is not available on the system at runtime,
the <Hyperlink NavigateUri="https://learn.microsoft.com/uwp/api/windows.ui.xaml.controls.fonticon">FontIcon</Hyperlink> falls back to the default font family defined by the SymbolThemeFontFamily resource.
</Paragraph>
<Paragraph>
An icon with a 16-epx font size is the equivalent of a 16x16-epx icon, to make sizing and positioning more predictable.
For optimal appearance, use these specific sizes: 16, 20, 24, 32, 40, 48, and 64. Deviating from these font sizes could lead to less crisp or blurry outcomes.
</Paragraph>
<Paragraph>
All glyphs in Segoe Fluent Icons have the same fixed width with a consistent height and left origin point, so
<Hyperlink NavigateUri="https://learn.microsoft.com/windows/apps/design/style/segoe-fluent-icons-font#layering-and-mirroring">layering</Hyperlink> and colorization effects can be achieved by drawing glyphs directly on top of each other.
</Paragraph>
</RichTextBlock>
<controls:SampleCodePresenter
SampleType="XAML"
CodeSourceFile="Icons/FontIconSample2_xaml.txt">
</controls:SampleCodePresenter>
</StackPanel>
</labs:SettingsCard>
</labs:SettingsExpander.Items>
</labs:SettingsExpander>

<StackPanel Grid.Row="2" Spacing="8" Margin="0,24,0,0">
<TextBlock
Margin="0,8,0,0"
Style="{ThemeResource BodyStrongTextBlockStyle}"
Text="Fluent Icons Library" />
Style="{ThemeResource BodyStrongTextBlockStyle}"
Text="Fluent Icons Library" />
<AutoSuggestBox
MinWidth="304"
MaxWidth="320"
Margin="0,8,0,12"
HorizontalAlignment="Left"
PlaceholderText="Search icons"
QueryIcon="Find"
TextChanged="SearchTextBox_TextChanged" />
MinWidth="304"
MaxWidth="320"
HorizontalAlignment="Left"
PlaceholderText="Search icons"
QueryIcon="Find"
TextChanged="SearchTextBox_TextChanged" />
</StackPanel>

<controls1:SampleThemeListener
Grid.Row="1"
Grid.Row="3"
MaxHeight="600"
VerticalAlignment="Top">
<Grid
Expand Down Expand Up @@ -179,9 +209,7 @@
DataContext="{x:Bind}">
<StackPanel>
<TextBlock
Margin="0,0,0,0"
VerticalAlignment="Center"
FontSize="16"
Style="{StaticResource SubtitleTextBlockStyle}"
Text="{Binding SelectedItem.Name, Mode=OneWay}" />
<FontIcon
Expand Down
5 changes: 3 additions & 2 deletions WinUIGallery/ControlPages/DesignGuidance/TypographyPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@
</Grid.RowDefinitions>
<RichTextBlock>
<Paragraph>
Type helps provide structure and hierarchy to UI. The default font for Windows is <Hyperlink NavigateUri="https://learn.microsoft.com/windows/apps/design/downloads/#fonts">Segoe UI Variable</Hyperlink>
. Best practice is to use Regular weight for most text, use Semibold for titles. The minimum values should be 12px Regular, 14px Semibold.</Paragraph>
Type helps provide structure and hierarchy to UI. The default font for Windows is
<Hyperlink NavigateUri="https://learn.microsoft.com/windows/apps/design/downloads/#fonts">Segoe UI Variable</Hyperlink>.
Best practice is to use Regular weight for most text, use Semibold for titles. The minimum values should be 12px Regular, 14px Semibold.</Paragraph>
</RichTextBlock>
<local:ControlExample
x:Name="Example1"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<Grid>
<FontIcon Glyph="&#xEB51;" Foreground="#C72335" />
<FontIcon Glyph="&#xEB52;" />
</Grid>
4 changes: 2 additions & 2 deletions WinUIGallery/DataModel/ControlInfoData.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"HideSourceCodeAndRelatedControls": true,
"Docs": [
{
"Title": "Iconography in Windows",
"Uri": "https://learn.microsoft.com/windows/apps/design/style/iconography/overview"
"Title": "Iconography in Windows 11",
"Uri": "https://learn.microsoft.com/windows/apps/design/signature-experiences/iconography#system-icons"
},
{
"Title": "Segoe Fluent Icons font",
Expand Down
1 change: 0 additions & 1 deletion WinUIGallery/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
<BitmapIcon ShowAsMonochrome="False" UriSource="/Assets/Tiles/SmallTile-sdk.png" />
</labs:SettingsExpander.HeaderIcon>
<TextBlock
Margin="0,-2,0,0"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
IsTextSelectionEnabled="True"
Text="{x:Bind Version}" />
Expand Down
2 changes: 2 additions & 0 deletions WinUIGallery/WinUIGallery.DesktopWap.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
</ItemGroup>
<ItemGroup>
<None Remove="Assets\Tiles\GalleryIcon.ico" />
<None Remove="ControlPagesSampleCode\Icons\FontIconSample2_xaml.txt" />
<None Remove="ControlPagesSampleCode\Typography\TypographySample_xaml.txt" />
<None Remove="ControlPages\DesignGuidance\ColorsPage.xaml" />
<None Remove="ControlPages\InfoBadgePage.xaml" />
Expand Down Expand Up @@ -123,6 +124,7 @@
<Content Include="Assets\Tiles\TitlebarLogo.png" />
<Content Include="Assets\Typography.dark.png" />
<Content Include="Assets\Typography.light.png" />
<Content Include="ControlPagesSampleCode\Icons\FontIconSample2_xaml.txt" />
<Content Include="DataModel\IconsData.json" />
</ItemGroup>
<ItemGroup>
Expand Down