Skip to content

Commit ad1e2be

Browse files
authored
[fpdf2] FPDF.add_font() accepts PurePaths (#9699)
1 parent afb7704 commit ad1e2be

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

stubs/fpdf2/fpdf/fpdf.pyi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ from _typeshed import Incomplete, StrPath
33
from collections.abc import Callable, Iterable, Sequence
44
from contextlib import _GeneratorContextManager
55
from io import BytesIO
6+
from pathlib import PurePath
67
from re import Pattern
78
from typing import Any, ClassVar, NamedTuple, overload
89
from typing_extensions import Literal, TypeAlias
@@ -295,7 +296,11 @@ class FPDF:
295296
style: RenderStyle | str | None = ...,
296297
) -> None: ...
297298
def add_font(
298-
self, family: str | None = ..., style: _FontStyle = ..., fname: str | None = ..., uni: bool | Literal["DEPRECATED"] = ...
299+
self,
300+
family: str | None = None,
301+
style: _FontStyle = "",
302+
fname: str | PurePath | None = None,
303+
uni: bool | Literal["DEPRECATED"] = "DEPRECATED",
299304
) -> None: ...
300305
def set_font(self, family: str | None = ..., style: _FontStyles = ..., size: int = ...) -> None: ...
301306
def set_font_size(self, size: float) -> None: ...

0 commit comments

Comments
 (0)