Skip to content

Commit

Permalink
HASPmota use 'roboto.ttf' for automatic sizing of default font
Browse files Browse the repository at this point in the history
  • Loading branch information
s-hadinger committed Dec 21, 2024
1 parent f3fcbea commit 243ed25
Show file tree
Hide file tree
Showing 4 changed files with 311 additions and 268 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
- ESP32 disable PSRAM check (and on restart some relay toggles) with `#define DISABLE_PSRAMCHECK true` (#21266)
- TLS disable ECDSA for MQTT to ensure we don't break fingerprints after #22649
- GPIOViewer from v1.5.6 to v1.5.8
- HASPmota use 'roboto.ttf' for automatic sizing of default font

### Fixed
- Berry Zigbee fix wrong attributes (#22684)
Expand Down
16 changes: 15 additions & 1 deletion lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_haspmota.be
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,22 @@ class lvh_root
try
font = lv.font_embedded("robotocondensed", t)
except ..
import path
# try TTF file "roboto.ttf" or "RobotoCondensed-Regular.ttf"
try
font = lv.font_embedded("montserrat", t)
var ttf_name = "roboto.ttf"
if !path.exists(ttf_name)
ttf_name = "RobotoCondensed-Regular.ttf"
if !path.exists(ttf_name)
ttf_name = nil
end
end
if ttf_name != nil
font = lv.load_freetype_font(ttf_name, t, 0)
else
print("HSP: 'roboto.ttf' file missing for size:", t)
return nil
end
except ..
print("HSP: Unsupported font:", t)
return nil
Expand Down
Loading

0 comments on commit 243ed25

Please sign in to comment.