Skip to content

Commit 2ddfe6e

Browse files
committed
Add display unicode support
1 parent db39547 commit 2ddfe6e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+157013
-85
lines changed

examples/Advanced/Display_Unicode/CUF_24px.h

Lines changed: 156487 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
if use PlatformIO, need add "board_build.partitions = no_ota.csv" to config
3+
Set tools->partition scheme->'Large APP'
4+
Pls modify <m5stack path>/src/utility/In_eSPI_Setup.h, At the end of the file add "#define USE_M5_FONT_CREATOR"
5+
if want get customize unicode, try use https://github.com/m5stack/FontCreator, create font file
6+
7+
if add "#define USE_M5_FONT_CREATOR" and want to use gfx font, need modify font file
8+
#ifdef USE_M5_FONT_CREATOR
9+
0, 0,
10+
#endif
11+
like:
12+
const GFXfont FreeMono12pt7b PROGMEM = {
13+
(uint8_t *)FreeMono12pt7bBitmaps,
14+
(GFXglyph *)FreeMono12pt7bGlyphs,
15+
0x20, 0x7E, 24,
16+
#ifdef USE_M5_FONT_CREATOR
17+
0, 0,
18+
#endif
19+
};
20+
*/
21+
#include <M5Stack.h>
22+
#include "CUF_24px.h"
23+
24+
void setup()
25+
{
26+
M5.begin();
27+
28+
M5.Lcd.setTextColor(TFT_WHITE);
29+
M5.Lcd.setFreeFont(&CUF_24px);
30+
31+
32+
M5.Lcd.setTextDatum(TC_DATUM);
33+
}
34+
35+
void loop()
36+
{
37+
M5.Lcd.fillScreen(0);
38+
M5.Lcd.drawString("Hello world", 160, 60, 1);
39+
M5.Lcd.drawString("你好 世界", 160, 90, 1);
40+
M5.Lcd.drawString("Здравствуй мир", 160, 120, 1);
41+
M5.Lcd.drawString("こんにちは せかい", 160, 150, 1);
42+
delay(3000);
43+
44+
M5.Lcd.fillScreen(0);
45+
M5.Lcd.setCursor(0, 30);
46+
M5.Lcd.printf("☀☁☂☃☄★☆☇☈☉☊☋☌☍☎☏☐☑☒☓☔☕☖☗☘☙☚☛☜☝☞☟☠☡☢☣☤☥☦☧☨☩☪☫☬☭☮☯☸☹☺☻☼☽☾☿♀♁♂♃♄♅♆♇♈♉♊♋♌♍♎♏♐♑♒♓♔♕♖♗♘♙♚♛♜♝♞♟♠♡♢♣♤♥♦♧♨♩♪♫♬♭♮♯♰♱♲♳♴♵♶♷♸♹♺♻♼♽♾♿⚀⚁⚂⚃⚄⚅⚆⚇⚈⚉⚊⚋⚌⚍⚎⚏⚐⚑⚒⚓⚔⚕⚖⚗⚘⚙⚚⚛⚜⚝⚞⚟A⚠⚡⚢⚣⚤⚥⚦⚧⚨⚩⚪⚫⚬⚭⚮⚯B⚰⚱⚲⚳⚴⚵⚶⚷⚸⚹⚺⚻⚼⚽⚾⚿C⛀⛁⛂⛃⛄⛅⛆⛇⛈⛉⛊⛋⛌⛍⛎⛏D⛐⛑⛒⛓⛔⛕⛖⛗⛘⛙⛚⛛⛜⛝⛞⛟E⛠⛡⛢");
47+
delay(3000);
48+
49+
M5.Lcd.fillScreen(0);
50+
M5.Lcd.setCursor(0, 30);
51+
M5.Lcd.printf("⛣⛤⛥⛦⛧⛨⛩⛪⛫⛬⛭⛮⛯F⛰⛱⛲⛳⛴⛵⛶⛷⛸⛹⛺⛻⛼⛽⛾⛿✀✁✂✃✄✅✆✇✈✉✊✋✌✍✎✏✐✑✒✓✔✕✖✗✘✙✚✛✜✝✞✟✠✡✢✣✤✥✦✧✨✩✪✫✬✭✮✯✰✱✲✳✴✵✶✷✸✹✺✻✼✽✾✿❀❁❂❃❄❅❆❇❈❉❊❋❌❍❎❏❐❑❒❓❔❕❖❗❘❙❚❛❜❝❞❟❠❡❢❣❤❥❦❧❨❩❪❫❬❭❮❯❰❱❲❳❴❵❶❷❸❹❺❻❼❽❾❿➀➁➂➃➄➅➆➇➈➉➊➋➌➍➎➏➐➑➒➓➔➕➖➗➘➙➚➛➜➝➞➟A➠➡➢➣➤➥➦➧➨➩➪➫➬➭➮➯B➰➱➲➳➴➵➶➷➸➹➺➻➼➽➾➿");
52+
delay(3000);
53+
54+
}

