Use text instead of image for titles. Saves space!

pull/10/head
Madelena Mak 2 years ago
parent 0e96981f58
commit ec0671a64d

@ -59,6 +59,7 @@ wifi:
ssid: "Esphome-Web-901078" ssid: "Esphome-Web-901078"
password: "2JOrpBYEHQsV" password: "2JOrpBYEHQsV"
# Include custom fonts # Include custom fonts
font: font:
- file: 'fonts/GothamRnd-Book.ttf' - file: 'fonts/GothamRnd-Book.ttf'
@ -68,6 +69,10 @@ font:
id: font_large_bold id: font_large_bold
size: 108 size: 108
glyphs: [' ', '°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C'] glyphs: [' ', '°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C']
- file: 'fonts/GothamRnd-Bold.ttf'
id: font_title
size: 54
glyphs: ['W', 'E', 'A', 'T', 'H', 'R', 'L', 'I', 'N', ' ']
- file: 'fonts/GothamRnd-Bold.ttf' - file: 'fonts/GothamRnd-Bold.ttf'
id: font_medium_bold id: font_medium_bold
size: 30 size: 30
@ -77,6 +82,7 @@ font:
size: 18 size: 18
# glyphs: ['°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C', 'M', 'I', 'N'] # glyphs: ['°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C', 'M', 'I', 'N']
# Include Material Design Icons font # Include Material Design Icons font
# Thanks to https://community.home-assistant.io/t/display-materialdesign-icons-on-esphome-attached-to-screen/199790/16 # Thanks to https://community.home-assistant.io/t/display-materialdesign-icons-on-esphome-attached-to-screen/199790/16
- file: 'fonts/materialdesignicons-webfont.ttf' - file: 'fonts/materialdesignicons-webfont.ttf'
@ -415,7 +421,8 @@ display:
it.printf(0, 420, id(font_small_bold), color_white, TextAlign::TOP_CENTER, "Waiting for data..."); it.printf(0, 420, id(font_small_bold), color_white, TextAlign::TOP_CENTER, "Waiting for data...");
} else { } else {
// Weather Section // Weather Section
it.image(0, 88, id(title_weather)); // it.image(0, 88, id(title_weather));
it.printf(240, 84, id(font_title), color_text, TextAlign::TOP_CENTER, "WEATHER");
it.printf(100, 158, id(font_mdi_large), color_white, TextAlign::TOP_CENTER, "%s", weather_icon_map[id(weather_condition_now).state.c_str()].c_str()); it.printf(100, 158, id(font_mdi_large), color_white, TextAlign::TOP_CENTER, "%s", weather_icon_map[id(weather_condition_now).state.c_str()].c_str());
@ -438,8 +445,8 @@ display:
it.printf(375, 354, id(font_small_bold), color_white, TextAlign::TOP_CENTER, "%2.0f°C", id(weather_temperature_3).state); it.printf(375, 354, id(font_small_bold), color_white, TextAlign::TOP_CENTER, "%2.0f°C", id(weather_temperature_3).state);
// Train Service Section // Train Service Section
it.image(0, 420, id(title_train)); // it.image(0, 420, id(title_train));
it.printf(240, 480, id(font_medium_bold), color_white, TextAlign::TOP_CENTER, "%s", id(train_status).state.c_str()); it.printf(240, 408, id(font_title), color_text, TextAlign::TOP_CENTER, "L TRAIN");
it.print(150, 536, id(font_small_bold), color_white, TextAlign::TOP_CENTER, "TO MANHATTAN"); it.print(150, 536, id(font_small_bold), color_white, TextAlign::TOP_CENTER, "TO MANHATTAN");
it.print(330, 536, id(font_small_bold), color_white, TextAlign::TOP_CENTER, "TO CANARSIE"); it.print(330, 536, id(font_small_bold), color_white, TextAlign::TOP_CENTER, "TO CANARSIE");

Loading…
Cancel
Save