Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» Improve TFT Color UI layout / theme (MarlinFirmware#26077)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <[email protected]>
  • Loading branch information
jmz52 and thinkyhead authored Jul 17, 2023
1 parent 4d6e5c1 commit 244de24
Show file tree
Hide file tree
Showing 189 changed files with 23,068 additions and 4,419 deletions.
9 changes: 9 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -3303,6 +3303,15 @@
*/
#define TFT_FONT NOTOSANS

/**
* TFT Theme for Color_UI. Choose one of the following or add a new one to 'Marlin/src/lcd/tft/themes' directory
*
* BLUE_MARLIN - Default theme with 'midnight blue' background
* BLACK_MARLIN - Theme with 'black' background
* ANET_BLACK - Theme used for Anet ET4/5
*/
#define TFT_THEME BLACK_MARLIN

//#define TFT_SHARED_IO // I/O is shared between TFT display and other devices. Disable async data transfer.
#endif

Expand Down
18 changes: 10 additions & 8 deletions Marlin/src/feature/runout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,16 @@ void event_filament_runout(const uint8_t extruder) {

const bool run_runout_script = !runout.host_handling;

const bool park_or_pause = (false
#ifdef FILAMENT_RUNOUT_SCRIPT
|| strstr(FILAMENT_RUNOUT_SCRIPT, "M600")
|| strstr(FILAMENT_RUNOUT_SCRIPT, "M125")
|| TERN0(ADVANCED_PAUSE_FEATURE, strstr(FILAMENT_RUNOUT_SCRIPT, "M25"))
#endif
);

#if ENABLED(HOST_ACTION_COMMANDS)

const bool park_or_pause = (false
#ifdef FILAMENT_RUNOUT_SCRIPT
|| strstr(FILAMENT_RUNOUT_SCRIPT, "M600")
|| strstr(FILAMENT_RUNOUT_SCRIPT, "M125")
|| TERN0(ADVANCED_PAUSE_FEATURE, strstr(FILAMENT_RUNOUT_SCRIPT, "M25"))
#endif
);

if (run_runout_script && park_or_pause) {
hostui.paused(false);
}
Expand All @@ -127,6 +128,7 @@ void event_filament_runout(const uint8_t extruder) {
SERIAL_ECHOPGM(" " ACTION_REASON_ON_FILAMENT_RUNOUT " ");
SERIAL_CHAR(tool);
SERIAL_EOL();

#endif // HOST_ACTION_COMMANDS

#ifdef FILAMENT_RUNOUT_SCRIPT
Expand Down
9 changes: 8 additions & 1 deletion Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -1781,12 +1781,19 @@
#elif ANY(TFT_1024x600_LTDC, TFT_1024x600_SIM)
#define HAS_UI_1024x600 1
#endif
#if ANY(HAS_UI_320x240, HAS_UI_480x320, HAS_UI_480x272)

#if ANY(HAS_UI_320x240, HAS_UI_480x272)
#if ENABLED(TFT_COLOR_UI_PORTRAIT)
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 8, 9) // Fewer lines with touch buttons onscreen
#else
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) // Fewer lines with touch buttons onscreen
#endif
#elif HAS_UI_480x320
#if ENABLED(TFT_COLOR_UI_PORTRAIT)
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 9, 10) // Fewer lines with touch buttons onscreen
#else
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) // Fewer lines with touch buttons onscreen
#endif
#elif HAS_UI_1024x600
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 12, 13) // Fewer lines with touch buttons onscreen
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Conditionals_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@
#define HAS_MEDIA_SUBCALLS 1
#endif

#if ANY(SHOW_PROGRESS_PERCENT, SHOW_ELAPSED_TIME, SHOW_REMAINING_TIME, SHOW_INTERACTION_TIME)
#if ANY(SHOW_PROGRESS_PERCENT, SHOW_ELAPSED_TIME, SHOW_REMAINING_TIME, SHOW_INTERACTION_TIME) && !HAS_GRAPHICAL_TFT
#define HAS_EXTRA_PROGRESS 1
#endif

Expand Down
44 changes: 22 additions & 22 deletions Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
#if defined(__AVR__) && ENABLED(NOT_EXTENDED_ISO10646_1_5X7)
// reduced font (only symbols 1 - 127) - saves about 1278 bytes of FLASH

