|
31 | 31 | /** |
32 | 32 | * Display devices using the TFT_eSPI display library |
33 | 33 | * |
34 | | - * USER_DISPLAY(TFT_eSPIDisplay, rotation, text size, text colour, background colour, *chip select pin) |
| 34 | + * USER_DISPLAY(TFT_eSPIDisplay, rotation, text font, text colour, background colour, *chip select pin) |
35 | 35 | * |
36 | | - * Example for a single display with rotation set to 1, text size 1, white text colour, and black background colour |
37 | | - * Omit the final chip select pin parameter for a single display |
38 | | - * USER_DISPLAY(TFT_eSPIDisplay, 1, 1, TFT_WHITE, TFT_BLACK) |
| 36 | + * Example for a single display with rotation set to 1, text font FreeMono12pt7b, white text colour, and black background colour |
| 37 | + * Omit the final chip select pin parameter for a single display. |
| 38 | + * TEXT_FONT is a default font provided in the display header file and is set to FONT_TFT_ESPI_MEDIUM i.e. FreeMono12pt7b. |
| 39 | + * If a defferent font is requires substitute the font define for TEXT_FONT in the example below. |
| 40 | + * USER_DISPLAY(TFT_eSPIDisplay, 1, TEXT_FONT, TFT_WHITE, TFT_BLACK) |
39 | 41 | * |
40 | 42 | * Example for two displays as above, but specifying the chip select pin to manually switch the displays |
41 | 43 | * This is necessary as the TFT_eSPI library doesn't directly support multiple displays |
42 | | - * USER_DISPLAY(TFT_eSPIDisplay, 1, 1, TFT_WHITE, TFT_BLACK, 15) |
43 | | - * USER_DISPLAY(TFT_eSPIDisplay, 1, 1, TFT_WHITE, TFT_BLACK, 16) |
| 44 | + * USER_DISPLAY(TFT_eSPIDisplay, 1, TEXT_FONT, TFT_WHITE, TFT_BLACK, 15) |
| 45 | + * USER_DISPLAY(TFT_eSPIDisplay, 1, TEXT_FONT, TFT_WHITE, TFT_BLACK, 16) |
| 46 | + * |
| 47 | + * The available fonts that are defined for use are listed at the top of the appropriate display header file |
| 48 | + * In the case of TFT_eSPI screens that is TFT_eSPIDisplay.h. These are a selection of fonts that have been define from the |
| 49 | + * library GFXFF FreeFonts. |
| 50 | + * |
| 51 | + * If you wish to use a font that is not defined in the header file, it is possible to add an elternative (see config.example.h) |
44 | 52 | * |
45 | 53 | * Uncomment and edit one or more lines below as required for your setup. |
46 | 54 | */ |
47 | 55 |
|
48 | | -// USER_DISPLAY(TFT_eSPIDisplay, 1, 1, TFT_WHITE, TFT_BLACK) |
49 | | -// USER_DISPLAY(TFT_eSPIDisplay, 1, 1, TFT_WHITE, TFT_BLACK, 15) |
50 | | -// USER_DISPLAY(TFT_eSPIDisplay, 1, 1, TFT_WHITE, TFT_BLACK, 16) |
| 56 | +// USER_DISPLAY(TFT_eSPIDisplay, 1, TEXT_FONT, TFT_WHITE, TFT_BLACK) |
| 57 | +// USER_DISPLAY(TFT_eSPIDisplay, 1, TEXT_FONT, TFT_WHITE, TFT_BLACK, 15) |
| 58 | +// USER_DISPLAY(TFT_eSPIDisplay, 1, 1TEXT_FONT, TFT_WHITE, TFT_BLACK, 16) |
| 59 | + |
| 60 | +/** |
| 61 | +* If using multiple displays on a processor that can support this, it is possible to set a specific font for each screen. |
| 62 | +* The following three lines give an example that has been tested with three SPI displays on an ESP32. Each display is |
| 63 | +* configured with a different font from the list available. |
| 64 | +* Note that each screen has been given a different orientation. This works to a point but has a limitation imposed by the |
| 65 | +* library. Orientations 180 degrees opposed work OK, but an orientation 90 degrees to the first will not have the background |
| 66 | +* rendered correctly i.e the height and width attributes do not adjust. |
| 67 | +* If using mixed orientations its best to use 0 & 2 or 1 & 3. |
| 68 | +* |
| 69 | +* USER_DISPLAY(TFT_eSPIDisplay, 1, FONT_TFT_ESPI_SMALL, TFT_WHITE, TFT_BLACK, 12) |
| 70 | +* USER_DISPLAY(TFT_eSPIDisplay, 2, FONT_TFT_ESPI_SERIF_BOLD_ITALIC, TFT_WHITE, TFT_BLUE, 13) |
| 71 | +* USER_DISPLAY(TFT_eSPIDisplay, 3, FONT_TFT_ESPI_LARGE, TFT_WHITE, TFT_RED, 14) |
| 72 | +*/ |
51 | 73 |
|
52 | 74 | /** |
53 | 75 | * Display devices using the MCUFRIEND_kbv display library |
|
0 commit comments