If you ask me, getLineSpacing does exactly what it says it does: get the spacing between 2 lines. This is also what is written in the documentation: "Line spacing is the vertical offset to apply between two consecutive lines of text."
The
FreeType documentation is also very clear about its purpose:
This field is simply used to compute a default line spacing (i.e., the baseline-to-baseline distance) when writing text with this font. Note that it usually is larger than the sum of the ascender and descender taken as absolute values. There is also no guarantee that no glyphs extend above or below subsequent baselines when using this distance.
As you already noticed, this is the vertical distance between the same point within 2 identical glyphs on consecutive lines. Nothing more and nothing less. The fact that some people might end up using this metric as the line height as well isn't really getLineSpacing's fault.
I admit, there currently isn't a way to check for the true maximum height (in FreeType metrics, the global bbox) of a font without constructing a text string containing all the font's glyphs at the moment. Maybe this is what you want/need. But I have to remind you, even with such a possibility, you still rely on the font designer setting their font metrics up properly in the first place. I've seen many fonts with really broken measurements, and SFML will definitely not go out of its way to make up for all of those mistakes.
What Nexus said is also true, getLocalBounds() is the de facto way of doing what you want coupled with what I said about a string containing all supported characters within a font. But just remember, getLocalBounds() is not a Text-specific method. It works on geometry and not glyph data. It has no knowledge of a baseline/ascender/descender, so from that perspective it is also doing the right thing as it is currently implemented.
Yes... it is a bit non-trivial to get many mundane text rendering tasks done in the current state of SFML, but I am pretty sure they are all possible with a bit of thought and knowledge of the API.
aligning multiple text objects
You align multiple text objects via their baselines not the text local bounds, this is already supported albeit maybe not as trivial as one might think.
placing them relative to other objects
You can use either the baseline metric or local bounds metric here, depending on which fits your scenario best.
centering them in a UI
Since the focus is on having the same amount of empty space on all sides of the text in this case, one would use the local bounds instead of the baseline to position the text within another object.
Every now and then, people suggest exposing more font data through the API, and I'm open to features that end up being helpful in some way. Very often however, they overestimate the usefulness of some of the things they suggest because they either disregard the fact that they are not reliable 100% of the time anyway or that they simply misunderstood what the purpose of the specific metric truly is. Yes... the current "construct a string containing all glyphs to get the line height" workaround is a hack, and could be fixed by adding a method to get FreeType's global bbox value, but beyond that, I don't see anything else that really needs to be added that could be useful to users.