Update TFT_eSPI to v2.5.43
This commit is contained in:
+4
-4
@@ -11,7 +11,7 @@
|
||||
This sketch uses method 3, the font characters are first plotted in a Sprite, then the
|
||||
Sprite is pushed to the screen. This method is very flexible and the Sprite can be
|
||||
created, deleted, resized as needed. To render anti-aliased fonts well the Sprite
|
||||
needs to be 16 bit. The fonts will render in 1 bit per pixel sprites but there
|
||||
needs to be 16-bit. The fonts will render in 1 bit per pixel sprites but there
|
||||
will then be no anti-aliasing. Using 1 bit per pixel Sprites is however useful
|
||||
to use the extended Unicode range in fonts on mono displays like ePaper.
|
||||
|
||||
@@ -50,7 +50,7 @@ void setup(void) {
|
||||
|
||||
tft.setRotation(1);
|
||||
|
||||
spr.setColorDepth(16); // 16 bit colour needed to show antialiased fonts
|
||||
spr.setColorDepth(16); // 16-bit colour needed to show antialiased fonts
|
||||
}
|
||||
|
||||
void loop() {
|
||||
@@ -93,7 +93,7 @@ void loop() {
|
||||
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
|
||||
// Beware: Sprites are a differerent "class" to TFT, so different fonts can be loaded
|
||||
// Beware: Sprites are a different "class" to TFT, so different fonts can be loaded
|
||||
// in the tft and sprite instances, so load the font in the class instance you use!
|
||||
// In this example this means the spr. instance.
|
||||
|
||||
@@ -181,7 +181,7 @@ void button(int x, int y, int num )
|
||||
#define IWIDTH 40
|
||||
#define IHEIGHT 25
|
||||
|
||||
// Create a 16 bit sprite 40 pixels wide, 25 high (2000 bytes of RAM needed)
|
||||
// Create a 16-bit sprite 40 pixels wide, 25 high (2000 bytes of RAM needed)
|
||||
spr.setColorDepth(16);
|
||||
spr.createSprite(IWIDTH, IHEIGHT);
|
||||
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ void setup(void) {
|
||||
|
||||
tft.setRotation(1);
|
||||
|
||||
spr.setColorDepth(16); // 16 bit colour needed to show anti-aliased fonts
|
||||
spr.setColorDepth(16); // 16-bit colour needed to show anti-aliased fonts
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
sketch in the library Tools folder. The Processing sketch can convert
|
||||
TrueType fonts in *.ttf or *.otf files.
|
||||
|
||||
The library supports 16 bit unicode characters:
|
||||
The library supports 16-bit Unicode characters:
|
||||
https://en.wikipedia.org/wiki/Unicode_font
|
||||
|
||||
The characters supported are in the in the Basic Multilingual Plane:
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ unsigned int colour = red << 11; // Colour order is RGB 5+6+5 bits each
|
||||
|
||||
void rainbow_fill()
|
||||
{
|
||||
// The colours and state are not initialised so the start colour changes each time the funtion is called
|
||||
// The colours and state are not initialised so the start colour changes each time the function is called
|
||||
|
||||
for (int i = 319; i >= 0; i--) {
|
||||
// Draw a vertical line 1 pixel wide in the selected colour
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
The library expects strings to be in UTF-8 encoded format:
|
||||
https://www.fileformat.info/info/unicode/utf8.htm
|
||||
|
||||
Creating varaibles needs to be done with care when using character arrays:
|
||||
Creating variables needs to be done with care when using character arrays:
|
||||
char c = 'µ'; // Wrong
|
||||
char bad[4] = "5µA"; // Wrong
|
||||
char good[] = "5µA"; // Good
|
||||
String okay = "5µA"; // Good
|
||||
|
||||
This is because UTF-8 characters outside the basic Latin set occupy more than
|
||||
1 byte per character! A 16 bit Unicode character occupies 3 bytes!
|
||||
1 byte per character! A 16-bit Unicode character occupies 3 bytes!
|
||||
|
||||
*/
|
||||
|
||||
@@ -89,7 +89,7 @@ void loop()
|
||||
//----------------------------------------------------------------------------
|
||||
// We can have any random mix of characters in the font
|
||||
|
||||
String test2 = "仝倀"; // Unicodes 0x4EDD, 0x5000
|
||||
String test2 = "仝倀"; // Unicode 0x4EDD, 0x5000
|
||||
|
||||
tft.loadFont(Unicode_Test_72);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user