I just (re)wrote my font converter for hex font (unscii, unifont)., so that you don’t need to go hex -> ttf -> lv_font
If you found it useful it’s here: https://gitlab.com/sdalu/hex2lvfont
I just (re)wrote my font converter for hex font (unscii, unifont)., so that you don’t need to go hex -> ttf -> lv_font
If you found it useful it’s here: https://gitlab.com/sdalu/hex2lvfont
forgot I had it here, I’m sending a pull request. I’ll let you update the README.md
Merged, thank you!
I am trying to use but running into problems.
$ ruby --version
ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]
When I execute the program I get the following.
$ ruby hex2lvfont.rb unscii-8.hex --height 8 --bpp 1
hex2lvfont.rb:52:in `from_hex': undefined method `unpack1' for #<String:0x00000001764ed0> (NoMethodError)
Did you mean? unpack
from hex2lvfont.rb:64:in `block in from_hexfile'
from hex2lvfont.rb:62:in `foreach'
from hex2lvfont.rb:62:in `with_index'
from hex2lvfont.rb:62:in `each'
from hex2lvfont.rb:62:in `map'
from hex2lvfont.rb:62:in `from_hexfile'
from hex2lvfont.rb:433:in `<main>'
Maybe the steps I did are not correct.
Also from the program --help
unpack1 is defined in ruby >= 2.4.
doc says: Decodes str (which may contain binary data) according to the format string, returning the first value extracted. See also String#unpack
, Array#pack
.
it should be possible to replace unpack1 or monkey patch the string class. The following should do the trick:
class String
def unpack1(format)
self.unpack(format).first
end
end