Open kuiperzone opened 1 month ago
On second thoughts, I wonder if the correct behaviour is that LineSpacing should refer to line-spacing BETWEEN LINES. In other words, it should indeed align to the Top, but should should have zero spacing at the bottom line.
See the screenshot which shows a test output of mine. The LineSpacing is 1.2 (16 1.2 px), except for one item which is 2.0 (16 2.0 px). You can see that it bottom pads everything, which I don't think is best.
So you think we should add the spacing to the top instead of the bottom?
No, only between lines, so the Top and bottom would be 0. Think it appropriate to define what is meant by LineSpacing and the difference between it and the behaviour of LineHeight. It might be worth seeing what CSS does.
It looks like there is only a CSS "line-height", which you already appear to handle in the same way CSS does as per Ref https://github.com/AvaloniaUI/Avalonia/issues/13873
So I guess you are free to do whatever you wish with LineSpacing, including leaving it as it is. However, if you agree, I would suggest that it refers to the space between lines.
PS. I noted there doesn't appear to be a LineSpacing in WPF. I quite like LineSpacing because it should handle text with different font-sizes well, whereas LineHeight does not.
Currently, we add extra space to the bottom of a text line. We can do the opposite but must leave out the first line. This is doable.
Thank you for your replies.
I realise now that this issue needs a little thought. Your LineHeight property is analogous to the CSS line-height, except that it handles only pixels. I think LineSpacing is actually quite useful, but it wasn't immediately clear what this is and how it differs to LineHeight. I guess I should leave it is an open question as to what it should do in terms of top-bottom spacing, but don't think it should pad just the bottom line as does currently. Either it should behave like LineHeight, or pad only between lines. Are there any use cases which would prefer one above the other? Either would be acceptable, on reflection.
Describe the bug
Ref #13873
It seems that the problem remains with LineSpacing, rather than LineHeight.
See screenshots.
To Reproduce
Expected behavior
LineSpacing behaves sames as LineHeight with regard vertical alignment
Avalonia version
11.1.3
OS
Linux
Additional context
No response