MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.28k stars 19.24k forks source link

[BUG] DOGLCD - Fonts for additional languages does not load #22379

Closed MESlammer closed 3 years ago

MESlammer commented 3 years ago

Did you test the latest bugfix-2.0.x code?

Yes, and the problem still exists.

Bug Description

You can specify additional languages for Marlin UI, with LCD_LANGUAGE_2, LCD_LANGUAGE_3, LCD_LANGUAGE_4, LCD_LANGUAGE_5. However, fonts for these languages are not uploaded to controller, so if you will change language in menu, text on display will be broken, unless it uses font of LCD_LANGUAGE Bug was found on DOGLCD displays, i have no hardware to test it on TFT_COLOR_UI or TOUCH_UI_FTDI_EVE.

Bug Timeline

First found in 2.0.9.1

Expected behavior

Readable text on display in different languages

Actual behavior

Random symbols instead of text

Steps to Reproduce

  1. Enable graphical controller in configuration.h (ULTI_CONTROLLER, for example)
  2. Enable additional languages in configuration_adv.h - uncomment LCD_LANGUAGE_2 and set it to language with not default font - ru, for example
  3. Repeat same for LCD_LANGUAGE_3, LCD_LANGUAGE_4, LCD_LANGUAGE_5 - set them to uk, jp_kana and ko_KR
  4. Compile, upload
  5. Change language through menu

Version of Marlin Firmware

bugfix-2.0.x

Printer model

BLV mgn Cube (unrelevant)

Electronics

Arduino DUE, RuRAMPS v.1.3, SSD1309 DIY controller

Add-ons

No response

Your Slicer

No response

Host Software

No response

Additional information & file uploads

configurations.zip

thinkyhead commented 3 years ago

Thanks for the report! Please test #22381 to see if it fixes the issue.

MESlammer commented 3 years ago

@thinkyhead Sure!

22381 - loads font only for the last language in list. For understanding, if there 5 choices - it will load font only for LCD_LANGUAGE_5, if there is 3 choices - LCD_LANGUAGE_3. Fonts in between do not load.

thinkyhead commented 3 years ago

Since most of the language fonts are empty I assumed that the langdata_xx.h files are simply providing the additional characters needed to augment the standard Western font, and not a complete font. I had hoped they could all be installed at the start, but it appears that the call to uxg_SetUtf8Fonts does a clear of the font data before installing the additional characters. So, I will simply adjust set_language to call uxg_SetUtf8Fonts on the fly.

thinkyhead commented 3 years ago

Ok, I have made the change, so theoretically it should now work!

MESlammer commented 3 years ago

Okay, looks like it's working now. All fonts load correctly.

thinkyhead commented 3 years ago

Thanks, it works here too, and I have also changed the LANGUAGE string for zh_CN to English so it can always be drawn.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.