-
Notifications
You must be signed in to change notification settings - Fork 657
Allow overriding default font #238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow overriding default font #238
Conversation
Added a global to allow changing of the default font
Changed setFont to use global OLEDDISPLAY_DEFAULTFONT
Changes due to travis ci warnings
…default font. I believe this is a very important feature because it eliminates the memory requirement for a font never being used.
|
I created a branch of the OLED library and added a lot of enhancements including mbed-os support in addition to Arduino support. All enhancements should be backward compatible. As ThingPulse does not work on merges/enhancements for some time, I added your enhancement to my branch: https://github.com/helmut64/OLED_SSD1306/tree/mbed_os_support I merged your pull request into my branch (mbed_os_support ) and hope that my branch gets adapted by ThingPulse, otherwise I continue with the OLED library on github account. Merged pull request #238 to overwrite the default font. |
|
@helmut64 same comment from my side as with #247.
Why XOR instead of both? IMO it's useful to be able to set the default font on init and through dedicated function. We could merge this one and then layer your addition on top of it in a follow-up PR, no? |
|
@marcelstoer at present the default font ArialMT_Plain_10 (2731 bytes in flash) is referenced and therfore eats this flash memory, even you you never use it. A dedicated function will not work because:
PS: My friend from Arduino Hannover has use cases for Flipdot displays which works with the AVR therefore flash memory is limited. The Flipdot also uses optimized custom fonts (e.g. 8x7) |
|
I see your point. I didn't know that you're primarily concerned about memory consumption.
Well, it will work but it comes at the cost of potentially wasting some memory as you correctly pointed out. In some setups this may be acceptable, in others it won't. So, it'd be totally ok for me to drop this PR and accept a new one from you that implements the optional |
|
Sounds good and should work as well for smurf0969. |
Hadn't realized that this feature is already in your Mbed OS branch (#243). |
Some small changes that allow changing the default font by setting a define.