src/Fonts/Custom/Orbitron_Light_24.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,8 @@ const GFXglyph Orbitron_Light_24Glyphs[] PROGMEM = {
196196
{ 2521, 5, 17, 8, 1, -17 } // '}'
197197
};
198198
const GFXfont Orbitron_Light_24 PROGMEM = {
199-
(uint8_t *)Orbitron_Light_24Bitmaps,(GFXglyph *)Orbitron_Light_24Glyphs,0x20, 0x7D, 24};
199+
(uint8_t *)Orbitron_Light_24Bitmaps,(GFXglyph *)Orbitron_Light_24Glyphs,0x20, 0x7D, 24,
200+
#ifdef USE_M5_FONT_CREATOR
201+
0, 0,
202+
#endif
203+
};

src/Fonts/Custom/Orbitron_Light_32.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,8 @@ const GFXglyph Orbitron_Light_32Glyphs[] PROGMEM = {
196196
{ 4596, 6, 24, 10, 2, -24 } // '}'
197197
};
198198
const GFXfont Orbitron_Light_32 PROGMEM = {
199-
(uint8_t *)Orbitron_Light_32Bitmaps,(GFXglyph *)Orbitron_Light_32Glyphs,0x20, 0x7D, 32};
199+
(uint8_t *)Orbitron_Light_32Bitmaps,(GFXglyph *)Orbitron_Light_32Glyphs,0x20, 0x7D, 32,
200+
#ifdef USE_M5_FONT_CREATOR
201+
0, 0,
202+
#endif
203+
};

src/Fonts/Custom/Roboto_Thin_24.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,8 @@ const GFXglyph Roboto_Thin_24Glyphs[] PROGMEM = {
196196
{ 1858, 8, 25, 9, -1, -19 } // '}'
197197
};
198198
const GFXfont Roboto_Thin_24 PROGMEM = {
199-
(uint8_t *)Roboto_Thin_24Bitmaps,(GFXglyph *)Roboto_Thin_24Glyphs,0x20, 0x7D, 29};
199+
(uint8_t *)Roboto_Thin_24Bitmaps,(GFXglyph *)Roboto_Thin_24Glyphs,0x20, 0x7D, 29,
200+
#ifdef USE_M5_FONT_CREATOR
201+
0, 0,
202+
#endif
203+
};

src/Fonts/Custom/Satisfy_24.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,8 @@ const GFXglyph Satisfy_24Glyphs[] PROGMEM = {
196196
{ 2595, 10, 24, 7, -3, -21 } // '}'
197197
};
198198
const GFXfont Satisfy_24 PROGMEM = {
199-
(uint8_t *)Satisfy_24Bitmaps,(GFXglyph *)Satisfy_24Glyphs,0x20, 0x7D, 36};
199+
(uint8_t *)Satisfy_24Bitmaps,(GFXglyph *)Satisfy_24Glyphs,0x20, 0x7D, 36,
200+
#ifdef USE_M5_FONT_CREATOR
201+
0, 0,
202+
#endif
203+
};

src/Fonts/Custom/Yellowtail_32.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,8 @@ const GFXglyph Yellowtail_32Glyphs[] PROGMEM = {
196196
{ 4618, 21, 32, 16, -3, -27 } // '}'
197197
};
198198
const GFXfont Yellowtail_32 PROGMEM = {
199-
(uint8_t *)Yellowtail_32Bitmaps,(GFXglyph *)Yellowtail_32Glyphs,0x20, 0x7D, 45};
199+
(uint8_t *)Yellowtail_32Bitmaps,(GFXglyph *)Yellowtail_32Glyphs,0x20, 0x7D, 45,
200+
#ifdef USE_M5_FONT_CREATOR
201+
0, 0,
202+
#endif
203+
};

src/Fonts/GFXFF/FreeMono12pt7b.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ const GFXglyph FreeMono12pt7bGlyphs[] PROGMEM = {
222222
const GFXfont FreeMono12pt7b PROGMEM = {
223223
(uint8_t *)FreeMono12pt7bBitmaps,
224224
(GFXglyph *)FreeMono12pt7bGlyphs,
225-
0x20, 0x7E, 24 };
225+
0x20, 0x7E, 24,
226+
#ifdef USE_M5_FONT_CREATOR
227+
0, 0,
228+
#endif
229+
};
226230

227231
// Approx. 2132 bytes

src/Fonts/GFXFF/FreeMono18pt7b.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,10 @@ const GFXglyph FreeMono18pt7bGlyphs[] PROGMEM = {
358358
const GFXfont FreeMono18pt7b PROGMEM = {
359359
(uint8_t *)FreeMono18pt7bBitmaps,
360360
(GFXglyph *)FreeMono18pt7bGlyphs,
361-
0x20, 0x7E, 35 };
361+
0x20, 0x7E, 35,
362+
#ifdef USE_M5_FONT_CREATOR
363+
0, 0
364+
#endif
365+
};
362366

363367
// Approx. 3761 bytes

src/Fonts/GFXFF/FreeMono24pt7b.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,10 @@ const GFXglyph FreeMono24pt7bGlyphs[] PROGMEM = {
572572
const GFXfont FreeMono24pt7b PROGMEM = {
573573
(uint8_t *)FreeMono24pt7bBitmaps,
574574
(GFXglyph *)FreeMono24pt7bGlyphs,
575-
0x20, 0x7E, 47 };
575+
0x20, 0x7E, 47,
576+
#ifdef USE_M5_FONT_CREATOR
577+
0, 0
578+
#endif
579+
};
576580

577581
// Approx. 6330 bytes

0 commit comments

Comments
 (0)