Uwp 如何在Uno平台上使用字体图标

Uwp 如何在Uno平台上使用字体图标,uwp,glyphicons,uno,uno-platform,Uwp,Glyphicons,Uno,Uno Platform,我正在尝试使用uno fluentui资产,如下所示。但它没有样品,我也找不到一个方法来让它工作 <Page x:Class="UnoPrism.Shared.Views.Shell" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xa

我正在尝试使用uno fluentui资产,如下所示。但它没有样品,我也找不到一个方法来让它工作

<Page
    x:Class="UnoPrism.Shared.Views.Shell"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:UnoPrism.Shared.Views"
    xmlns:prismMvvm="using:Prism.Mvvm"
    xmlns:prismRegions="using:Prism.Regions"
    prismMvvm:ViewModelLocator.AutowireViewModel="True" >

  <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <NavigationView Header="Super Barato">
            <NavigationView.MenuItems>
                <NavigationViewItem Content="Promoções">
                    <NavigationViewItem.Icon>
                        <FontIcon FontFamily="ms-appx:///Assets/Fonts/uno-fluentui-assets.ttf#" Glyph="&#xE117;"/>
                    </NavigationViewItem.Icon>
                </NavigationViewItem>
                <NavigationViewItem Content="Nova Promoção" Icon="Calendar"/>
            </NavigationView.MenuItems>
        </NavigationView>
  </Grid>
</Page>

字体文件已添加到
共享/Assets/Fonts
文件夹中。结果是一个方形图标


Uno Fluent用户界面符号字体是内置模板和样式使用的一种特殊字体

可以使用预定义的
FontFamily
资源
symbolthemfontfamily
手动引用它:

<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="&#xE117;"/>

使用资源而不是“字体路径”的优点是,它经得起未来考验,甚至与UWP兼容,UWP不使用Uno符号字体,而是使用Windows Segoe MDL2资产

如果您想在Uno平台应用程序中使用自己的自定义字体,请参见此