UWP 中的移动视图中的字体样式不受影响 [英] Font style is not affected in Mobile view in UWP

查看:21
本文介绍了UWP 中的移动视图中的字体样式不受影响的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 windows-10 开发 windows 通用平台应用程序.我设计了我的整个应用程序,并在整个应用程序中使用了两种字体样式.1)犹他州2)拉维

I am working on windows universal platform app for windows-10.I designed my whole app and use a two font style in whole application. 1)Utsaah 2)Raavi

两种字体系列都可以在桌面和制表视图中正常工作.但是当我在模拟器(移动视图)中运行我的应用程序时,这两种字体都不会影响到我的文本块,这意味着移动初始化的默认字体所以请建议我一个解决方案.我刚刚附上了截图也代码.

both font family properly working in desktop and tablate view.But when i run my app in emulator (Mobile view) that time both fonts are not affacted to my textblock means default font of mobile initialize so please suggest me a solution . I just attached screenshot also code.

代码:

    <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>

图片:

推荐答案

这里是 UWP 应用的推荐"字体列表.

Here is a list of 'recommended' fonts for UWP apps.

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

这些字体保证可用于所有 Win10 设备系列 - 桌面、移动、物联网等.但是,Utsaah 和 Raavi 没有在列表中.

These fonts are guaranteed to be available in all Win10 device families - desktop, mobile, iot, etc. But, Utsaah and Raavi are not listed in the list.

文档说:

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

Note If you use a font that's not in this list, your app may trigger an automatic download of the font data from a Microsoft service.

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

UWP apps that will available on mobile devices should never use fonts for UI content other than fonts in this list.

不推荐.:(

这篇关于UWP 中的移动视图中的字体样式不受影响的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