_imagingft.pyi 1.6 KB

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