问题
I have a TextBlock I would like to pass a property of 'LineSpacing'. The thing with using "LineHeight" with LineStackingStrategy="BlockLineHeight" is that it also applies the LineHeight to the segment before the first line:
How can I manage to preserve said 'LineSpacing' without modifying the LineHeight before the first line?
One thing I though might work is to separate each line in a Paragraph of a FlowDocument, since the Paragraph has a property Spacing Before Line and Spacing After Line.
Any help would be truly appreciated. Thanks in advance.
ANSWER
It seems that you can use LineStackingStrategy="MaxHeight" to avoid having leading on the first line. (Check answers below for full details).
P.S. Thanks to Mitch for the revelation :D
回答1:
It seems that you can use LineStackingStrategy="MaxHeight"
to avoid having leading on the first line:
<TextBlock LineStackingStrategy="MaxHeight" TextWrapping="Wrap" LineHeight="50">Lorem...</TextBlock>
Produces
来源:https://stackoverflow.com/questions/23874453/wpf-linespacing-in-a-textblock