-
-
Notifications
You must be signed in to change notification settings - Fork 176
/
Copy pathfont.pyi
93 lines (87 loc) · 3.11 KB
/
font.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
from collections.abc import Callable, Hashable, Iterable
from typing import Literal, Optional, Union
from typing_extensions import deprecated # added in 3.13
from pygame.surface import Surface
from pygame.typing import ColorLike, FileLike
# TODO: Figure out a way to type this attribute such that mypy knows it's not
# always defined at runtime
UCS4: Literal[1]
def init() -> None: ...
def quit() -> None: ...
def get_init() -> bool: ...
def get_sdl_ttf_version(linked: bool = True) -> tuple[int, int, int]: ...
def get_default_font() -> str: ...
def get_fonts() -> list[str]: ...
def match_font(
name: Union[str, bytes, Iterable[Union[str, bytes]]],
bold: Hashable = False,
italic: Hashable = False,
) -> str: ...
def SysFont(
name: Union[str, bytes, Iterable[Union[str, bytes]], None],
size: int,
bold: Hashable = False,
italic: Hashable = False,
constructor: Optional[Callable[[Optional[str], int, bool, bool], Font]] = None,
) -> Font: ...
class Font:
@property
def name(self) -> str: ...
@property
def style_name(self) -> str: ...
@property
def bold(self) -> bool: ...
@bold.setter
def bold(self, value: bool) -> None: ...
@property
def italic(self) -> bool: ...
@italic.setter
def italic(self, value: bool) -> None: ...
@property
def underline(self) -> bool: ...
@underline.setter
def underline(self, value: bool) -> None: ...
@property
def strikethrough(self) -> bool: ...
@strikethrough.setter
def strikethrough(self, value: bool) -> None: ...
@property
def align(self) -> int: ...
@align.setter
def align(self, value: int) -> None: ...
@property
def point_size(self) -> int: ...
@point_size.setter
def point_size(self, value: int) -> None: ...
def __init__(self, filename: Optional[FileLike] = None, size: int = 20) -> None: ...
def render(
self,
text: Union[str, bytes, None],
antialias: bool,
color: ColorLike,
bgcolor: Optional[ColorLike] = None,
wraplength: int = 0,
) -> Surface: ...
def size(self, text: Union[str, bytes], /) -> tuple[int, int]: ...
def set_underline(self, value: bool, /) -> None: ...
def get_underline(self) -> bool: ...
def set_strikethrough(self, value: bool, /) -> None: ...
def get_strikethrough(self) -> bool: ...
def set_bold(self, value: bool, /) -> None: ...
def get_bold(self) -> bool: ...
def set_italic(self, value: bool, /) -> None: ...
def metrics(
self, text: Union[str, bytes], /
) -> list[tuple[int, int, int, int, int]]: ...
def get_italic(self) -> bool: ...
def get_linesize(self) -> int: ...
def set_linesize(self, linesize: int, /) -> None: ...
def get_height(self) -> int: ...
def get_ascent(self) -> int: ...
def get_descent(self) -> int: ...
def set_script(self, script_code: str, /) -> None: ...
def set_direction(self, direction: int) -> None: ...
def get_point_size(self) -> int: ...
def set_point_size(self, val: int, /) -> None: ...
@deprecated("Use `Font` instead (FontType is an old alias)")
class FontType(Font): ...