-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Break the language barrier of TFT Color UI #25073
Break the language barrier of TFT Color UI #25073
Conversation
Add unicode support for TFT Color UI Added to new fonts: NotoSans and Unifont Add 8 character groups to support Marlin translations to various languages - Latin_Extended_A - Cyrilic - Greek - Katakana (with few extra hyeroglyphs) - Korean (limited support) - Vietnamese - Simplified Chinese (limited support) - Traditional Chinese (limited support)
Detailed functionality description can be found in comment below. To whoever is going to review this: please let me know if you have an elegant way to check for LCD_LANGUAGE settings. Character sets showcase: 320x240 with NotoSans Medium 14px |
Going to need to add #ifdef blocks to filter this new code out for people not using platformio source filters, such as Arduino IDE users |
This looks really good, @jmz52! I appreciate your work a lot. Do you have any estimates on how this new feature will impact the size of compiled firmware binaries? |
Unicode support and limitationsTFT Color UI is upgraded to support unicode characters instead of FontsSupport for u8g fonts is dropped because of Helvetica14 (320x240 and 480x272) and Helvetica18 (480x320 and 1024x600) were converted to new font format. Optional font anti aliasing. Implemented by using 2 bits per pixel in glyphs' data. AA makes converted TTF/OTF fonts look better at the cost of increased firmware size. Non-AA fonts use 1 bit per pixel. Two new fonts
New Updated UIUpdated UI code for 320xx240, 480x272 and 480x320 resolutions to make them look better with new fonts and get rid of flickering caused by elements overlapping in 480x272 UI. 'Extra' characters sets8 'extra' characters sets to support all available
These sets of symbols covers 100% of symbols used in corresponding UTF_FILENAME_SUPPORTUsage of |
52a9e5e
to
7e60d15
Compare
4555d4d
to
28c36d3
Compare
This is looking very nice! I expect most TFT users have some room to spare in Flash so if the size increase is moderate then I'm not too worried. I will merge this for wider testing shortly. I'm particularly interested in finding a way to draw fonts at a larger size for the benefit of the BIQU BX screen. Helvetica 36 ? At least, some numbers and punctuation would be useful to print at the larger size. Of course, the larger screen allows for a lot more information to be displayed on the Info Screen –and with a nicer layout– so that also needs to be expanded upon. |
28c36d3
to
ce388c1
Compare
@thinkyhead, I would rather not invest in Helvetica font.
Helvetica can still have it uses when firmware size is of an essence and 10px Unifont is too small to be used. As for larger screens, like 1024x600 of BIQU BX, the bigger fonts is the least problem there. NotoSans and Unifont .cpp files are auto-generated from OTF/TTF files using FreeType2 library and this can done for any other font and fontsize needed. |
Nope, all in buildroot/share/scripts. |
Description
Break the language barrier of 255 character-fonts inherited from u8glib and embrace unicode support for TFT Color UI.
2 new fonts NotoSans with antialiasing and lightweight Unifont
8 character groups to support all available Marlin translations
Requirements
A lot of flash - fonts with antialiasing are flash hungry.
373 glyphs needed for language_zh_CN.h (Simplified Chinese) use 57Kb for 480x320 UI.
Related Issues
#20268
#21235