I didn’t find out how to make GtkLabel return the dimensions of the drawing area.
I hate the inexplicable top and bottom whitespace in single-line mode, which makes the size completely unmanageable.
I would like to know the technical term for this “top and bottom white space”.
I checked the wiki and only found “Ascender”, but that seems to be something completely different
If you are asking the Label to measure itself, then of course it will return the padding/margin/etc. If you don’t want those, you can probably defeat them using CSS.
As to getting the size of the text without any padding/margin, have you tried getting the Pango Layout with label.get_layout() and from there trying methods like layout.get_pixel_extents()et al.?
Do you get totally wrong values? If not, try the third parameter of pango_layout_get_pixel_extents instead of the second one. You could also use a test text with oversized characters like ‘Ä’ and look where the umlaut is placed.
After testing, only the second parameter can be used.
Although the characters may overflow the border, I want to ensure consistent line height and line spacing.