Browse Source

🐛 Change font for selected language (#22381)

vanilla_fb_2.0.x
Scott Lahteine 3 years ago
committed by Scott Lahteine
parent
commit
0074ea5e0b
  1. 3
      Marlin/src/core/multi_language.h
  2. 23
      Marlin/src/lcd/dogm/fontdata/langdata.h
  3. 7
      Marlin/src/lcd/dogm/fontdata/langdata_an.h
  4. 7
      Marlin/src/lcd/dogm/fontdata/langdata_bg.h
  5. 7
      Marlin/src/lcd/dogm/fontdata/langdata_ca.h
  6. 7
      Marlin/src/lcd/dogm/fontdata/langdata_cz.h
  7. 7
      Marlin/src/lcd/dogm/fontdata/langdata_da.h
  8. 7
      Marlin/src/lcd/dogm/fontdata/langdata_de.h
  9. 7
      Marlin/src/lcd/dogm/fontdata/langdata_el.h
  10. 7
      Marlin/src/lcd/dogm/fontdata/langdata_el_gr.h
  11. 7
      Marlin/src/lcd/dogm/fontdata/langdata_en.h
  12. 7
      Marlin/src/lcd/dogm/fontdata/langdata_es.h
  13. 7
      Marlin/src/lcd/dogm/fontdata/langdata_eu.h
  14. 7
      Marlin/src/lcd/dogm/fontdata/langdata_fi.h
  15. 7
      Marlin/src/lcd/dogm/fontdata/langdata_fr.h
  16. 7
      Marlin/src/lcd/dogm/fontdata/langdata_gl.h
  17. 7
      Marlin/src/lcd/dogm/fontdata/langdata_hr.h
  18. 7
      Marlin/src/lcd/dogm/fontdata/langdata_hu.h
  19. 7
      Marlin/src/lcd/dogm/fontdata/langdata_it.h
  20. 7
      Marlin/src/lcd/dogm/fontdata/langdata_jp_kana.h
  21. 7
      Marlin/src/lcd/dogm/fontdata/langdata_ko_KR.h
  22. 7
      Marlin/src/lcd/dogm/fontdata/langdata_nl.h
  23. 7
      Marlin/src/lcd/dogm/fontdata/langdata_pl.h
  24. 7
      Marlin/src/lcd/dogm/fontdata/langdata_pt.h
  25. 7
      Marlin/src/lcd/dogm/fontdata/langdata_pt_br.h
  26. 7
      Marlin/src/lcd/dogm/fontdata/langdata_ro.h
  27. 7
      Marlin/src/lcd/dogm/fontdata/langdata_ru.h
  28. 7
      Marlin/src/lcd/dogm/fontdata/langdata_sk.h
  29. 7
      Marlin/src/lcd/dogm/fontdata/langdata_test.h
  30. 7
      Marlin/src/lcd/dogm/fontdata/langdata_tr.h
  31. 7
      Marlin/src/lcd/dogm/fontdata/langdata_uk.h
  32. 7
      Marlin/src/lcd/dogm/fontdata/langdata_vi.h
  33. 7
      Marlin/src/lcd/dogm/fontdata/langdata_zh_CN.h
  34. 7
      Marlin/src/lcd/dogm/fontdata/langdata_zh_TW.h
  35. 36
      Marlin/src/lcd/dogm/marlinui_DOGM.cpp
  36. 3
      Marlin/src/lcd/dogm/u8g_fontutf8.h
  37. 2
      Marlin/src/lcd/language/language_zh_CN.h
  38. 8
      Marlin/src/lcd/marlinui.cpp
  39. 12
      Marlin/src/lcd/marlinui.h

3
Marlin/src/core/multi_language.h

@ -42,15 +42,12 @@ typedef const char Language_Str[];
#ifndef LCD_LANGUAGE_2
#define LCD_LANGUAGE_2 LCD_LANGUAGE
#endif
#ifndef LCD_LANGUAGE_3
#define LCD_LANGUAGE_3 LCD_LANGUAGE_2
#endif
#ifndef LCD_LANGUAGE_4
#define LCD_LANGUAGE_4 LCD_LANGUAGE_3
#endif
#ifndef LCD_LANGUAGE_5
#define LCD_LANGUAGE_5 LCD_LANGUAGE_4
#endif

23
Marlin/src/lcd/dogm/fontdata/langdata.h

@ -0,0 +1,23 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#include <U8glib-HAL.h>
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }

