Skip to content

Commit

Permalink
Added TTF_SetFontLineSkip()
Browse files Browse the repository at this point in the history
Fixes #353

(cherry picked from commit 8b9ccb6)
  • Loading branch information
slouken committed Dec 13, 2024
1 parent c39f3dd commit 4297e5f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
9 changes: 9 additions & 0 deletions SDL_ttf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 12 additions & 2 deletions SDL_ttf.h
Original file line number Diff line number Diff line change
Expand Up @@ -634,15 +634,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.
*
Expand Down

0 comments on commit 4297e5f

Please sign in to comment.