File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -899,21 +899,24 @@ def display_text(
899
899
Defaults to 80.
900
900
:param int text_scale: Scale the size of the data lines. Scales the title as well.
901
901
Defaults to 1.
902
- :param font: The font or the path to the custom font file to use to display the text.
903
- Defaults to the built-in ``terminalio.FONT``. Custom font files must be
904
- provided as a string, e.g. ``"/Arial12.bdf"``.
902
+ :param ~FontProtocol|None font: The custom font to use to display the text. Defaults to the
903
+ built-in ``terminalio.FONT``. For more details, see:
904
+ https://docs.circuitpython.org/en/latest/shared-bindings/fontio/index.html
905
905
906
906
The following example displays a title and lines of text indicating which key is pressed,
907
907
the relative position of the rotary encoder, and whether the encoder switch is pressed.
908
908
Note that the key press line does not show up until a key is pressed.
909
909
910
910
.. code-block:: python
911
911
912
+ from adafruit_bitmap_font import bitmap_font
912
913
from adafruit_macropad import MacroPad
914
+ from displayio import Bitmap
913
915
914
916
macropad = MacroPad()
915
917
916
- text_lines = macropad.display_text(title="MacroPad Info")
918
+ custom_font = bitmap_font.load_font("/Arial12.bdf", Bitmap)
919
+ text_lines = macropad.display_text(title="MacroPad Info", font=custom_font)
917
920
918
921
while True:
919
922
key_event = macropad.keys.events.get()
You can’t perform that action at this time.
0 commit comments