SDL_ttf: Added TTF_HINTING_INVALID (b72a7)

From b72a75197c09c5c0b1f151b74fcbdc24b6f4e6b7 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 20 Mar 2025 08:05:10 -0700
Subject: [PATCH] Added TTF_HINTING_INVALID

(cherry picked from commit 241c37b7eae0f87133213c65cfd986ad7887f923)
---
 include/SDL3_ttf/SDL_ttf.h | 5 +++--
 src/SDL_ttf.c              | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/SDL3_ttf/SDL_ttf.h b/include/SDL3_ttf/SDL_ttf.h
index 8374bf27..3d2e305c 100644
--- a/include/SDL3_ttf/SDL_ttf.h
+++ b/include/SDL3_ttf/SDL_ttf.h
@@ -558,7 +558,8 @@ extern SDL_DECLSPEC int SDLCALL TTF_GetFontOutline(const TTF_Font *font);
  */
 typedef enum TTF_HintingFlags
 {
-    TTF_HINTING_NORMAL = 0,     /**< Normal hinting applies standard grid-fitting. */
+    TTF_HINTING_INVALID = -1,
+    TTF_HINTING_NORMAL,         /**< Normal hinting applies standard grid-fitting. */
     TTF_HINTING_LIGHT,          /**< Light hinting applies subtle adjustments to improve rendering. */
     TTF_HINTING_MONO,           /**< Monochrome hinting adjusts the font for better rendering at lower resolutions. */
     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);
  * - `TTF_HINTING_LIGHT_SUBPIXEL` (available in SDL_ttf 3.0.0 and later)
  *
  * \param font the font to query.
- * \returns the font's current hinter value.
+ * \returns the font's current hinter value, or TTF_HINTING_INVALID if the font is invalid.
  *
  * \threadsafety It is safe to call this function from any thread.
  *
diff --git a/src/SDL_ttf.c b/src/SDL_ttf.c
index 0cdb7541..6463ab01 100644
--- a/src/SDL_ttf.c
+++ b/src/SDL_ttf.c
@@ -5755,7 +5755,7 @@ void TTF_SetFontHinting(TTF_Font *font, TTF_HintingFlags hinting)
 
 TTF_HintingFlags TTF_GetFontHinting(const TTF_Font *font)
 {
-    TTF_CHECK_FONT(font, -1);
+    TTF_CHECK_FONT(font, TTF_HINTING_INVALID);
 
     if (font->ft_load_target == FT_LOAD_TARGET_LIGHT) {
         if (font->render_subpixel == 0) {