diff --git a/SDL_ttf.c b/SDL_ttf.c index 2fb10c03..5122de6e 100644 --- a/SDL_ttf.c +++ b/SDL_ttf.c @@ -3011,6 +3011,15 @@ int TTF_FontLineSkip(const TTF_Font *font) return font->lineskip; } +void TTF_SetFontLineSkip(TTF_Font *font, int lineskip) +{ + if (!font) { + return; + } + + font->lineskip = lineskip; +} + int TTF_GetFontKerning(const TTF_Font *font) { return font->allow_kerning; diff --git a/SDL_ttf.h b/SDL_ttf.h index 78d4110c..219a660e 100644 --- a/SDL_ttf.h +++ b/SDL_ttf.h @@ -628,15 +628,25 @@ extern DECLSPEC int SDLCALL TTF_FontAscent(const TTF_Font *font); extern DECLSPEC int SDLCALL TTF_FontDescent(const TTF_Font *font); /** - * Query the recommended spacing between lines of text for a font. + * Query the spacing between lines of text for a font. * * \param font the font to query. - * \returns the font's recommended spacing. + * \returns the font's line spacing. * * \since This function is available since SDL_ttf 2.0.12. */ extern DECLSPEC int SDLCALL TTF_FontLineSkip(const TTF_Font *font); +/** + * Set the spacing between lines of text for a font. + * + * \param font the font to modify. + * \param lineskip the new line spacing for the font. + * + * \since This function is available since SDL_ttf 2.22.0. + */ +extern DECLSPEC void SDLCALL TTF_SetFontLineSkip(TTF_Font *font, int lineskip); + /** * Query whether or not kerning is allowed for a font. *