UWP

时间:2016-07-05 07:02:05

标签: windows xaml uwp windows-10-universal

我正在为windows-10开发Windows通用平台应用程序。我设计了我的整个应用程序并在整个应用程序中使用了两种字体样式。 1)Utsaah 2)Raavi

这两个字体系列都在桌面和平板电脑视图中正常工作。但是当我在模拟器(移动视图)中运行我的应用程序时,这两种字体都没有关联到我的文本块意味着默认字体的移动初始化所​​以请建议我一个解决方案。我刚刚附上截图也是代码。

代码:

    <Grid HorizontalAlignment="Stretch">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"></RowDefinition>
            <RowDefinition Height="auto"></RowDefinition>
            <RowDefinition Height="auto"></RowDefinition>
            <RowDefinition Height="auto"></RowDefinition>
            <RowDefinition Height="auto"></RowDefinition>
            <RowDefinition Height="auto"></RowDefinition>
            <RowDefinition Height="auto"></RowDefinition>
            <RowDefinition Height="auto"></RowDefinition>
            <RowDefinition Height="auto"></RowDefinition>
            <RowDefinition Height="auto"></RowDefinition>
            <RowDefinition Height="auto"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel x:Name="topbar" Background="#FFF4F4F4" Grid.Row="0" Grid.ColumnSpan="2">

            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Button x:Name="back_deatil_button" Grid.Column="0" Click="back_deatil_button_Click" Background="Transparent" Style="{StaticResource ButtonStyle1}">
                    <Image Source="Images/bback_icon@2x.png"  Height="25"  Stretch="Fill"></Image>
                </Button>
                <TextBlock x:Name="product_details" Grid.Column="1"  FontSize="14"   Text="PRODUCT DETAILS"  Foreground="#FFF05929" FontFamily="Raavi" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center" ></TextBlock>
            </Grid>
        </StackPanel>

        <StackPanel x:Name="product_detail" Grid.ColumnSpan="2" Margin="0,10,0,10" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center">
            <TextBlock x:Name="ProductName"  FontSize="16" FontFamily="utsaah" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Bold"></TextBlock>
        </StackPanel>
        <Image Source="Images/top_large_shhadow.png" Grid.ColumnSpan="2" Grid.Row="2"  VerticalAlignment="Top"></Image>
        <StackPanel x:Name="product_img" Grid.ColumnSpan="2" Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Top"  Height="137" Margin="40,0,54,20" Width="239">

            <Image  x:Name="ProductImage" Source="{Binding image}"  Height="137" Width="239" Margin="5"></Image>

        </StackPanel>
        <Image Source="Images/Products/top_large_shadow.png" Grid.ColumnSpan="2" Grid.Row="2" VerticalAlignment="Bottom"></Image>


        <TextBlock Text="SKU                               :" Grid.Row="3" Grid.Column="0" HorizontalAlignment="Center" FontWeight="Bold" FontFamily="Utsaah" FontSize="14"></TextBlock>
        <TextBlock x:Name="SKU"   Grid.Row="3" Grid.Column="1"  HorizontalAlignment="Left" FontFamily="Utsaah" FontSize="14"></TextBlock>
        <Image Source="Images/Products/top_large_shadow.png" Margin="0,25,0,0" Grid.ColumnSpan="2" Grid.Row="3" VerticalAlignment="Bottom"></Image>


        <TextBlock Text="Price                              :" Grid.Row="4" Grid.Column="0" HorizontalAlignment="Center" FontFamily="Utsaah" FontSize="14" FontWeight="Bold"></TextBlock>
        <TextBlock x:Name="Price"  Grid.Row="4" Grid.Column="1" HorizontalAlignment="Left" FontFamily="Utsaah" FontSize="14"></TextBlock>

        <Image Source="Images/Products/top_large_shadow.png"  Margin="0,25,0,0" Grid.ColumnSpan="2" Grid.Row="4" VerticalAlignment="Bottom"></Image>

        <TextBlock Text="Qty                                :" x:Name="RowTotalQty" FontFamily="Utsaah" FontSize="14" Grid.Row="5" Grid.Column="0" HorizontalAlignment="Center" FontWeight="Bold"></TextBlock>
        <TextBlock x:Name="TotalQty" Grid.Row="5" Grid.Column="1" HorizontalAlignment="Left" FontFamily="Utsaah" FontSize="14"></TextBlock>


        <Image Source="Images/Products/top_large_shadow.png"   Margin="0,25,0,0"  Grid.ColumnSpan="2" Grid.Row="5" VerticalAlignment="Bottom"></Image>


        <TextBlock Text="Special Price                :" x:Name="RowSpecialPrice" Grid.Row="6" Grid.Column="0" HorizontalAlignment="Center" FontFamily="Utsaah" FontSize="11"></TextBlock>
        <TextBlock x:Name="SpecialPrice" Grid.Row="6" Grid.Column="1"   HorizontalAlignment="Left" FontFamily="Utsaah" FontSize="14"></TextBlock>
        <Image Source="Images/Products/top_large_shadow.png"  Margin="0,25,0,0" Grid.ColumnSpan="2" Grid.Row="6" VerticalAlignment="Bottom" ></Image>

        <TextBlock Text="Status                           :" x:Name="RowStatus" Grid.Row="7" FontFamily="Utsaah" FontSize="14" Grid.Column="0" HorizontalAlignment="Center" FontWeight="Bold"></TextBlock>
        <TextBlock x:Name="Status" Grid.Row="7" Grid.Column="1" FontFamily="Utsaah" FontSize="14" HorizontalAlignment="Left"></TextBlock>
        <Image Source="Images/ttop_large_shadow.png"  Margin="0,25,0,0" Grid.ColumnSpan="2" Grid.Row="7" VerticalAlignment="Bottom"></Image>



        <TextBlock Text="Type                              :" FontFamily="Utsaah" x:Name="row_type" FontSize="14" Grid.Row="8" Grid.Column="0" HorizontalAlignment="Center" FontWeight="Bold"></TextBlock>
        <TextBlock x:Name="ProductType" Grid.Row="8" FontFamily="Utsaah" FontSize="14" Grid.Column="1" HorizontalAlignment="Left"></TextBlock>

        <Image Source="Imagesttop_large_shadow.png"  Margin="0,25,0,0" Grid.ColumnSpan="2" Grid.Row="8" VerticalAlignment="Bottom"></Image>

        <TextBlock Text="Associated                   :" Grid.Row="10" FontFamily="Utsaah" FontSize="14" Grid.Column="0" FontWeight="Bold" HorizontalAlignment="Center" x:Name="associated_prpduct" Visibility="Collapsed"></TextBlock>
        <TextBlock x:Name="Associated" Grid.Row="10" FontFamily="Utsaah" FontSize="14" Grid.Column="1" HorizontalAlignment="Left" TextWrapping="Wrap" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.IsVerticalRailEnabled="True"></TextBlock>

        <Image Source="Images/Products/top_large_shadow.png" x:Name="row_total_qty_shadow" Margin="0,25,0,0" Grid.ColumnSpan="2" Grid.Row="9" VerticalAlignment="Bottom"></Image>

        <TextBlock Text="Description                   :" FontFamily="Utsaah" x:Name="row_description" FontSize="14" Grid.Row="9" Grid.Column="0" HorizontalAlignment="Center"   FontWeight="Bold"></TextBlock>
        <StackPanel Grid.Column="1" Grid.Row="9" x:Name="pnl_description" Height="auto">
            <ScrollViewer  HorizontalAlignment="Stretch"  VerticalAlignment="Bottom" Height="50"  VerticalScrollBarVisibility="Auto" Margin="0,0,0,6">
                <TextBlock x:Name="Description"  FontFamily="Utsaah" FontSize="14" Grid.Column="1" TextWrapping="Wrap"   HorizontalAlignment="Stretch" Margin="0,0,10,0"></TextBlock>
            </ScrollViewer>
        </StackPanel>


    </Grid>
    <ProgressBar Name="mobile_back_loader" Visibility="Collapsed" IsIndeterminate="True" Foreground="#FFF05A2A" HorizontalAlignment="Stretch" Height="40" VerticalAlignment="Top"  Margin="0,150,0,0"  Grid.RowSpan="2"/>
</Grid>

图像:

Font screen shot of both

1 个答案:

答案 0 :(得分:1)

以下列出了推荐的&#39; UWP应用程序的字体。

字体指南 https://msdn.microsoft.com/windows/uwp/controls-and-patterns/fonts

这些字体保证可用于所有Win10设备系列 - 台式机,移动设备,iot等。 但是,Utsaah和Raavi没有列在名单中。

医生说:

  

注意如果您使用的字体不在此列表中,则您的应用可能会触发   从Microsoft服务自动下载字体数据。

  

移动设备上可用的UWP应用永远不应使用UI字体   此列表中的字体以外的内容。

不推荐。 :(