7
Marlin/src/lcd/dogm/fontdata/langdata_an.h

@ -3,7 +3,8 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {};
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_an[] PROGMEM = {};

7
Marlin/src/lcd/dogm/fontdata/langdata_bg.h

@ -3,7 +3,9 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_8_144_149[96] U8G_FONT_SECTION("fontpage_8_144_149") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x90,0x95,0x00,0x07,0xFF,0x00,
@ -64,8 +66,7 @@ const u8g_fntpgm_uint8_t fontpage_8_206_207[39] U8G_FONT_SECTION("fontpage_8_206
0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x90,0xA8,0xE8,0xA8,0x90,0x04,0x05,0x05,0x06,
0x01,0x00,0x70,0x90,0x70,0x50,0x90};
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {
static const uxg_fontinfo_t g_fontinfo_bg[] PROGMEM = {
FONTDATA_ITEM(8, 144, 149, fontpage_8_144_149), // 'А' -- 'Е'
FONTDATA_ITEM(8, 151, 152, fontpage_8_151_152), // 'З' -- 'И'
FONTDATA_ITEM(8, 154, 164, fontpage_8_154_164), // 'К' -- 'Ф'

7
Marlin/src/lcd/dogm/fontdata/langdata_ca.h

@ -3,7 +3,8 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {};
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_ca[] PROGMEM = {};

7
Marlin/src/lcd/dogm/fontdata/langdata_cz.h

@ -3,7 +3,9 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_2_140_141[47] U8G_FONT_SECTION("fontpage_2_140_141") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x8C,0x8D,0x00,0x0A,0x00,0x00,
@ -40,8 +42,7 @@ const u8g_fntpgm_uint8_t fontpage_2_253_254[47] U8G_FONT_SECTION("fontpage_2_253
0x00,0x05,0x0A,0x0A,0x06,0x00,0x00,0x50,0x20,0x00,0xF8,0x08,0x10,0x20,0x40,0x80,
0xF8,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0xF8,0x10,0x20,0x40,0xF8};
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {
static const uxg_fontinfo_t g_fontinfo_cz[] PROGMEM = {
FONTDATA_ITEM(2, 140, 141, fontpage_2_140_141), // 'Č' -- 'č'
FONTDATA_ITEM(2, 143, 143, fontpage_2_143_143), // 'ď' -- 'ď'
FONTDATA_ITEM(2, 154, 155, fontpage_2_154_155), // 'Ě' -- 'ě'

7
Marlin/src/lcd/dogm/fontdata/langdata_da.h

@ -3,7 +3,8 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {};
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_da[] PROGMEM = {};

7
Marlin/src/lcd/dogm/fontdata/langdata_de.h

@ -3,7 +3,8 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {};
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_de[] PROGMEM = {};

7
Marlin/src/lcd/dogm/fontdata/langdata_el.h

@ -3,7 +3,9 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_7_136_136[33] U8G_FONT_SECTION("fontpage_7_136_136") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x0A,0x00,0x00,
@ -75,8 +77,7 @@ const u8g_fntpgm_uint8_t fontpage_64_166_166[24] U8G_FONT_SECTION("fontpage_64_1
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xA6,0xA6,0x00,0x01,0x00,0x00,
0x00,0x05,0x01,0x01,0x06,0x00,0x00,0xA8};
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {
static const uxg_fontinfo_t g_fontinfo_el[] PROGMEM = {
FONTDATA_ITEM(7, 136, 136, fontpage_7_136_136), // 'Έ' -- 'Έ'
FONTDATA_ITEM(7, 145, 157, fontpage_7_145_157), // 'Α' -- 'Ν'
FONTDATA_ITEM(7, 159, 161, fontpage_7_159_161), // 'Ο' -- 'Ρ'

7
Marlin/src/lcd/dogm/fontdata/langdata_el_gr.h

@ -3,7 +3,9 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_7_136_136[33] U8G_FONT_SECTION("fontpage_7_136_136") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x0A,0x00,0x00,
@ -75,8 +77,7 @@ const u8g_fntpgm_uint8_t fontpage_64_166_166[24] U8G_FONT_SECTION("fontpage_64_1
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xA6,0xA6,0x00,0x01,0x00,0x00,
0x00,0x05,0x01,0x01,0x06,0x00,0x00,0xA8};
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {
static const uxg_fontinfo_t g_fontinfo_el_gr[] PROGMEM = {
FONTDATA_ITEM(7, 136, 136, fontpage_7_136_136), // 'Έ' -- 'Έ'
FONTDATA_ITEM(7, 145, 157, fontpage_7_145_157), // 'Α' -- 'Ν'
FONTDATA_ITEM(7, 159, 161, fontpage_7_159_161), // 'Ο' -- 'Ρ'

7
Marlin/src/lcd/dogm/fontdata/langdata_en.h

@ -3,7 +3,8 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {};
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_en[] PROGMEM = {};

7
Marlin/src/lcd/dogm/fontdata/langdata_es.h

@ -3,7 +3,8 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {};
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_es[] PROGMEM = {};

7
Marlin/src/lcd/dogm/fontdata/langdata_eu.h

@ -3,7 +3,8 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {};
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_eu[] PROGMEM = {};

7
Marlin/src/lcd/dogm/fontdata/langdata_fi.h

@ -3,7 +3,8 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {};
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_fi[] PROGMEM = {};

7
Marlin/src/lcd/dogm/fontdata/langdata_fr.h

@ -3,7 +3,8 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {};
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_fr[] PROGMEM = {};

7
Marlin/src/lcd/dogm/fontdata/langdata_gl.h

@ -3,7 +3,8 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {};
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_gl[] PROGMEM = {};

7
Marlin/src/lcd/dogm/fontdata/langdata_hr.h

@ -3,7 +3,9 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_2_135_135[31] U8G_FONT_SECTION("fontpage_2_135_135") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x87,0x87,0x00,0x08,0x00,0x00,
@ -22,8 +24,7 @@ const u8g_fntpgm_uint8_t fontpage_2_254_254[31] U8G_FONT_SECTION("fontpage_2_254
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0x00,0x08,0x00,0x00,
0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0xF8,0x10,0x20,0x40,0xF8};
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {
static const uxg_fontinfo_t g_fontinfo_hr[] PROGMEM = {
FONTDATA_ITEM(2, 135, 135, fontpage_2_135_135), // 'ć' -- 'ć'
FONTDATA_ITEM(2, 140, 141, fontpage_2_140_141), // 'Č' -- 'č'
FONTDATA_ITEM(2, 145, 145, fontpage_2_145_145), // 'đ' -- 'đ'

7
Marlin/src/lcd/dogm/fontdata/langdata_hu.h

@ -3,13 +3,14 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_2_241_241[31] U8G_FONT_SECTION("fontpage_2_241_241") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xF1,0xF1,0x00,0x08,0x00,0x00,
0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x48,0x90,0x00,0x88,0x88,0x88,0x88,0x70};
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {
static const uxg_fontinfo_t g_fontinfo_hu[] PROGMEM = {
FONTDATA_ITEM(2, 241, 241, fontpage_2_241_241), // 'ű' -- 'ű'
};

7
Marlin/src/lcd/dogm/fontdata/langdata_it.h

@ -3,7 +3,8 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {};
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_it[] PROGMEM = {};

7
Marlin/src/lcd/dogm/fontdata/langdata_jp_kana.h

@ -3,7 +3,9 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_97_161_164[65] U8G_FONT_SECTION("fontpage_97_161_164") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xA1,0xA4,0x00,0x07,0x00,0x00,
@ -94,8 +96,7 @@ const u8g_fntpgm_uint8_t fontpage_97_252_252[25] U8G_FONT_SECTION("fontpage_97_2
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xFC,0xFC,0x00,0x05,0x00,0x00,
0x00,0x05,0x02,0x02,0x06,0x00,0x03,0x80,0x78};
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {
static const uxg_fontinfo_t g_fontinfo_jp_kana[] PROGMEM = {
FONTDATA_ITEM(97, 161, 164, fontpage_97_161_164), // 'ァ' -- 'イ'
FONTDATA_ITEM(97, 166, 166, fontpage_97_166_166), // 'ウ' -- 'ウ'
FONTDATA_ITEM(97, 168, 168, fontpage_97_168_168), // 'エ' -- 'エ'

7
Marlin/src/lcd/dogm/fontdata/langdata_ko_KR.h

@ -3,7 +3,9 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_344_240_240[34] U8G_FONT_SECTION("fontpage_344_240_240") = {
0x00,0x0B,0x0D,0x00,0xFD,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0x00,0x09,0xFE,0x00,
@ -436,8 +438,7 @@ const u8g_fntpgm_uint8_t fontpage_431_136_136[34] U8G_FONT_SECTION("fontpage_431
0x00,0x08,0x0B,0x0B,0x0A,0x01,0xFE,0x71,0x01,0xFD,0x01,0x71,0x49,0x89,0x49,0x71,
0x01,0x01};
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {
static const uxg_fontinfo_t g_fontinfo_ko_KR[] PROGMEM = {
FONTDATA_ITEM(344, 240, 240, fontpage_344_240_240), // '거' -- '거'
FONTDATA_ITEM(345, 224, 224, fontpage_345_224_224), // '고' -- '고'
FONTDATA_ITEM(347, 248, 248, fontpage_347_248_248), // '그' -- '그'

7
Marlin/src/lcd/dogm/fontdata/langdata_nl.h

@ -3,7 +3,8 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {};
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_nl[] PROGMEM = {};

7
Marlin/src/lcd/dogm/fontdata/langdata_pl.h

@ -3,7 +3,9 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_2_132_133[45] U8G_FONT_SECTION("fontpage_2_132_133") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x84,0x85,0x00,0x07,0xFE,0x00,
@ -29,8 +31,7 @@ const u8g_fntpgm_uint8_t fontpage_2_252_252[30] U8G_FONT_SECTION("fontpage_2_252
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xFC,0xFC,0x00,0x07,0x00,0x00,
0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x00,0xF8,0x10,0x20,0x40,0xF8};
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {
static const uxg_fontinfo_t g_fontinfo_pl[] PROGMEM = {
FONTDATA_ITEM(2, 132, 133, fontpage_2_132_133), // 'Ą' -- 'ą'
FONTDATA_ITEM(2, 135, 135, fontpage_2_135_135), // 'ć' -- 'ć'
FONTDATA_ITEM(2, 153, 153, fontpage_2_153_153), // 'ę' -- 'ę'

7
Marlin/src/lcd/dogm/fontdata/langdata_pt.h

@ -3,7 +3,8 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {};
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_pt[] PROGMEM = {};

7
Marlin/src/lcd/dogm/fontdata/langdata_pt_br.h

@ -3,7 +3,8 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {};
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_pt_br[] PROGMEM = {};

7
Marlin/src/lcd/dogm/fontdata/langdata_ro.h

@ -3,7 +3,8 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {};
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_ro[] PROGMEM = {};

7
Marlin/src/lcd/dogm/fontdata/langdata_ru.h

@ -3,7 +3,9 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_8_144_168[348] U8G_FONT_SECTION("fontpage_8_144_168") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x90,0xA8,0x00,0x0A,0xFE,0x00,
@ -64,8 +66,7 @@ const u8g_fntpgm_uint8_t fontpage_8_209_209[30] U8G_FONT_SECTION("fontpage_8_209
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xD1,0xD1,0x00,0x07,0x00,0x00,
0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x50,0x00,0x70,0x88,0xF0,0x80,0x70};
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {
static const uxg_fontinfo_t g_fontinfo_ru[] PROGMEM = {
FONTDATA_ITEM(8, 144, 168, fontpage_8_144_168), // 'А' -- 'Ш'
FONTDATA_ITEM(8, 171, 173, fontpage_8_171_173), // 'Ы' -- 'Э'
FONTDATA_ITEM(8, 175, 207, fontpage_8_175_207), // 'Я' -- 'я'

7
Marlin/src/lcd/dogm/fontdata/langdata_sk.h

@ -3,7 +3,9 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_2_140_143[79] U8G_FONT_SECTION("fontpage_2_140_143") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x8C,0x8F,0x00,0x0A,0x00,0x00,
@ -37,8 +39,7 @@ const u8g_fntpgm_uint8_t fontpage_2_253_254[47] U8G_FONT_SECTION("fontpage_2_253
0x00,0x05,0x0A,0x0A,0x06,0x00,0x00,0x50,0x20,0x00,0xF8,0x08,0x10,0x20,0x40,0x80,
0xF8,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0xF8,0x10,0x20,0x40,0xF8};
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {
static const uxg_fontinfo_t g_fontinfo_sk[] PROGMEM = {
FONTDATA_ITEM(2, 140, 143, fontpage_2_140_143), // 'Č' -- 'ď'
FONTDATA_ITEM(2, 186, 186, fontpage_2_186_186), // 'ĺ' -- 'ĺ'
FONTDATA_ITEM(2, 189, 190, fontpage_2_189_190), // 'Ľ' -- 'ľ'

7
Marlin/src/lcd/dogm/fontdata/langdata_test.h

@ -3,7 +3,9 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_8_128_255[1677] U8G_FONT_SECTION("fontpage_8_128_255") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0x00,0x0A,0xFE,0x00,
@ -223,8 +225,7 @@ const u8g_fntpgm_uint8_t fontpage_97_193_255[822] U8G_FONT_SECTION("fontpage_97_
0x06,0x00,0x02,0x28,0x28,0x00,0x80,0x60,0x10,0x08,0x05,0x06,0x06,0x06,0x00,0x00,
0xF8,0x08,0x08,0x08,0x08,0x08};
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {
static const uxg_fontinfo_t g_fontinfo_test[] PROGMEM = {
FONTDATA_ITEM(8, 128, 255, fontpage_8_128_255), // 'Ѐ' -- 'ѿ'
FONTDATA_ITEM(97, 129, 191, fontpage_97_129_191), // 'め' -- 'タ'
FONTDATA_ITEM(97, 193, 255, fontpage_97_193_255), // 'チ' -- 'ヿ'

7
Marlin/src/lcd/dogm/fontdata/langdata_tr.h

@ -3,7 +3,9 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_2_158_159[49] U8G_FONT_SECTION("fontpage_2_158_159") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x9E,0x9F,0x00,0x0A,0xFE,0x00,
@ -19,8 +21,7 @@ const u8g_fntpgm_uint8_t fontpage_2_222_223[45] U8G_FONT_SECTION("fontpage_2_222
0x00,0x05,0x09,0x09,0x06,0x00,0xFE,0x70,0x88,0x80,0x70,0x08,0x88,0x70,0x10,0x60,
0x05,0x07,0x07,0x06,0x00,0xFE,0x78,0x80,0x70,0x08,0xF0,0x10,0x60};
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {
static const uxg_fontinfo_t g_fontinfo_tr[] PROGMEM = {
FONTDATA_ITEM(2, 158, 159, fontpage_2_158_159), // 'Ğ' -- 'ğ'
FONTDATA_ITEM(2, 176, 177, fontpage_2_176_177), // 'İ' -- 'ı'
FONTDATA_ITEM(2, 222, 223, fontpage_2_222_223), // 'Ş' -- 'ş'

7
Marlin/src/lcd/dogm/fontdata/langdata_uk.h

@ -3,7 +3,9 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_8_134_134[30] U8G_FONT_SECTION("fontpage_8_134_134") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x86,0x86,0x00,0x07,0x00,0x00,
@ -72,8 +74,7 @@ const u8g_fntpgm_uint8_t fontpage_8_214_215[41] U8G_FONT_SECTION("fontpage_8_214
0x00,0x03,0x06,0x06,0x06,0x01,0x00,0x40,0x00,0xC0,0x40,0x40,0xE0,0x03,0x06,0x06,
0x06,0x01,0x00,0xA0,0x00,0xC0,0x40,0x40,0xE0};
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {
static const uxg_fontinfo_t g_fontinfo_uk[] PROGMEM = {
FONTDATA_ITEM(8, 134, 134, fontpage_8_134_134), // 'І' -- 'І'
FONTDATA_ITEM(8, 144, 169, fontpage_8_144_169), // 'А' -- 'Щ'
FONTDATA_ITEM(8, 172, 172, fontpage_8_172_172), // 'Ь' -- 'Ь'

7
Marlin/src/lcd/dogm/fontdata/langdata_vi.h

@ -3,7 +3,9 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_2_131_131[31] U8G_FONT_SECTION("fontpage_2_131_131") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x83,0x83,0x00,0x08,0x00,0x00,
@ -177,8 +179,7 @@ const u8g_fntpgm_uint8_t fontpage_61_241_241[32] U8G_FONT_SECTION("fontpage_61_2
0x00,0x06,0x09,0x09,0x07,0x00,0xFE,0x0C,0x04,0x88,0x88,0x88,0x88,0x70,0x00,0x20
};
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {
static const uxg_fontinfo_t g_fontinfo_vi[] PROGMEM = {
FONTDATA_ITEM(2, 131, 131, fontpage_2_131_131), // 'ă' -- 'ă'
FONTDATA_ITEM(2, 144, 145, fontpage_2_144_145), // 'Đ' -- 'đ'
FONTDATA_ITEM(2, 169, 169, fontpage_2_169_169), // 'ĩ' -- 'ĩ'

7
Marlin/src/lcd/dogm/fontdata/langdata_zh_CN.h

@ -3,7 +3,9 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_64_157_157[26] U8G_FONT_SECTION("fontpage_64_157_157") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x9D,0x9D,0x00,0x07,0x00,0x00,
@ -1462,8 +1464,7 @@ const u8g_fntpgm_uint8_t fontpage_510_154_154[30] U8G_FONT_SECTION("fontpage_510
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x9A,0x9A,0x00,0x08,0x00,0x00,
0x00,0x02,0x07,0x07,0x0C,0x06,0x01,0xC0,0xC0,0x00,0x00,0x00,0xC0,0xC0};
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {
static const uxg_fontinfo_t g_fontinfo_zh_CN[] PROGMEM = {
FONTDATA_ITEM(64, 157, 157, fontpage_64_157_157), // '”' -- '”'
FONTDATA_ITEM(69, 191, 191, fontpage_69_191_191), // '⊿' -- '⊿'
FONTDATA_ITEM(156, 128, 128, fontpage_156_128_128), // '一' -- '一'

7
Marlin/src/lcd/dogm/fontdata/langdata_zh_TW.h

@ -3,7 +3,9 @@
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#include <U8glib-HAL.h>
#pragma once
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_69_191_191[28] U8G_FONT_SECTION("fontpage_69_191_191") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xBF,0xBF,0x00,0x05,0x00,0x00,
@ -1217,8 +1219,7 @@ const u8g_fntpgm_uint8_t fontpage_510_154_154[30] U8G_FONT_SECTION("fontpage_510
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x9A,0x9A,0x00,0x08,0x00,0x00,
0x00,0x02,0x07,0x07,0x0C,0x06,0x01,0xC0,0xC0,0x00,0x00,0x00,0xC0,0xC0};
#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data }
static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {
static const uxg_fontinfo_t g_fontinfo_zh_TW[] PROGMEM = {
FONTDATA_ITEM(69, 191, 191, fontpage_69_191_191), // '⊿' -- '⊿'
FONTDATA_ITEM(156, 128, 128, fontpage_156_128_128), // '一' -- '一'
FONTDATA_ITEM(156, 137, 139, fontpage_156_137_139), // '三' -- '下'

36
Marlin/src/lcd/dogm/marlinui_DOGM.cpp

@ -79,6 +79,18 @@
U8G_CLASS u8g;
#include LANGUAGE_DATA_INCL(LCD_LANGUAGE)
#ifdef LCD_LANGUAGE_2
#include LANGUAGE_DATA_INCL(LCD_LANGUAGE_2)
#endif
#ifdef LCD_LANGUAGE_3
#include LANGUAGE_DATA_INCL(LCD_LANGUAGE_3)
#endif
#ifdef LCD_LANGUAGE_4
#include LANGUAGE_DATA_INCL(LCD_LANGUAGE_4)
#endif
#ifdef LCD_LANGUAGE_5
#include LANGUAGE_DATA_INCL(LCD_LANGUAGE_5)
#endif
#if HAS_LCD_CONTRAST
@ -293,7 +305,29 @@ void MarlinUI::init_lcd() {
TERN_(LCD_SCREEN_ROT_180, u8g.setRot180());
TERN_(LCD_SCREEN_ROT_270, u8g.setRot270());
uxg_SetUtf8Fonts(g_fontinfo, COUNT(g_fontinfo));
update_language_font();
}
void MarlinUI::update_language_font() {
#if HAS_MULTI_LANGUAGE
switch (language) {
default: uxg_SetUtf8Fonts(LANG_FONT_INFO(LCD_LANGUAGE), COUNT(LANG_FONT_INFO(LCD_LANGUAGE))); break;
#ifdef LCD_LANGUAGE_2
case 1: uxg_SetUtf8Fonts(LANG_FONT_INFO(LCD_LANGUAGE_2), COUNT(LANG_FONT_INFO(LCD_LANGUAGE_2))); break;
#endif
#ifdef LCD_LANGUAGE_3
case 2: uxg_SetUtf8Fonts(LANG_FONT_INFO(LCD_LANGUAGE_3), COUNT(LANG_FONT_INFO(LCD_LANGUAGE_3))); break;
#endif
#ifdef LCD_LANGUAGE_4
case 3: uxg_SetUtf8Fonts(LANG_FONT_INFO(LCD_LANGUAGE_4), COUNT(LANG_FONT_INFO(LCD_LANGUAGE_4))); break;
#endif
#ifdef LCD_LANGUAGE_5
case 4: uxg_SetUtf8Fonts(LANG_FONT_INFO(LCD_LANGUAGE_5), COUNT(LANG_FONT_INFO(LCD_LANGUAGE_5))); break;
#endif
}
#else
uxg_SetUtf8Fonts(LANG_FONT_INFO(LCD_LANGUAGE), COUNT(LANG_FONT_INFO(LCD_LANGUAGE)));
#endif
}
// The kill screen is displayed for unrecoverable conditions

3
Marlin/src/lcd/dogm/u8g_fontutf8.h

@ -35,3 +35,6 @@ int uxg_GetUtf8StrPixelWidth(u8g_t *pu8g, const char *utf8_msg);
int uxg_GetUtf8StrPixelWidthP(u8g_t *pu8g, PGM_P utf8_msg);
#define uxg_GetFont(puxg) ((puxg)->font)
#define _LANG_FONT_INFO(L) g_fontinfo_##L
#define LANG_FONT_INFO(L) _LANG_FONT_INFO(L)

2
Marlin/src/lcd/language/language_zh_CN.h

@ -31,7 +31,7 @@ namespace Language_zh_CN {
using namespace Language_en; // Inherit undefined strings from English
constexpr uint8_t CHARSIZE = 3;
PROGMEM Language_Str LANGUAGE = _UxGT("简体中文");
PROGMEM Language_Str LANGUAGE = _UxGT("Simplified Chinese");
PROGMEM Language_Str WELCOME_MSG = MACHINE_NAME _UxGT("已就绪."); //" ready."
PROGMEM Language_Str MSG_MARLIN = _UxGT("马林");

8
Marlin/src/lcd/marlinui.cpp

@ -88,6 +88,14 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
#if HAS_MULTI_LANGUAGE
uint8_t MarlinUI::language; // Initialized by settings.load()
void MarlinUI::set_language(const uint8_t lang) {
if (lang < NUM_LANGUAGES) {
language = lang;
TERN_(HAS_MARLINUI_U8GLIB, update_language_font());
return_to_status();
refresh();
}
}
#endif
#if ENABLED(SOUND_MENU_ITEM)

12
Marlin/src/lcd/marlinui.h

@ -200,13 +200,11 @@ public:
#if HAS_MULTI_LANGUAGE
static uint8_t language;
static inline void set_language(const uint8_t lang) {
if (lang < NUM_LANGUAGES) {
language = lang;
return_to_status();
refresh();
}
}
static void set_language(const uint8_t lang);
#endif
#if HAS_MARLINUI_U8GLIB
static void update_language_font();
#endif
#if ENABLED(SOUND_MENU_ITEM)

Loading…
Cancel
Save