_imagingft.pyi 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. from typing import Any, Callable
  2. from . import ImageFont, _imaging
  3. class Font:
  4. @property
  5. def family(self) -> str | None: ...
  6. @property
  7. def style(self) -> str | None: ...
  8. @property
  9. def ascent(self) -> int: ...
  10. @property
  11. def descent(self) -> int: ...
  12. @property
  13. def height(self) -> int: ...
  14. @property
  15. def x_ppem(self) -> int: ...
  16. @property
  17. def y_ppem(self) -> int: ...
  18. @property
  19. def glyphs(self) -> int: ...
  20. def render(
  21. self,
  22. string: str | bytes,
  23. fill: Callable[[int, int], _imaging.ImagingCore],
  24. mode: str,
  25. dir: str | None,
  26. features: list[str] | None,
  27. lang: str | None,
  28. stroke_width: float,
  29. anchor: str | None,
  30. foreground_ink_long: int,
  31. x_start: float,
  32. y_start: float,
  33. /,
  34. ) -> tuple[_imaging.ImagingCore, tuple[int, int]]: ...
  35. def getsize(
  36. self,
  37. string: str | bytes | bytearray,
  38. mode: str,
  39. dir: str | None,
  40. features: list[str] | None,
  41. lang: str | None,
  42. anchor: str | None,
  43. /,
  44. ) -> tuple[tuple[int, int], tuple[int, int]]: ...
  45. def getlength(
  46. self,
  47. string: str | bytes,
  48. mode: str,
  49. dir: str | None,
  50. features: list[str] | None,
  51. lang: str | None,
  52. /,
  53. ) -> float: ...
  54. def getvarnames(self) -> list[bytes]: ...
  55. def getvaraxes(self) -> list[ImageFont.Axis]: ...
  56. def setvarname(self, instance_index: int, /) -> None: ...
  57. def setvaraxes(self, axes: list[float], /) -> None: ...
  58. def getfont(
  59. filename: str | bytes,
  60. size: float,
  61. index: int,
  62. encoding: str,
  63. font_bytes: bytes,
  64. layout_engine: int,
  65. ) -> Font: ...
  66. def __getattr__(name: str) -> Any: ...