27
27
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Display_Text.git"
28
28
29
29
try :
30
- from typing import Union , Optional
31
- from fontio import BuiltinFont
32
- from adafruit_bitmap_font .bdf import BDF
33
- from adafruit_bitmap_font .pcf import PCF
30
+ from typing import Optional
31
+ from fontio import FontProtocol
34
32
except ImportError :
35
33
pass
36
34
@@ -43,7 +41,7 @@ class ScrollingLabel(bitmap_label.Label):
43
41
in order to show the full text if it's larger than the fixed-width.
44
42
45
43
:param font: The font to use for the label.
46
- :type font : ~BuiltinFont, ~BDF, or ~PCF
44
+ :type: ~FontProtocol
47
45
:param int max_characters: The number of characters that sets the fixed-width. Default is 10.
48
46
:param str text: The full text to show in the label. If this is longer than
49
47
``max_characters`` then the label will scroll to show everything.
@@ -55,8 +53,8 @@ class ScrollingLabel(bitmap_label.Label):
55
53
# pylint: disable=too-many-arguments
56
54
def __init__ (
57
55
self ,
58
- font : Union [ BuiltinFont , BDF , PCF ] ,
59
- max_characters : Optional [ int ] = 10 ,
56
+ font : FontProtocol ,
57
+ max_characters : int = 10 ,
60
58
text : Optional [str ] = "" ,
61
59
animate_time : Optional [float ] = 0.3 ,
62
60
current_index : Optional [int ] = 0 ,
@@ -135,7 +133,7 @@ def full_text(self) -> str:
135
133
"""The full text to be shown. If it's longer than ``max_characters`` then
136
134
scrolling will occur as needed.
137
135
138
- :return string : The full text of this label.
136
+ :return str : The full text of this label.
139
137
"""
140
138
return self ._full_text
141
139
0 commit comments