chango.py

../_images/chango.png

Test for font2bitmap converter.

 1"""
 2chango.py
 3=========
 4
 5.. figure:: /_static/chango.png
 6  :align: center
 7
 8  Test for font2bitmap converter.
 9
10"""
11
12import gc9a01
13import tft_config
14
15import chango_16 as font_16
16import chango_32 as font_32
17import chango_64 as font_64
18
19
20def main():
21    """
22    Initializes and clears the screen. Writes different strings
23    using different fonts to the display.
24    """
25    # initialize display
26    tft = tft_config.config(tft_config.TALL)
27
28    # enable display and clear screen
29    tft.init()
30    tft.fill(gc9a01.BLUE)
31
32    row = 0
33
34    tft.write(font_16, "abcdefghijklmnopqrstuvwxyz", 0, row, gc9a01.WHITE, gc9a01.BLUE)
35    row += font_16.HEIGHT
36
37    tft.write(font_32, "abcdefghijklm", 0, row, gc9a01.WHITE, gc9a01.BLUE)
38    row += font_32.HEIGHT
39
40    tft.write(font_32, "nopqrstuvwxy", 0, row, gc9a01.WHITE, gc9a01.BLUE)
41    row += font_32.HEIGHT
42
43    tft.write(font_64, "abcdef", 0, row, gc9a01.WHITE, gc9a01.BLUE)
44    row += font_64.HEIGHT
45
46    tft.write(font_64, "ghijkl", 0, row, gc9a01.WHITE, gc9a01.BLUE)
47    row += font_64.HEIGHT
48
49
50main()