Added type hint

This commit is contained in:
Andrew Murray 2023-11-28 21:18:58 +11:00
parent ae7958fa8d
commit 9e8edb42b6

View File

@ -25,6 +25,8 @@
# See the README file for information on usage and redistribution.
#
from __future__ import annotations
import base64
import os
import sys
@ -186,7 +188,14 @@ class ImageFont:
class FreeTypeFont:
"""FreeType font wrapper (requires _imagingft service)"""
def __init__(self, font=None, size=10, index=0, encoding="", layout_engine=None):
def __init__(
self,
font: bytes | str | Path | None = None,
size: float = 10,
index: int = 0,
encoding: str = "",
layout_engine: int = None,
) -> None:
# FIXME: use service provider instead
self.path = font