forked from matplotlib/matplotlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdviread.pyi
More file actions
107 lines (94 loc) · 2.62 KB
/
Copy pathdviread.pyi
File metadata and controls
107 lines (94 loc) · 2.62 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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import dataclasses
from pathlib import Path
import io
import os
from enum import Enum
from collections.abc import Generator
from typing import NamedTuple
from typing_extensions import Self # < Py 3.11
class _dvistate(Enum):
pre = ...
outer = ...
inpage = ...
post_post = ...
finale = ...
class Page(NamedTuple):
text: list[Text]
boxes: list[Box]
height: int
width: int
descent: int
class Box(NamedTuple):
x: int
y: int
height: int
width: int
class Text(NamedTuple):
x: int
y: int
font: DviFont
glyph: int
width: int
@property
def font_path(self) -> Path: ...
@property
def font_size(self) -> float: ...
@property
def font_effects(self) -> dict[str, float]: ...
@property
def index(self) -> int: ... # type: ignore[override]
@property
def glyph_name_or_index(self) -> int | str: ...
class Dvi:
file: io.BufferedReader
dpi: float | None
fonts: dict[int, DviFont]
state: _dvistate
def __init__(self, filename: str | os.PathLike, dpi: float | None) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(self, etype, evalue, etrace) -> None: ...
def __iter__(self) -> Generator[Page, None, None]: ...
def close(self) -> None: ...
class DviFont:
texname: bytes
size: float
def __init__(
self, scale: float, tfm: Tfm, texname: bytes, vf: Vf | None
) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
@property
def widths(self) -> list[int]: ...
@property
def fname(self) -> str: ...
class Vf(Dvi):
def __init__(self, filename: str | os.PathLike) -> None: ...
def __getitem__(self, code: int) -> Page: ...
@dataclasses.dataclass(frozen=True, kw_only=True)
class TexMetrics:
tex_width: int
tex_height: int
tex_depth: int
# work around mypy not respecting kw_only=True in stub files
__match_args__ = ()
class Tfm:
checksum: int
design_size: int
def __init__(self, filename: str | os.PathLike) -> None: ...
def get_metrics(self, idx: int) -> TexMetrics | None: ...
@property
def width(self) -> dict[int, int]: ...
@property
def height(self) -> dict[int, int]: ...
@property
def depth(self) -> dict[int, int]: ...
class PsFont(NamedTuple):
texname: bytes
psname: bytes
effects: dict[str, float]
encoding: None | bytes
filename: str
class PsfontsMap:
def __new__(cls, filename: str | os.PathLike) -> Self: ...
def __getitem__(self, texname: bytes) -> PsFont: ...
def find_tex_file(filename: str | os.PathLike) -> str: ...