File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -899,21 +899,24 @@ def display_text(
899899 Defaults to 80.
900900 :param int text_scale: Scale the size of the data lines. Scales the title as well.
901901 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
905905
906906 The following example displays a title and lines of text indicating which key is pressed,
907907 the relative position of the rotary encoder, and whether the encoder switch is pressed.
908908 Note that the key press line does not show up until a key is pressed.
909909
910910 .. code-block:: python
911911
912+ from adafruit_bitmap_font import bitmap_font
912913 from adafruit_macropad import MacroPad
914+ from displayio import Bitmap
913915
914916 macropad = MacroPad()
915917
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)
917920
918921 while True:
919922 key_event = macropad.keys.events.get()
You can’t perform that action at this time.
0 commit comments