mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-24 06:47:17 +00:00
Merge pull request #15214 from s-hadinger/LVGL-roboto-tapp-improved
LVGL roboto tapp improved
This commit is contained in:
commit
a956f8a0f0
@ -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
|
||||
|
@ -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
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user