/*
Fontname: -Marlin6x12-Fixed-Medium-R-SemiCondensed--12-90-100-100-C-111-ISO10646-1
Copyright: Public domain terminal emulator font. Share and enjoy. original font -Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1
Capital A Height: 7, '1' Height: 7
Calculated Max Values w= 7 h=10 x= 5 y= 5 dx= 7 dy= 0 ascent= 8 len=10
Font Bounding box w=12 h=15 x= 0 y=-2
Calculated Min Values x= 0 y=-2 dx= 0 dy= 0
Pure Font ascent = 7 descent=-2
X Font ascent = 8 descent=-2
Max Font ascent = 8 descent=-2
*/
/**
* Fontname: -Marlin6x12-Fixed-Medium-R-SemiCondensed--12-90-100-100-C-111-ISO10646-1
* Copyright: Public domain terminal emulator font. Share and enjoy. original font -Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1
* Capital A Height: 7, '1' Height: 7
* Calculated Max Values w= 7 h=10 x= 5 y= 5 dx= 7 dy= 0 ascent= 8 len=10
* Font Bounding box w=12 h=15 x= 0 y=-2
* Calculated Min Values x= 0 y=-2 dx= 0 dy= 0
* Pure Font ascent = 7 descent=-2
* X Font ascent = 8 descent=-2
* Max Font ascent = 8 descent=-2
*/
const u8g_fntpgm_uint8_t ISO10646_1_5x7[1324] U8G_FONT_SECTION("ISO10646_1_5x7") = {
0x00,0x0C,0x0F,0x00,0xFE,0x07,0x02,0x25,0x03,0xBB,0x01,0x7F,0xFE,0x08,0xFE,0x08,
0xFE,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0xF0,0xC8,0x88,0x88,0x98,0x78,0x10,0x05,
Expand Down Expand Up @@ -123,17 +123,17 @@ const u8g_fntpgm_uint8_t ISO10646_1_5x7[1324] U8G_FONT_SECTION("ISO10646_1_5x7")
#else
// extended (original) font (symbols 1 - 255)

/*
Fontname: -Marlin6x12-Fixed-Medium-R-SemiCondensed--12-90-100-100-C-111-ISO10646-1
Copyright: Public domain terminal emulator font. Share and enjoy. original font -Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1
Capital A Height: 7, '1' Height: 7
Calculated Max Values w= 7 h=10 x= 5 y= 7 dx= 7 dy= 0 ascent=10 len=10
Font Bounding box w=12 h=15 x= 0 y=-2
Calculated Min Values x= 0 y=-2 dx= 0 dy= 0
Pure Font ascent = 7 descent=-2
X Font ascent = 8 descent=-2
Max Font ascent =10 descent=-2
*/
/**
* Fontname: -Marlin6x12-Fixed-Medium-R-SemiCondensed--12-90-100-100-C-111-ISO10646-1
* Copyright: Public domain terminal emulator font. Share and enjoy. original font -Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1
* Capital A Height: 7, '1' Height: 7
* Calculated Max Values w= 7 h=10 x= 5 y= 7 dx= 7 dy= 0 ascent=10 len=10
* Font Bounding box w=12 h=15 x= 0 y=-2
* Calculated Min Values x= 0 y=-2 dx= 0 dy= 0
* Pure Font ascent = 7 descent=-2
* X Font ascent = 8 descent=-2
* Max Font ascent =10 descent=-2
*/
const u8g_fntpgm_uint8_t ISO10646_1_5x7[2647] U8G_FONT_SECTION("ISO10646_1_5x7") = {
0x00,0x0C,0x0F,0x00,0xFE,0x07,0x02,0x25,0x03,0xBB,0x01,0xFF,0xFE,0x0A,0xFE,0x08,
0xFE,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0xF0,0xC8,0x88,0x88,0x98,0x78,0x10,0x05,
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/lcd/tft/canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*/
#pragma once

#include "tft_color.h"
#include "tft_string.h"
#include "tft_image.h"
#include "tft.h"
Expand Down
31 changes: 14 additions & 17 deletions Marlin/src/lcd/tft/fontdata/Helvetica/Helvetica_14.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,23 @@
*
*/

/*
Fontname: Helvetica
Copyright: Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
Capital A Height: 14, '1' Height: 13
Calculated Max Values w=16 h=18 x= 2 y=12 dx=18 dy= 0 ascent=16 len=36
Font Bounding box w=18 h=19 x= 0 y=-4
Calculated Min Values x= 0 y=-4 dx= 0 dy= 0
Pure Font ascent =14 descent=-4
X Font ascent =14 descent=-4
Max Font ascent =16 descent=-4
*/
/**
* Fontname: Helvetica
* Copyright: Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
* Capital A Height: 14, '1' Height: 13
* Calculated Max Values w=16 h=18 x= 2 y=12 dx=18 dy= 0 ascent=16 len=36
* Font Bounding box w=18 h=19 x= 0 y=-4
* Calculated Min Values x= 0 y=-4 dx= 0 dy= 0
* Pure Font ascent =14 descent=-4
* X Font ascent =14 descent=-4
* Max Font ascent =16 descent=-4
*/

#include "../../../../inc/MarlinConfigPre.h"
#include "../fontdata.h"

#define HELVETICA 123
#if HAS_GRAPHICAL_TFT && TFT_FONT == HELVETICA

#include <stdint.h>

// Helvetica Symbols, capital 'A' heigth: 14px
// Helvetica Symbols, capital 'A' height: 14px
extern const uint8_t Helvetica_Symbols_14[43] = {
129,14,8,0,9,0,16,252, // unifont_t
// 0x08 - LCD_STR_THERMOMETER a.k.a 0x1f321 🌑
Expand All @@ -48,7 +45,7 @@ extern const uint8_t Helvetica_Symbols_14[43] = {
5,5,5,7,1,8,112,216,136,216,112,
};

// Helvetica, capital 'A' heigth: 14px
// Helvetica, capital 'A' height: 14px
extern const uint8_t Helvetica_14[4831] = {
129,14,32,0,255,0,16,252, // unifont_t
// 0x0020 " "
Expand Down
31 changes: 14 additions & 17 deletions Marlin/src/lcd/tft/fontdata/Helvetica/Helvetica_19.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,23 @@
*
*/

/*
Fontname: -Adobe-Helvetica-Medium-R-Normal--25-180-100-100-P-130-ISO10646-1
Copyright: Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
Capital A Height: 19, '1' Height: 18
Calculated Max Values w=22 h=24 x= 3 y=16 dx=25 dy= 0 ascent=24 len=69
Font Bounding box w=28 h=37 x=-3 y=-8
Calculated Min Values x=-1 y=-5 dx= 0 dy= 0
Pure Font ascent =19 descent=-5
X Font ascent =19 descent=-5
Max Font ascent =24 descent=-5
*/
/**
* Fontname: -Adobe-Helvetica-Medium-R-Normal--25-180-100-100-P-130-ISO10646-1
* Copyright: Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
* Capital A Height: 19, '1' Height: 18
* Calculated Max Values w=22 h=24 x= 3 y=16 dx=25 dy= 0 ascent=24 len=69
* Font Bounding box w=28 h=37 x=-3 y=-8
* Calculated Min Values x=-1 y=-5 dx= 0 dy= 0
* Pure Font ascent =19 descent=-5
* X Font ascent =19 descent=-5
* Max Font ascent =24 descent=-5
*/

#include "../../../../inc/MarlinConfigPre.h"
#include "../fontdata.h"

#define HELVETICA 123
#if HAS_GRAPHICAL_TFT && TFT_FONT == HELVETICA

#include <stdint.h>

// Helvetica Symbols, capital 'A' heigth: 19px
// Helvetica Symbols, capital 'A' height: 19px
extern const uint8_t Helvetica_Symbols_19[45] = {
129,19,8,0,9,0,24,251, // unifont_t
// 0x08 - LCD_STR_THERMOMETER a.k.a 0x1f321 🌑
Expand All @@ -49,7 +46,7 @@ extern const uint8_t Helvetica_Symbols_19[45] = {
};


// Helvetica, capital 'A' heigth: 19px
// Helvetica, capital 'A' height: 19px
extern const uint8_t Helvetica_19[7298] = {
129,19,32,0,255,0,24,251, // unifont_t
// 0x0020 " "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@
*
*/

#include "../../../../../inc/MarlinConfigPre.h"
#include "../../fontdata.h"

#define NOTOSANS 123
#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS

#include <stdint.h>

// NotoSans Medium 19pt, capital 'A' heigth: 14px, width: 100%, range: 0x0020-0x00ff
// NotoSans Medium 19pt, capital 'A' height: 14px, width: 100%, range: 0x0020-0x00ff
extern const uint8_t NotoSans_Medium_14[8358] = {
130,14,32,0,255,0,18,251, // unifont_t
// 0x0020 " "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@
*
*/

#include "../../../../../inc/MarlinConfigPre.h"
#include "../../fontdata.h"

#define NOTOSANS 123
#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS

#include <stdint.h>

// NotoSans Medium ASCII 19pt, capital 'A' heigth: 14px, width: 100%, range: 0x0020-0x007e
// NotoSans Medium ASCII 19pt, capital 'A' height: 14px, width: 100%, range: 0x0020-0x007e
extern const uint8_t NotoSans_Medium_ASCII_14[3865] = {
130,14,32,0,126,0,18,251, // unifont_t
// 0x0020 " "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@
*
*/

#include "../../../../../inc/MarlinConfigPre.h"
#include "../../fontdata.h"

#define NOTOSANS 123
#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS

#include <stdint.h>

// NotoSans Medium Cyrillic 19pt, capital 'A' heigth: 14px, width: 100%, range: 0x0401-0x0491, glyphs: 74
// NotoSans Medium Cyrillic 19pt, capital 'A' height: 14px, width: 100%, range: 0x0401-0x0491, glyphs: 74
extern const uint8_t NotoSans_Medium_Cyrillic_14[3616] = {
130,14,1,4,145,4,18,251, // unifont_t
// 0x0401 Ё
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@
*
*/

#include "../../../../../inc/MarlinConfigPre.h"
#include "../../fontdata.h"

#define NOTOSANS 123
#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS

#include <stdint.h>

// NotoSans Medium Greek 19pt, capital 'A' heigth: 14px, width: 100%, range: 0x0386-0x03ce, glyphs: 63
// NotoSans Medium Greek 19pt, capital 'A' height: 14px, width: 100%, range: 0x0386-0x03ce, glyphs: 63
extern const uint8_t NotoSans_Medium_Greek_14[3253] = {
130,14,134,3,206,3,18,251, // unifont_t
// 0x0386 Ξ†
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@
*
*/

#include "../../../../../inc/MarlinConfigPre.h"
#include "../../fontdata.h"

#define NOTOSANS 123
#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS

#include <stdint.h>

// NotoSans Medium Katakana 19pt, capital 'A' heigth: 14px, width: 100%, range: 0x30a0-0x8868, glyphs: 103
// NotoSans Medium Katakana 19pt, capital 'A' height: 14px, width: 100%, range: 0x30a0-0x8868, glyphs: 103
extern const uint8_t NotoSans_Medium_Katakana_14[7913] = {
162,14,160,48,104,136,18,251, // unifont_t
// 0x30a0 γ‚ 
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@
*
*/

#include "../../../../../inc/MarlinConfigPre.h"
#include "../../fontdata.h"

#define NOTOSANS 123
#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS

#include <stdint.h>

// NotoSans Medium Korean 19pt, capital 'A' heigth: 14px, width: 100%, range: 0xac70-0xd788, glyphs: 110
// NotoSans Medium Korean 19pt, capital 'A' height: 14px, width: 100%, range: 0xac70-0xd788, glyphs: 110
extern const uint8_t NotoSans_Medium_Korean_14[8848] = {
162,14,112,172,136,215,18,251, // unifont_t
// 0xac70 κ±°
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@
*
*/

#include "../../../../../inc/MarlinConfigPre.h"
#include "../../fontdata.h"

#define NOTOSANS 123
#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS

#include <stdint.h>

// NotoSans Medium Latin Extended-A 19pt, capital 'A' heigth: 14px, width: 100%, range: 0x0100-0x017f
// NotoSans Medium Latin Extended-A 19pt, capital 'A' height: 14px, width: 100%, range: 0x0100-0x017f
extern const uint8_t NotoSans_Medium_Latin_Extended_A_14[6668] = {
130,14,0,1,127,1,18,251, // unifont_t
// 0x0100 Δ€
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@
*
*/

#include "../../../../../inc/MarlinConfigPre.h"
#include "../../fontdata.h"

#define NOTOSANS 123
#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS

#include <stdint.h>

// NotoSans Medium Simplified Chinese 19pt, capital 'A' heigth: 14px, width: 100%, range: 0x201c-0xff1a, glyphs: 373
// NotoSans Medium Simplified Chinese 19pt, capital 'A' height: 14px, width: 100%, range: 0x201c-0xff1a, glyphs: 373
extern const uint8_t NotoSans_Medium_Simplified_Chinese_14[37028] = {
162,14,28,32,26,255,18,251, // unifont_t
// 0x201c β€œ
Expand Down
Loading

0 comments on commit 244de24

Please sign in to comment.