Should we merge this for 1.37? The advantage is that #2140 has landed in this window, so reverting it now would impact fewer users. For the rest, see above.
I believe this is stable and safe, but feel free to disagree.
I did a last minute addition, that is properly recalculate margins sizes when changing the font. This can be left out if wanted, it's not critical for the feature, and we already have a bug there that line numbers margin wasn't resized eithe: try setting a font size super small (e.g. 4pt), restart Geany (or zoom in/out), and then set a larger font size (let's say 12pt): line numbers will be cropped. So I guess it's not something common enough that people notice.