From ec0671a64db2766e3f894e0d73c387611489f381 Mon Sep 17 00:00:00 2001 From: Madelena Mak Date: Mon, 7 Nov 2022 23:52:55 -0500 Subject: [PATCH] Use text instead of image for titles. Saves space! --- weatherman.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/weatherman.yaml b/weatherman.yaml index 28030cb..0ed0428 100644 --- a/weatherman.yaml +++ b/weatherman.yaml @@ -59,6 +59,7 @@ wifi: ssid: "Esphome-Web-901078" password: "2JOrpBYEHQsV" + # Include custom fonts font: - file: 'fonts/GothamRnd-Book.ttf' @@ -68,6 +69,10 @@ font: id: font_large_bold size: 108 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' id: font_medium_bold size: 30 @@ -77,6 +82,7 @@ font: size: 18 # glyphs: ['°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C', 'M', 'I', 'N'] + # Include Material Design Icons font # Thanks to https://community.home-assistant.io/t/display-materialdesign-icons-on-esphome-attached-to-screen/199790/16 - 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..."); } else { // 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()); @@ -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); // Train Service Section - 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.image(0, 420, id(title_train)); + 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(330, 536, id(font_small_bold), color_white, TextAlign::TOP_CENTER, "TO CANARSIE");