Skip to content

Commit

Permalink
Added type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Nov 28, 2023
1 parent ae7958f commit 9e8edb4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/PIL/ImageFont.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
# See the README file for information on usage and redistribution.
#

from __future__ import annotations

import base64
import os
import sys
Expand Down Expand Up @@ -186,7 +188,14 @@ def getlength(self, text, *args, **kwargs):
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
Expand Down

0 comments on commit 9e8edb4

Please sign in to comment.