A font library and writer for small OLED and LCD displays using the framebuffer #14455
Replies: 3 comments 10 replies
-
I trust you've checked the legal status of these fonts. The reason my repo includes a minimal selection of Python fonts is that I wanted to be sure that the source As a general point I think it would help users to clarify the differences - and the commonality - between our approaches. Benefits of PyEZfonts:
Functionality provided by different means:
Benefits of font-to-py:
I think it's also worth stating that, because your fonts were created with |
Beta Was this translation helpful? Give feedback.
-
That's a good explanation of the differences, thank you. Another advantage of your tools is that they give you control over padding, and do reverse fonts. Copyright got some serious consideration, this isn't my first time in this swamp.. The fonts here are safe to redistribute.
The only fonts that were not specifically created and released as open source are the X11 ones. Those are freely redistributable so long as the copyright notice is preserved, but not properly open (as evidenced by their history with XOrg & XFree). They are, however, very useful and so are included here. Thinking about this it is a very good idea for me to:
|
Beta Was this translation helpful? Give feedback.
-
Hello, Just wanted to give you a heads up that I have included PyEZfonts in MPDisplay. I see you have linked to MPDisplay and I appreciate that very much. I chose to include your font class because:
I had to subclass it as EZFont to make _put_char able to write using the .pixel() method as opposed to writing directly into bytearray or memoryview because one the targets I write to is the display driver itself, which ISN'T subclassed from framebuffer. That gives it the ability to write to any object with ,height and ,width attributes and a .pixel() method, not just framebuffers. I need to make it return an Area object like the rest of the drawing primitives in MPDisplay. That return object may be used by the end-user to update smaller regions of the diplay instead of the whole thing. Great work! |
Beta Was this translation helpful? Give feedback.
-
This is something that came out of a couple of projects I am working on; both need to display simple status and value information on small monochrome displays.
I struggled to find a simple way to do 'big' fonts on their small displays; most of the alternatives are either too complex (LVGL) or specialised, eg; 'here are the 3 fonts + hacked driver I made for my project'.
I missed having something like the
u8g2
font+driver system that I've used for arduino/C projects. @peterhinch 'swriter
class comes closest, but still left me having to source and convert fonts.So, I used Peters excellent work as a basis and created my own font library, and a simple writer class to use them.
Proudly Presenting:
https://github.com/easytarget/microPyEZfonts
There are 90'ish font/size combinations from 5px to 64px height, the selection includes helvetica, times, courier and new century. Plus a number of other appropriate fonts such as spleen, tom-thumb, u8g2 native, plus some symbol, battery and 7-segment fonts. Each comes in 3 flavors; 'all', 'ascii' and 'numeric' to help with memory considerations.
All these can be used with Peters
writer
class and hisnano-gui
.There is also a simplified font writer class that supports any framebuffer compatible display:
ezFBfont
class initialised against it.font.write(str,x,y)
, and optionally provide the same color and alignment arguments as above.font.rect()
method that takes the same arguments aswrite()
and returnsx
,y
,w
,h
values that can be passed to theframebuffer.rect()
method to clean the written text.That's pretty much it; There is a veritable TL;DR of documentation in the repo, with working examples etc.
Beta Was this translation helpful? Give feedback.
All reactions