- glcd: add pakenham.ttf as a seperate font

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2020-06-28 22:11:17 +02:00
committed by Thilo Graf
parent b5bc1ca77f
commit 6e8987a8ba
3 changed files with 8 additions and 2 deletions

View File

@@ -1,6 +1,12 @@
installdir = $(FONTDIR)/oled
# NOTE: led.ttf is used for the LED clock in standby mode
# lcd.ttf is used for the LCD clock in standby mode
# pakenham.ttf is used for the temperature digits
# terminator.ttf is used for the status markers
install_DATA = \
led.ttf \
lcd.ttf \
pakenham.ttf \
terminator.ttf

Binary file not shown.

View File

@@ -143,11 +143,11 @@ void WeatherUpdateFonts(void)
{
cGLCD *cglcd = cGLCD::getInstance();
int fontsize_temperature = 0;
int percent_temperature = std::min(24, 100);
int percent_temperature = std::min(24, 100); // WTF?
int fontsize_temperature_new = percent_temperature * cglcd->lcd->Height() / 100;
if (!fonts_initialized || (fontsize_temperature_new != fontsize_temperature)) {
fontsize_temperature = fontsize_temperature_new;
if (!font_temperature.LoadFT2(FONTDIR "/pakenham.ttf", "UTF-8", fontsize_temperature)) {
if (!font_temperature.LoadFT2(FONTDIR "/oled/pakenham.ttf", "UTF-8", fontsize_temperature)) {
font_temperature.LoadFT2(g_settings.font_file, "UTF-8", fontsize_temperature);
}
}