Skip to content

Commit

Permalink
update todo and wish list
Browse files Browse the repository at this point in the history
  • Loading branch information
moononournation committed Feb 24, 2022
1 parent f8aeaf9 commit 69bfcbc
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 8 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Most tiny displays in hobbyist electronics world support 8-bit SPI, but some req

Larger displays most likely do not support standalone SPI since it is not fast enough to refresh the full screen details. Most of them support 8-bit/16-bit Parallel interface.

Some larger display require 3-bit SPI + RGB combo interface, i.e. require more than 3 + 24 pins. Most dev board do not have enough GPIO to support this. Arduino_GFX will eventually support this combo interface but will be in very low priority. A huge monthly donation may make it happen :P
Some larger display require 3-bit SPI + RGB combo interface, i.e. require more than 3 + 24 pins. Most dev board do not have enough GPIO to support this. Arduino_GFX will eventually support this combo interface but will be in very low priority. A huge monthly sponsor may make it happen :P

## Ease of use
#### Simple Declaration
Expand Down Expand Up @@ -84,8 +84,9 @@ Below are some figures compare with other 3 Arduino common display libraries.
- 8-bit parallel interface (AVRPAR8, ESP32PAR8, ESP32S2PAR8, RPiPicoPAR8, RTLPAR8)
- 16-bit parallel interface (ESP32PAR16, ESP32S2PAR8, RPiPicoPAR16)

## Tobe Support data bus (Donation can make it happen)
## Tobe Support data bus (Sponsors can make it happen)
- ESP32 I2S 8-bit/16-bit parallel interface
- Arduino ATMega2560 dual 8-bit Port form 16-bit parallel interface
- FastLED

## Currently Supported Dev Board
Expand All @@ -103,7 +104,7 @@ Below are some figures compare with other 3 Arduino common display libraries.
- Sony Spresense
- WeAct BlackPill V2.0 (BlackPill F411CE)

## Tobe Support Dev Board (Donation can make it happen)
## Tobe Support Dev Board (Sponsors can make it happen)
- Arduino ATMega2560
- ESP32-S3 Series

Expand Down Expand Up @@ -155,7 +156,7 @@ Below are some figures compare with other 3 Arduino common display libraries.
- ST7789 240x320 [[demo video](https://youtu.be/ZEvc1LkuVuQ)]
- ST7796 320x480 [[demo video](https://youtu.be/hUL-RuG4MAQ)]

## Tobe Support Display (Donation can make it happen)
## Tobe Support Display (Sponsors can make it happen)
- FastLED Martix supported by co-operate with Canvas
- Mono display supported by co-operate with Canvas
- Multi-color e-ink display supported by co-operate with Canvas
Expand All @@ -166,6 +167,12 @@ Below are some figures compare with other 3 Arduino common display libraries.
- Canvas_3bit (1/4 memory space framebuffer)
- Canvas_Mono (1/16 memory space framebuffer)

## Feature wishlist (Sponsors can make it happen)
- Print UTF8 Characters
- Print color Emoji Characters
- Load bitmap font files from flash / SD
- Fill Gradient

## Using source code come from:
- http://elm-chan.org/fsw/tjpgd/00index.html
- https://github.com/adafruit/Adafruit-GFX-Library.git
Expand Down
25 changes: 25 additions & 0 deletions src/Arduino_GFX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1832,6 +1832,14 @@ void Arduino_GFX::drawChar(int16_t x, int16_t y, unsigned char c,
}
else // 'Classic' built-in font
#endif // !defined(ATTINY_CORE)
#if defined(U8G2_FONT_SUPPORT)
if (u8g2Font)
{
u8x8_get_glyph_data(u8x8, encoding, buf, tile);
u8x8_DrawTile(u8x8, xx, y, 1, buf);
}
else // not u8g2Font
#endif // defined(U8G2_FONT_SUPPORT)
{
block_w = 6 * textsize_x;
block_h = 8 * textsize_y;
Expand Down Expand Up @@ -2038,6 +2046,9 @@ void Arduino_GFX::setRotation(uint8_t r)
void Arduino_GFX::setFont(const GFXfont *f)
{
gfxFont = (GFXfont *)f;
#if defined(U8G2_FONT_SUPPORT)
u8g2Font = NULL;
#endif // defined(U8G2_FONT_SUPPORT)
}

/**************************************************************************/
Expand All @@ -2050,6 +2061,14 @@ void Arduino_GFX::flush()
}
#endif // !defined(ATTINY_CORE)

#if defined(U8G2_FONT_SUPPORT)
void Arduino_GFX::setFont(const uint8_t *font)
{
gfxFont = NULL;
u8g2Font = (uint8_t *)font;
}
#endif // defined(U8G2_FONT_SUPPORT)

/**************************************************************************/
/*!
@brief Helper to determine size of a character with current font/size.
Expand Down Expand Up @@ -2119,6 +2138,12 @@ void Arduino_GFX::charBounds(char c, int16_t *x, int16_t *y,
}
else // not gfxFont
#endif // !defined(ATTINY_CORE)
#if defined(U8G2_FONT_SUPPORT)
if (u8g2Font)
{
}
else // not u8g2Font
#endif // defined(U8G2_FONT_SUPPORT)
{
if (c == '\n')
{ // Newline?
Expand Down
18 changes: 15 additions & 3 deletions src/Arduino_GFX.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
#define DEGTORAD 0.017453292519943295769236907684886F
#endif

#if __has_include(<U8g2lib.h>)
#include <u8g2lib.h>
#define U8G2_FONT_SUPPORT
#endif

// Color definitions
#define BLACK 0x0000 ///< 0, 0, 0
#define NAVY 0x000F ///< 0, 0, 123
Expand Down Expand Up @@ -189,6 +194,9 @@ class Arduino_GFX : public Print, public Arduino_G

#if !defined(ATTINY_CORE)
void setFont(const GFXfont *f = NULL);
#if defined(U8G2_FONT_SUPPORT)
void setFont(const uint8_t *font);
#endif // defined(U8G2_FONT_SUPPORT)
virtual void flush(void);
#endif // !defined(ATTINY_CORE)

Expand Down Expand Up @@ -375,9 +383,13 @@ class Arduino_GFX : public Print, public Arduino_G
wrap, ///< If set, 'wrap' text at right edge of display
_cp437; ///< If set, use correct CP437 charset (default is off)
#if !defined(ATTINY_CORE)
GFXfont
*gfxFont; ///< Pointer to special font
#endif // !defined(ATTINY_CORE)
GFXfont *gfxFont; ///< Pointer to special font
#endif // !defined(ATTINY_CORE)

#if defined(U8G2_FONT_SUPPORT)
uint8_t *u8g2Font;
#endif // defined(U8G2_FONT_SUPPORT)

#if defined(LITTLE_FOOT_PRINT)
int16_t
WIDTH, ///< This is the 'raw' display width - never changes
Expand Down
9 changes: 8 additions & 1 deletion src/Arduino_TFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1065,8 +1065,15 @@ void Arduino_TFT::drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color
endWrite();
}
}
else // 'Classic' built-in font
else // not gfxFont
#endif // !defined(ATTINY_CORE)
#if defined(U8G2_FONT_SUPPORT)
if (u8g2Font)
{
Arduino_GFX::drawChar(x, y, c, color, bg);
}
else // not u8g2Font
#endif // defined(U8G2_FONT_SUPPORT)
{
block_w = 6 * textsize_x;
block_h = 8 * textsize_y;
Expand Down

0 comments on commit 69bfcbc

Please sign in to comment.