Skip to content

Commit

Permalink
Added TTF_SetFontLineSkip()
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Sep 27, 2024
1 parent 105a69d commit b229fa3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
14 changes: 13 additions & 1 deletion include/SDL3_ttf/SDL_ttf.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ extern SDL_DECLSPEC int SDLCALL TTF_GetFontAscent(const TTF_Font *font);
extern SDL_DECLSPEC int SDLCALL TTF_GetFontDescent(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.
Expand All @@ -522,6 +522,18 @@ extern SDL_DECLSPEC int SDLCALL TTF_GetFontDescent(const TTF_Font *font);
*/
extern SDL_DECLSPEC int SDLCALL TTF_GetFontLineSkip(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.
*
* \threadsafety This function should be called on the thread that created the font.
*
* \since This function is available since SDL_ttf 3.0.0.
*/
extern SDL_DECLSPEC void SDLCALL TTF_SetFontLineSkip(TTF_Font *font, int lineskip);

/**
* Query whether or not kerning is enabled for a font.
*
Expand Down
7 changes: 7 additions & 0 deletions src/SDL_ttf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2788,6 +2788,13 @@ int TTF_GetFontLineSkip(const TTF_Font *font)
return font->lineskip;
}

void TTF_SetFontLineSkip(TTF_Font *font, int lineskip)
{
TTF_CHECK_FONT(font,);

font->lineskip = lineskip;
}

bool TTF_GetFontKerning(const TTF_Font *font)
{
TTF_CHECK_FONT(font, false);
Expand Down
1 change: 1 addition & 0 deletions src/SDL_ttf.sym
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ SDL3_ttf_0.0.0 {
TTF_SetFontHinting;
TTF_SetFontKerning;
TTF_SetFontLanguage;
TTF_SetFontLineSkip;
TTF_SetFontOutline;
TTF_SetFontSDF;
TTF_SetFontScriptName;
Expand Down

0 comments on commit b229fa3

Please sign in to comment.