Merge pull request #15214 from s-hadinger/LVGL-roboto-tapp-improved

LVGL roboto tapp improved
This commit is contained in:
s-hadinger 2022-03-24 13:02:29 +01:00 committed by GitHub
commit a956f8a0f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 2 deletions

View File

@ -6,9 +6,35 @@ font_robotocondensed_latin1.init = def (m)
import lv
var wd = tasmota.wd # save current working dir
lv.font_robotocondensed_latin1 = def (size)
return lv.load_font("A:" + wd + "robotocondensed_latin1_" + str(size) + ".bin")
class robotocondensed_latin1_loader
var wd
var font_cache
def init(wd)
self.wd = wd
self.font_cache = {}
end
def load_robotocondensed_latin1(sz)
sz = int(sz)
var font
# is the font already embedded?
try
font = lv.font_embedded("robotocondensed", sz)
except ..
end
if (font) return font end
# is the font in our local cache?
font = self.font_cache.find(sz)
if (font) return font end
# load the font from the archive
font = lv.load_font("A:" + wd + "robotocondensed_latin1_" + str(sz) + ".bin")
self.font_cache[sz] = font
return font
end
end
var monad = robotocondensed_latin1_loader(wd)
lv.font_robotocondensed_latin1 = / sz -> monad.load_robotocondensed_latin1(sz)
end
return font_robotocondensed_latin1

View File

@ -0,0 +1,6 @@
#!/bin/bash
set -x #echo on
rm robotocondensed_latin1.tapp
zip -j -0 robotocondensed_latin1.zip autoexec.be robotocondensed_latin1.be robotocondensed_latin1_12.bin robotocondensed_latin1_14.bin robotocondensed_latin1_16.bin robotocondensed_latin1_24.bin robotocondensed_latin1_32.bin
mv robotocondensed_latin1.zip robotocondensed_latin1.tapp