2017-09-04 58 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>