我遇到了一个问题,即将某些文本的字体加粗会使其比普通字体更小。我已经发现这是因为我将TextFormattingMode设置为“显示”;如果将TextFormattingMode设置为“Ideal”,则不会出现此问题。
例如,以下代码:
<Label FontFamily="Calibri" FontSize="12" FontWeight="Bold" Content="This is some test text" TextOptions.TextFormattingMode="Ideal"/>
<Label FontFamily="Calibri" FontSize="12" Content="This is some test text" TextOptions.TextFormattingMode="Ideal"/>
<Label></Label>
<Label FontFamily="Calibri" FontSize="12" FontWeight="Bold" Content="This is some test text" TextOptions.TextFormattingMode="Display"/>
<Label FontFamily="Calibri" FontSize="12" Content="This is some test text" TextOptions.TextFormattingMode="Display"/>
产生以下结果: