By default a WPF TextBlock
seems to have additional top and bottom padding applied. I wish this wasn\'t so.
I\'ve tried setting negative paddin
This space is not padding, but part of the font, reserved for accents above and below characters.
The accepted answer makes the line height smaller than the font height.
Some research and H.B. guided me to the right answer, which is setting the following properties:
<TextBlock LineStackingStrategy="BlockLineHeight"
LineHeight="20"/> <!-- Or some other value you fancy. -->
This is probably part of the font which is Segoe UI
by default, try Segoe
instead for example. (You cannot assign negative padding but you could assign negative Margins
, e.g.: Margin="0,-3,0,0"
)