_imagingft.pyi 1.8 KB

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