[fpdf2] Make fpdf.fonts.Glyph a dataclass (#13645)

This commit is contained in:
Sebastian Rittau
2025-03-17 19:27:17 +01:00
committed by GitHub
parent 205e993b52
commit 5cd606b5ed
2 changed files with 6 additions and 8 deletions
@@ -10,3 +10,7 @@ fpdf.fonts.HarfBuzzFont
# Stubtest wants us to use Literals, but that is unreasonable.
fpdf.unicode_script.UNICODE_RANGE_TO_SCRIPT
# Ignore stubtest weirdness "fpdf.fonts.Glyph._DT is not present at runtime"
# https://github.com/python/mypy/issues/18811
fpdf.fonts.Glyph._DT
+2 -8
View File
@@ -118,19 +118,13 @@ class PDFFontDescriptor(PDFObject):
font_name: Incomplete
def __init__(self, ascent, descent, cap_height, flags, font_b_box, italic_angle, stem_v, missing_width) -> None: ...
@dataclass(order=True)
class Glyph:
glyph_id: int
unicode: tuple[Incomplete, ...]
glyph_name: str
glyph_width: int
def __hash__(self): ...
def __init__(self, glyph_id, unicode, glyph_name, glyph_width) -> None: ...
def __lt__(self, other): ...
def __gt__(self, other): ...
def __le__(self, other): ...
def __ge__(self, other): ...
__match_args__ = ("glyph_id", "unicode", "glyph_name", "glyph_width")
def __hash__(self) -> int: ...
class SubsetMap:
font: TTFFont