# chango.py

Test for TrueType write_font_converter.

See the write_font_converter.py program in the utils directory.

Note

This example requires the following modules:

- st7789py

- tft_config

- chango_16

- chango_32

- chango_64

     1"""
     2chango.py
     3=========
     4
     5.. figure:: ../_static/chango.jpg
     6    :align: center
     7
     8    Test for TrueType write_font_converter.
     9
    10See the :ref:`write_font_converter.py<write_font_converter>` program in the utils directory.
    11
    12.. note:: This example requires the following modules:
    13
    14  .. hlist::
    15    :columns: 3
    16
    17    - `st7789py`
    18    - `tft_config`
    19    - `chango_16`
    20    - `chango_32`
    21    - `chango_64`
    22
    23"""
    24
    25import gc
    26import chango_16 as font_16
    27import chango_32 as font_32
    28import chango_64 as font_64
    29import tft_config
    30import st7789py as st7789
    31
    32gc.collect()
    33
    34
    35def main():
    36    """ main """
    37    # enable display and clear screen
    38    tft = tft_config.config(tft_config.WIDE)
    39
    40    row = 0
    41    tft.write(font_16, "abcdefghijklmnopqrst", 0, row, st7789.RED)
    42    row += font_16.HEIGHT
    43
    44    tft.write(font_32, "abcdefghij", 0, row, st7789.GREEN)
    45    row += font_32.HEIGHT
    46
    47    tft.write(font_64, "abcd", 0, row, st7789.BLUE)
    48    row += font_64.HEIGHT
    49
    50
    51main()