From 5206d30000081bdaed89ca24e8e73d985ab22e5d Mon Sep 17 00:00:00 2001
From: Andrew Murray <radarhere@users.noreply.github.com>
Date: Wed, 11 Mar 2026 23:02:37 +1100
Subject: [PATCH] Use long for glyph position

---
 src/_imagingft.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: Pillow-9.5.0/src/_imagingft.c
===================================================================
--- Pillow-9.5.0.orig/src/_imagingft.c
+++ Pillow-9.5.0/src/_imagingft.c
@@ -523,9 +523,9 @@ font_getlength(FontObject *self, PyObjec
 
 static PyObject *
 font_getsize(FontObject *self, PyObject *args) {
-    int position; /* pen position along primary axis, in 26.6 precision */
-    int advanced; /* pen position along primary axis, in pixels */
-    int px, py;   /* position of current glyph, in pixels */
+    long position; /* pen position along primary axis, in 26.6 precision */
+    long advanced; /* pen position along primary axis, in pixels */
+    int px, py;    /* position of current glyph, in pixels */
     int x_min, x_max, y_min, y_max; /* text bounding box, in pixels */
     int x_anchor, y_anchor;         /* offset of point drawn at (0, 0), in pixels */
     int load_flags;                 /* FreeType load_flags parameter */
