TFT_eSPI icon indicating copy to clipboard operation
TFT_eSPI copied to clipboard

Problem with printToSprite,

Open NYFB8888 opened this issue 11 months ago • 0 comments

  1. I have a problem with printToSprite function and setTextFont/loadFont functions usage.
  2. IDE Arduino
  3. TFT_eSPI library version 2.5.43
  4. Board package version 20.0.11
  5. Procesor ESP32 ESP32 S3
  6. TFT driver ILI9486
  7. Interface type SPI

Can you explain why, the printToSprite works with loadFont function but does not work with setTextFont? Many thanks

   tft.begin();
  tft.setRotation(3);
  spr.setColorDepth(16); // 16-bit colour needed to show anti-aliased fonts
  tft.fillScreen(TFT_BLACK);
  tft.setTextColor(TFT_RED, TFT_YELLOW); // Set the font colour and the background colour
  tft.setTextDatum(TL_DATUM); // Top Centre datum
  spr.setTextFont(2);             // it does not work
  //spr.loadFont(defaultFonts);   // it works
  spr.setTextColor(TFT_YELLOW, TFT_BLACK); // Set the sprite font colour and the background colour
  tft.setCursor(10,10);          // Set the tft cursor position, yes tft position!
  spr.printToSprite("123456789");    // Prints to tft cursor position, tft cursor NOT moved

NYFB8888 avatar Mar 25 '24 10:03 NYFB8888