1414
1515import itertools
1616import os
17- from pathlib import Path
17+ from os import PathLike
1818from typing import Any , Iterable , Optional , Tuple , Union
1919
2020import numpy as np
@@ -250,7 +250,7 @@ def set_default(tileset: Tileset) -> None:
250250 lib .TCOD_set_default_tileset (tileset ._tileset_p )
251251
252252
253- def load_truetype_font (path : Union [str , Path ], tile_width : int , tile_height : int ) -> Tileset :
253+ def load_truetype_font (path : Union [str , PathLike [ str ] ], tile_width : int , tile_height : int ) -> Tileset :
254254 """Return a new Tileset from a `.ttf` or `.otf` file.
255255
256256 Same as :any:`set_truetype_font`, but returns a :any:`Tileset` instead.
@@ -267,7 +267,7 @@ def load_truetype_font(path: Union[str, Path], tile_width: int, tile_height: int
267267
268268
269269@deprecate ("Accessing the default tileset is deprecated." )
270- def set_truetype_font (path : Union [str , Path ], tile_width : int , tile_height : int ) -> None :
270+ def set_truetype_font (path : Union [str , PathLike [ str ] ], tile_width : int , tile_height : int ) -> None :
271271 """Set the default tileset from a `.ttf` or `.otf` file.
272272
273273 `path` is the file path for the font file.
@@ -293,7 +293,7 @@ def set_truetype_font(path: Union[str, Path], tile_width: int, tile_height: int)
293293 raise RuntimeError (ffi .string (lib .TCOD_get_error ()))
294294
295295
296- def load_bdf (path : Union [str , Path ]) -> Tileset :
296+ def load_bdf (path : Union [str , PathLike [ str ] ]) -> Tileset :
297297 """Return a new Tileset from a `.bdf` file.
298298
299299 For the best results the font should be monospace, cell-based, and
@@ -314,7 +314,9 @@ def load_bdf(path: Union[str, Path]) -> Tileset:
314314 return Tileset ._claim (cdata )
315315
316316
317- def load_tilesheet (path : Union [str , Path ], columns : int , rows : int , charmap : Optional [Iterable [int ]]) -> Tileset :
317+ def load_tilesheet (
318+ path : Union [str , PathLike [str ]], columns : int , rows : int , charmap : Optional [Iterable [int ]]
319+ ) -> Tileset :
318320 """Return a new Tileset from a simple tilesheet image.
319321
320322 `path` is the file path to a PNG file with the tileset.
0 commit comments