SDL_ttf icon indicating copy to clipboard operation
SDL_ttf copied to clipboard

Proposal: Add an API to modify the lineSkip property

Open rubenlg opened this issue 10 months ago • 0 comments

Right now, when rendering multi-line text, there is no way to control how close to each other each line will render. TTF_initFontMetrics computes a value automatically that looks good, but might not be what the developer needs (e.g. when used in situations with restricted space). CSS allows controlling this with their line-height property, for example.

The proposal would be to add a pair of new functions:

TTF_GetFontLineSkip returns the current configuration. TTF_SetFontLineSkip allows setting a new configuration.

And TTF_FontLineSkip would remain working the same as today, returning the recommended skip for a particular font, ensuring backwards compatibility.

Does this make sense?

rubenlg avatar Apr 17 '24 11:04 rubenlg