-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Expand file tree
/
Copy pathmathtext.pyi
More file actions
33 lines (28 loc) · 1.02 KB
/
mathtext.pyi
File metadata and controls
33 lines (28 loc) · 1.02 KB
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
import os
from typing import Generic, IO, Literal, TypeVar, overload
from matplotlib.font_manager import FontProperties
from matplotlib.typing import ColorType
# Re-exported API from _mathtext.
from ._mathtext import (
RasterParse as RasterParse,
VectorParse as VectorParse,
get_unicode_index as get_unicode_index,
)
_ParseType = TypeVar("_ParseType", RasterParse, VectorParse)
class MathTextParser(Generic[_ParseType]):
@overload
def __init__(self: MathTextParser[VectorParse], output: Literal["path"]) -> None: ...
@overload
def __init__(self: MathTextParser[RasterParse], output: Literal["agg", "raster", "macosx"]) -> None: ...
def parse(
self, s: str, dpi: float = ..., prop: FontProperties | None = ..., *, antialiased: bool | None = ...
) -> _ParseType: ...
def math_to_image(
s: str,
filename_or_obj: str | os.PathLike | IO,
prop: FontProperties | None = ...,
dpi: float | None = ...,
format: str | None = ...,
*,
color: ColorType | None = ...
) -> float: ...