code.py
 1  # SPDX-FileCopyrightText: 2020 Tim C, written for Adafruit Industries
 2  #
 3  # SPDX-License-Identifier: MIT
 4  """
 5  This examples shows the use custom fonts
 6  """
 7  import board
 8  import displayio
 9  import terminalio
10  from adafruit_bitmap_font import bitmap_font
11  from adafruit_display_text import label
12  
13  
14  # built-in display
15  display = board.DISPLAY
16  
17  # Make the display context
18  main_group = displayio.Group()
19  display.show(main_group)
20  
21  font = bitmap_font.load_font("fonts/LeagueSpartan-Bold-16.bdf")
22  # font = terminalio.FONT
23  
24  reg_label = label.Label(font=terminalio.FONT, text="Blinka_Displayio", scale=2)
25  reg_label.anchor_point = (0, 0)
26  reg_label.anchored_position = (20, 20)
27  
28  custom_font_lbl = label.Label(font=font, text="League Spartan", scale=1)
29  
30  custom_font_lbl.anchor_point = (0, 0)
31  custom_font_lbl.anchored_position = (20, 50)
32  
33  main_group.append(reg_label)
34  main_group.append(custom_font_lbl)
35  
36  while True:
37      pass