2017-09-04 59 views
0

想象一下你对FlowDocument有以下风格。如何设置FlowDocument的FontFamily时更改段落的FontWeight?

<Style TargetType="{x:Type FlowDocument}"> 
    <Setter Property="FontFamily" Value="Segoe UI regular"/> 
    <Setter Property="FontSize" Value="16"/> 
    <Setter Property="LineHeight" Value="19"/> 
</Style> 

现在这不会因为某些原因而使其变为粗体。

<Paragraph> 
    <Bold>Is this bold?</Bold> 
</Paragraph> 

甚至这个

<Run FontWeight="Bold" Text="{DynamicResource CMMsg_7114}" /> 

请记住,如果我不设置父FontFamily和使用的默认字体两种方法都工作得很好。任何想法我怎么能解决这个问题?

+0

非常感谢! – VegaBrothers

回答

0

The FontFamily“Segoe UI Regular”不支持粗体字符。将FontFamily更改为“Segoe UI”:

<Style TargetType="{x:Type FlowDocument}"> 
    <Setter Property="FontFamily" Value="Segoe UI"/> 
    <Setter Property="FontSize" Value="16"/> 
    <Setter Property="LineHeight" Value="19"/> 
</Style>