Closed VanishingDice closed 10 months ago
You can move line "#define U8G2_USE_LARGE_FONTS" before line 193, but it may still fail, because your controller may not support such big data objects.
https://github.com/olikraus/u8g2/blob/34be7c84883a3ffc927e04eda7a99c539da040ee/csrc/u8g2.h#L191-L197
Thank you! What a silly mistake I made! As you said, the array is too big for Arduino:
c:\Users\Admin\Documents\Arduino\libraries\U8g2\src\clib\u8g2_fonts.c:111831:15: error: size of array 'u8g2_font_wqy12_t_gb2312' is too large
const uint8_t u8g2_font_wqy12_t_gb2312[202690] U8G2_FONT_SECTION("u8g2_font_wqy12_t_gb2312") =
^~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\Admin\Documents\Arduino\libraries\U8g2\src\clib\u8g2_fonts.c:118175:15: error: size of array 'u8g2_font_wqy12_t_gb2312a' is too large
const uint8_t u8g2_font_wqy12_t_gb2312a[109189] U8G2_FONT_SECTION("u8g2_font_wqy12_t_gb2312a") =
^~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\Admin\Documents\Arduino\libraries\U8g2\src\clib\u8g2_fonts.c:121597:15: error: size of array 'u8g2_font_wqy12_t_gb2312b' is too large
const uint8_t u8g2_font_wqy12_t_gb2312b[118722] U8G2_FONT_SECTION("u8g2_font_wqy12_t_gb2312b") =
^~~~~~~~~~~~~~~~~~~~~~~~~
the array limit for Arduino is 32768 elements, gb2312 and unifont_chinese3 are both out of this limit, so they can't work on Arduino. Is there any possibility to put them in the program space to use? or I should create a customized charset?
so they can't work on Arduino.
It is not related to "Arduino". It is the AVR architecture which adds this limitation. I mean the problem is the "Arduino Mega2560" controller. If you would use ESP32 or an ARM based Arduino Board than this limitation doesn't exist.
Is there any possibility to put them in the program space to use?
All fonts are already located in PROGMEM space (this is enforced by the U8G2_FONT_SECTION macro).
I should create a customized charset?
Of course this is an option. There is a video on this topic: https://github.com/olikraus/u8g2/blob/34be7c84883a3ffc927e04eda7a99c539da040ee/doc/faq.txt#L284-L286
Thank you very much! This helps me a lot!
(please forgive me for my grammar mistake...) I'm using Arduino Mega 2560, I want to print chinese characters on LCD12864, when I use u8g2_font_wqy16_t_chinese1, 2 and 3, everything goes well, but characters isn't enough. when I trying to use u8g2_font_wqy16_t_gb2312 or 2312a, b, when the complier finished all and trying to combine everything together, the problem will happen like this:
I noticed that the charset u8g2_font_unifont_t_chinese1 and 2 can work, but chinese3 in unifont doesn't work, that's similar to #510 , but that is a really old issue, and seems that person used a customized charset to solve the problem, is there any possibility to just use standard gb2312 charset on arduino mega2560?
this is my code: