Skip to content

Commit 241c37b

Browse files
committed
Added TTF_HINTING_INVALID
1 parent 05c25de commit 241c37b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

include/SDL3_ttf/SDL_ttf.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,8 @@ extern SDL_DECLSPEC int SDLCALL TTF_GetFontOutline(const TTF_Font *font);
558558
*/
559559
typedef enum TTF_HintingFlags
560560
{
561-
TTF_HINTING_NORMAL = 0, /**< Normal hinting applies standard grid-fitting. */
561+
TTF_HINTING_INVALID = -1,
562+
TTF_HINTING_NORMAL, /**< Normal hinting applies standard grid-fitting. */
562563
TTF_HINTING_LIGHT, /**< Light hinting applies subtle adjustments to improve rendering. */
563564
TTF_HINTING_MONO, /**< Monochrome hinting adjusts the font for better rendering at lower resolutions. */
564565
TTF_HINTING_NONE, /**< No hinting, the font is rendered without any grid-fitting. */
@@ -615,7 +616,7 @@ extern SDL_DECLSPEC int SDLCALL TTF_GetNumFontFaces(const TTF_Font *font);
615616
* - `TTF_HINTING_LIGHT_SUBPIXEL` (available in SDL_ttf 3.0.0 and later)
616617
*
617618
* \param font the font to query.
618-
* \returns the font's current hinter value.
619+
* \returns the font's current hinter value, or TTF_HINTING_INVALID if the font is invalid.
619620
*
620621
* \threadsafety It is safe to call this function from any thread.
621622
*

src/SDL_ttf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5755,7 +5755,7 @@ void TTF_SetFontHinting(TTF_Font *font, TTF_HintingFlags hinting)
57555755

57565756
TTF_HintingFlags TTF_GetFontHinting(const TTF_Font *font)
57575757
{
5758-
TTF_CHECK_FONT(font, -1);
5758+
TTF_CHECK_FONT(font, TTF_HINTING_INVALID);
57595759

57605760
if (font->ft_load_target == FT_LOAD_TARGET_LIGHT) {
57615761
if (font->render_subpixel == 0) {

0 commit comments

Comments
 (0)