massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / Pillow / PIL / ImageFont.pyi
1 from _typeshed import StrOrBytesPath, SupportsRead
2 from typing import Any, Protocol
3 from typing_extensions import Literal
4
5 LAYOUT_BASIC: Literal[0]
6 LAYOUT_RAQM: Literal[1]
7
8 class _Font(Protocol):
9     def getmask(self, text: str | bytes, mode: str = ..., direction=..., features=...): ...
10
11 class ImageFont:
12     def getsize(self, text: str | bytes, *args, **kwargs) -> tuple[int, int]: ...
13     def getmask(self, text: str | bytes, mode: str = ..., direction=..., features=...): ...
14
15 class FreeTypeFont:
16     path: str | bytes | SupportsRead[bytes] | None
17     size: int
18     index: int
19     encoding: str
20     layout_engine: Any
21     def __init__(
22         self,
23         font: str | bytes | SupportsRead[bytes] | None = ...,
24         size: int = ...,
25         index: int = ...,
26         encoding: str = ...,
27         layout_engine: int | None = ...,
28     ) -> None: ...
29     def getname(self) -> tuple[str, str]: ...
30     def getmetrics(self) -> tuple[int, int]: ...
31     def getlength(
32         self,
33         text: str | bytes,
34         mode: str = ...,
35         direction: Literal["ltr", "rtl", "ttb"] | None = ...,
36         features: Any | None = ...,
37         language: str | None = ...,
38     ) -> int: ...
39     def getbbox(
40         self,
41         text: str | bytes,
42         mode: str = ...,
43         direction=...,
44         features=...,
45         language: str | None = ...,
46         stroke_width: int = ...,
47         anchor: str | None = ...,
48     ) -> tuple[int, int, int, int]: ...
49     def getsize(
50         self,
51         text: str | bytes,
52         direction: Literal["ltr", "rtl", "ttb"] | None = ...,
53         features: Any | None = ...,
54         language: str | None = ...,
55         stroke_width: int = ...,
56     ) -> tuple[int, int]: ...
57     def getsize_multiline(
58         self,
59         text: str | bytes,
60         direction: Literal["ltr", "rtl", "ttb"] | None = ...,
61         spacing: float = ...,
62         features: Any | None = ...,
63         language: str | None = ...,
64         stroke_width: float = ...,
65     ) -> tuple[int, int]: ...
66     def getoffset(self, text: str | bytes) -> tuple[int, int]: ...
67     def getmask(
68         self,
69         text: str | bytes,
70         mode: str = ...,
71         direction: Literal["ltr", "rtl", "ttb"] | None = ...,
72         features: Any | None = ...,
73         language: str | None = ...,
74         stroke_width: float = ...,
75         anchor: str | None = ...,
76         ink=...,
77     ): ...
78     def getmask2(
79         self,
80         text: str | bytes,
81         mode: str = ...,
82         fill=...,
83         direction: Literal["ltr", "rtl", "ttb"] | None = ...,
84         features: Any | None = ...,
85         language: str | None = ...,
86         stroke_width: float = ...,
87         anchor: str | None = ...,
88         ink=...,
89         *args,
90         **kwargs,
91     ): ...
92     def font_variant(
93         self,
94         font: str | bytes | SupportsRead[bytes] | None = ...,
95         size: int | None = ...,
96         index: int | None = ...,
97         encoding: str | None = ...,
98         layout_engine: int | None = ...,
99     ) -> FreeTypeFont: ...
100     def get_variation_names(self): ...
101     def set_variation_by_name(self, name): ...
102     def get_variation_axes(self): ...
103     def set_variation_by_axes(self, axes): ...
104
105 class TransposedFont:
106     def __init__(self, font: _Font, orientation: int | None = ...) -> None: ...
107     def getsize(self, text: str | bytes, *args, **kwargs) -> tuple[int, int]: ...
108     def getmask(self, text: str | bytes, mode: str = ..., *args, **kwargs): ...
109
110 def load(filename: StrOrBytesPath | int) -> ImageFont: ...
111 def truetype(
112     font: str | bytes | SupportsRead[bytes] | None = ...,
113     size: int = ...,
114     index: int = ...,
115     encoding: str = ...,
116     layout_engine: int | None = ...,
117 ) -> FreeTypeFont: ...
118 def load_path(filename: str | bytes) -> ImageFont: ...
119 def load_default() -> ImageFont: ...