Still awaiting the slow boat from China here.Roberthh wrote:...I hope they don't do that for every hole they drill...
I updated the epaper driver on Github yesterday - it now supports fonts as frozen bytecode. You can pass the context manager a fontname or a path to a font. If there are frozen fonts and the name exists it will use that, otherwise it will treat the argument as a path and look for a binary font file.
One minor point regarding text handling. You pass (x, y) to printstring whereas I use the concept of a text cursor. My locate(x, y) method sets its position and subsequent text is rendered from that location, with the cursor location being updated accordingly. Text handling includes line wrap and newline character handling. The advantage here is that application code can output multi-line text without having to perform calculations based on the dimensions of the current font, e.g.
Code: Select all
a.clear_screen()
with a.font('/sd/inconsolata'):
a.puts("Large font\ntext here\n")
a.puts("New line\n")
"Now I must have a break. I just made more than 6 errors in a trivial 3 line python function."
Do I know that feeling! I have whole days like that A result of health issues and mind-altering medication.