wpf - WPF - 是否有将字体粗细应用于 Arrial 窄/Calibri 轻字体系列的解决方法?
问题描述
对于 Arrial 窄或 Calibri light FontFamilies 看起来,WPF 不应用粗体或斜体。有什么办法可以做到这一点吗?我敢肯定还有其他 FontFamilies 有这个问题。
<FontFamily x:Key="SelectedFontFamily">Calibri light</FontFamily>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="FontFamily" Value="{StaticResource SelectedFontFamily}" />
<Setter Property="FontSize" Value="12"/>
</Style>
<StackPanel>
<TextBlock FontWeight="Thin" Text="Jackdaws love my big sphinx of quartz - Thin - 100"/>
<TextBlock FontWeight="UltraLight" Text="Jackdaws love my big sphinx of quartz - UltraLight - 200" />
<TextBlock FontWeight="ExtraLight" Text="Jackdaws love my big sphinx of quartz - ExtraLight - 200" />
<TextBlock FontWeight="Light" Text="Jackdaws love my big sphinx of quartz - Light - 300" />
<TextBlock FontWeight="Normal" Text="Jackdaws love my big sphinx of quartz - Normal - 400" />
<TextBlock FontWeight="Regular" Text="Jackdaws love my big sphinx of quartz - Regular - 400" />
<TextBlock FontWeight="Medium" Text="Jackdaws love my big sphinx of quartz - Medium - 500" />
<TextBlock FontWeight="DemiBold" Text="Jackdaws love my big sphinx of quartz - DemiBold - 600" />
<TextBlock FontWeight="SemiBold" Text="Jackdaws love my big sphinx of quartz - SemiBold - 600" />
<TextBlock FontWeight="Bold" Text="Jackdaws love my big sphinx of quartz - Bold - 700"/>
<TextBlock FontWeight="UltraBold" Text="Jackdaws love my big sphinx of quartz - UltraBold - 800" />
<TextBlock FontWeight="ExtraBold" Text="Jackdaws love my big sphinx of quartz - ExtraBold - 800" />
<TextBlock FontWeight="Heavy" Text="Jackdaws love my big sphinx of quartz - Heavy - 900" />
<TextBlock FontWeight="Black" Text="Jackdaws love my big sphinx of quartz - Black - 900" />
<TextBlock FontWeight="ExtraBlack" Text="Jackdaws love my big sphinx of quartz - ExtraBlack - 950" />
<TextBlock FontWeight="UltraBlack" Text="Jackdaws love my big sphinx of quartz - UltraBlack - 950" />
</StackPanel>
结果是:
解决方案
推荐阅读
- r - 如何使用 gganimate、sf 和 ggplot2 为空间地图上的点设置动画?
- javascript - 生成从 5 年前到现在的几个月的数组
- reactjs - React AWS Amplify 身份验证保存到联合身份和用户模型
- java - 无法通过 https 为 sonarqube 运行声纳扫描仪
- botpress - 在botpress中重新打开模拟器后无法再次输入
- c# - 如何在 Azure Function C# 中获取文件夹的路径
- django - 如何在 django admin 中为下载的文件添加自定义下载路径?
- time-complexity - 如何知道问题是否属于 conp?
- android - 将具有多个模块的 Android 库发布到 jFrog 工件时出现问题
- c# - CefSharp:如何在我们没有写权限的只读目录上处理 Cefsharp 下载