@@ -74,7 +74,7 @@ class Layout(IntEnum):
7474 core = DeferredError .new (ex )
7575
7676
77- def _string_length_check (text : str | bytes | bytearray ) -> None :
77+ def _string_length_check (text : str | bytes ) -> None :
7878 if MAX_STRING_LENGTH is not None and len (text ) > MAX_STRING_LENGTH :
7979 msg = "too many characters in string"
8080 raise ValueError (msg )
@@ -101,7 +101,7 @@ class BaseImageFont(abc.ABC):
101101
102102 @abc .abstractmethod
103103 def getbbox (
104- self , text : str | bytes | bytearray , * args : Any , ** kwargs : Any
104+ self , text : str | bytes , * args : Any , ** kwargs : Any
105105 ) -> tuple [float , float , float , float ]:
106106 pass
107107
@@ -206,7 +206,7 @@ def getmask(
206206 return self .font .getmask (text , mode )
207207
208208 def getbbox (
209- self , text : str | bytes | bytearray , * args : Any , ** kwargs : Any
209+ self , text : str | bytes , * args : Any , ** kwargs : Any
210210 ) -> tuple [int , int , int , int ]:
211211 """
212212 Returns bounding box (in pixels) of given text.
@@ -221,9 +221,7 @@ def getbbox(
221221 width , height = self .font .getsize (text )
222222 return 0 , 0 , width , height
223223
224- def getlength (
225- self , text : str | bytes | bytearray , * args : Any , ** kwargs : Any
226- ) -> int :
224+ def getlength (self , text : str | bytes , * args : Any , ** kwargs : Any ) -> int :
227225 """
228226 Returns length (in pixels) of given text.
229227 This is the amount by which following text should be offset.
@@ -406,7 +404,7 @@ def getlength(
406404
407405 def getbbox (
408406 self ,
409- text : str | bytes | bytearray ,
407+ text : str | bytes ,
410408 mode : str = "" ,
411409 direction : str | None = None ,
412410 features : list [str ] | None = None ,
@@ -774,7 +772,7 @@ def getmask(
774772 return im
775773
776774 def getbbox (
777- self , text : str | bytes | bytearray , * args : Any , ** kwargs : Any
775+ self , text : str | bytes , * args : Any , ** kwargs : Any
778776 ) -> tuple [int , int , float , float ]:
779777 # TransposedFont doesn't support getmask2, move top-left point to (0, 0)
780778 # this has no effect on ImageFont and simulates anchor="lt" for FreeTypeFont
0 commit comments