Skip to content

Symbolicon cannot be used #225

Closed
Closed

Description

@HaoLife

I set the Winjs font according to the document, but I still can't use it Symbolicon

Set:

<win:FontFamily x:Key="SymbolThemeFontFamily">Symbols</win:FontFamily>
<android:FontFamily x:Key="SymbolThemeFontFamily">ms-appx:///Assets/Fonts/winjs-symbols.ttf#Symbols</android:FontFamily>


<Style TargetType="FontIcon">
    <Setter Property="FontFamily" Value="{StaticResource SymbolThemeFontFamily}" />
</Style>

xaml:

        <Button FontSize="12" HorizontalAlignment="Stretch"  VerticalAlignment="Stretch" Padding="0,5,0,1" Background="White">
            <StackPanel Orientation="Vertical">
                <!--<FontIcon Glyph="&#xE10F;"/>-->
                <SymbolIcon Symbol="Home" />
                <TextBlock Text="home" Margin="0,3,0,0"/>
            </StackPanel>
        </Button>

        <Button  FontSize="12" HorizontalAlignment="Stretch"  VerticalAlignment="Stretch" Padding="0,5,0,1" Background="White">
            <StackPanel Orientation="Vertical">
                <FontIcon Glyph="&#xE13D;"/>
                <TextBlock Text="setting" Margin="0,3,0,0"/>
            </StackPanel>
        </Button>

FontIcon in accordance with the resources set above can take effect, but SymbolIcon will not be able to use, SymbolIcon internal Use FontIcon not valid, whether there is a way to use SymbolIcon , SymbolIcon in many places to use , such as: CommandBar

Activity

  1. jeromelaban commented on Oct 2, 2018

    @jeromelaban
    Member

    The Uno platform is in an odd position for this. Microsoft does not provide access to the Segoe Symbols font, which is used all over the place in the default templates, but provides access to the open symbols font, but the font not providing the icons at the same place... Tough choice!

    We made some changes in the Uno default templates, but if you're doing yours, you're bound to doing the same conditional XAML:

    https://github.com/nventive/Uno/blob/d4240473a05eb71acbcb698ca9af7c47a5cdd4bd/src/Uno.UI/UI/Xaml/Style/Generic/Generic.xaml#L1762

  2. added
    kind/bug
    kind/enhancement
    on Oct 2, 2018
  3. HaoLife commented on Dec 14, 2018

    @HaoLife
    Author

    @jeromelaban hi. I try other icons to solve the problem when I find that Uno now custom fonts are not available.
    Uno version 1.43.0-dev.465

    I tried to use the following fonts:

                    <FontFamily x:Key="symbols">ms-appx:///Assets/Fonts/FontAwesome.otf#FontAwesome</FontFamily>
                    <FontFamily x:Key="symbols2">ms-appx:///Assets/Fonts/SegMDL2.ttf#Segoe MDL2 Assets</FontFamily>
                    <FontFamily x:Key="SymbolThemeFontFamilye">ms-appx:///Assets/Fonts/winjs-symbols.ttf#Symbols</FontFamily>
                    <FontFamily x:Key="SymbolThemeFontFamilyd">/Assets/Fonts/winjs-symbols.ttf#Symbols</FontFamily>
                    <FontFamily x:Key="font1">ms-appx:///Assets/Fonts/OpenSans-Light.ttf#Open Sans Light</FontFamily>
    
    
    
    
            <StackPanel Orientation="Horizontal">
                <SymbolIcon Symbol="Setting"  />
                <FontIcon FontFamily="{StaticResource symbols}" Glyph="&#xf1d7;"   />
                <FontIcon FontFamily="{StaticResource symbols2}" Glyph="&#xE115;"  />
                <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE115;"  />
                <FontIcon FontFamily="{StaticResource SymbolThemeFontFamilyd}" Glyph="&#xE115;"  />
                <FontIcon FontFamily="{StaticResource SymbolThemeFontFamilye}" Glyph="&#xE115;"  />
                <FontIcon FontFamily="{StaticResource font1}" Glyph="yes" />
                <FontIcon Glyph="yes" />
            </StackPanel>
    

    It's very puzzling that only "SymbolThemeFontFamily" is in effect. I use the same font configuration as the Winjs in Uno, and I confirm that he is already in effect in the UWP.

    I was in xamarin.forms to make sure that these fonts were available, and I also have a doubt symbol why not use SEGMDL2 fonts

    https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.symbol
    Defines constants that specify a glyph from the Segoe MDL2 Assets font to use as the content of a SymbolIcon. (Instructions from the document)

  4. jeromelaban commented on Dec 14, 2018

    @jeromelaban
    Member

    This is curious indeed. On which platform are you testing this on ?

  5. HaoLife commented on Dec 14, 2018

    @HaoLife
    Author

    android

  6. HaoLife commented on Dec 26, 2018

    @HaoLife
    Author

    This problem is the wrong way to use fonts

    <not_android:FontFamily x:Key="SegoeThemeFontFamily">Segoe MDL2 Assets</not_android:FontFamily>
    <android:FontFamily x:Key="SegoeThemeFontFamily">ms-appx:///Assets/Fonts/SegMDL2.ttf#Segoe MDL2 Assets</android:FontFamily>

    iOS adds fonts through info.plist files and uses them directly with font names
    The UWP introduces fonts through the "fontfamily" Join font path and can be used at the same time through the font name
    Android is used in a similar way to the UWP, but does not seem to be used by font names

  7. added 2 commits that reference this issue on Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugkind/enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions