summaryrefslogtreecommitdiffstats
path: root/venv/Lib/site-packages/pygame/font.pyi
blob: 99b539e0b97486c5778a8c06b2de0914d482cee4 (plain)
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
from typing import List, Optional, Union, Tuple, IO, Hashable, Iterable

if sys.version_info >= (3, 6):
    from os import PathLike
    AnyPath = Union[str, bytes, PathLike[str], PathLike[bytes]]
else:
    AnyPath = Union[Text, bytes]

from pygame.color import Color
from pygame.surface import Surface

_ColorValue = Union[
    Color, Tuple[int, int, int], List[int], int, Tuple[int, int, int, int]
]

def init() -> None: ...
def quit() -> None: ...
def get_init() -> bool: ...
def get_default_font() -> str: ...
def get_fonts() -> List[str]: ...
def match_font(
    name: Union[str, bytes, Iterable[Union[str, bytes]]],
    bold: Optional[Hashable] = False,
    italic: Optional[Hashable] = False
) -> str: ...
def SysFont(
    name: Union[str, bytes, Iterable[Union[str, bytes]]],
    size: int,
    bold: Optional[Hashable] = False,
    italic: Optional[Hashable] = False,
) -> Font: ...

class Font(object):

    bold: bool
    italic: bool
    underline: bool

    def __init__(self, name: Union[AnyPath, IO, None], size: int) -> None: ...
    def render(
        self,
        text: str,
        antialias: bool,
        color: _ColorValue,
        background: Optional[_ColorValue] = None,
    ) -> Surface: ...
    def size(self, text: str) -> Tuple[int, int]: ...
    def set_underline(self, value: bool) -> None: ...
    def get_underline(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: str) -> List[Tuple[int, int, int, int, int]]: ...
    def get_italic(self) -> bool: ...
    def get_linesize(self) -> int: ...
    def get_height(self) -> int: ...
    def get_ascent(self) -> int: ...
    def get_descent(self) -> int: ...