Skip to content

Commit

Permalink
Re-added TTF_GetNumFontFaces() to the API
Browse files Browse the repository at this point in the history
Closes #466
  • Loading branch information
slouken committed Jan 28, 2025
1 parent 822b4f4 commit 2052900
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
5 changes: 5 additions & 0 deletions build-scripts/SDL_migration.cocci
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@
(...)
@@
@@
- TTF_FontFaces
+ TTF_GetNumFontFaces
(...)
@@
@@
- TTF_FontFaceIsFixedWidth
+ TTF_FontIsFixedWidth
(...)
Expand Down
3 changes: 1 addition & 2 deletions docs/README-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ The following functions have been renamed:
* TTF_FontFaceFamilyName() => TTF_GetFontFamilyName()
* TTF_FontFaceIsFixedWidth() => TTF_FontIsFixedWidth()
* TTF_FontFaceStyleName() => TTF_GetFontStyleName()
* TTF_FontFaces() => TTF_GetNumFontFaces()
* TTF_FontHeight() => TTF_GetFontHeight()
* TTF_FontLineSkip() => TTF_GetFontLineSkip()
* TTF_GetFontWrappedAlign() => TTF_GetFontWrapAlignment()
Expand Down Expand Up @@ -71,7 +72,6 @@ The following functions have been renamed:

The following functions have been removed:
* TTF_ByteSwappedUNICODE()
* TTF_FontFaces() - can be retrieved from the font FT_Face, available in TTF_PROP_FONT_FACE_POINTER
* TTF_GetFontKerningSizeGlyphs() - replaced with TTF_GetGlyphKerning()
* TTF_GetFontKerningSizeGlyphs32() - replaced with TTF_GetGlyphKerning()
* TTF_MeasureText() - replaced with TTF_MeasureString()
Expand All @@ -95,7 +95,6 @@ The following functions have been removed:
* TTF_RenderUNICODE_Solid()
* TTF_RenderUNICODE_Solid_Wrapped()
* TTF_SizeUNICODE()

The following symbols have been renamed:
* TTF_WRAPPED_ALIGN_CENTER => TTF_HORIZONTAL_ALIGN_CENTER
* TTF_WRAPPED_ALIGN_LEFT => TTF_HORIZONTAL_ALIGN_LEFT
Expand Down
12 changes: 12 additions & 0 deletions include/SDL3_ttf/SDL_ttf.h
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,18 @@ typedef enum TTF_HintingFlags
*/
extern SDL_DECLSPEC void SDLCALL TTF_SetFontHinting(TTF_Font *font, TTF_HintingFlags hinting);

/**
* Query the number of faces of a font.
*
* \param font the font to query.
* \returns the number of FreeType font faces.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL_ttf 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL TTF_GetNumFontFaces(const TTF_Font *font);

/**
* Query a font's current FreeType hinter setting.
*
Expand Down
1 change: 1 addition & 0 deletions src/SDL_ttf.sym
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ SDL3_ttf_0.0.0 {
TTF_GetGPUTextEngineWinding;
TTF_GetHarfBuzzVersion;
TTF_GetNextTextSubString;
TTF_GetNumFontFaces;
TTF_GetPreviousTextSubString;
TTF_GetStringSize;
TTF_GetStringSizeWrapped;
Expand Down

0 comments on commit 2052900

Please sign in to comment.