Skip to content
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

Multi size #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Multi size #2

wants to merge 2 commits into from

Conversation

sshipman
Copy link

Added support for other text sizes, and re-organized the code for platformio src and lib conventions, which also makes Arduino compatibility simpler.

@sshipman
Copy link
Author

Apologies for combining the changes with the re-org, I see it makes reviewing more difficult. In tb_display.cpp, please look at the new drawChar function which uses the M5.Lcd.drawChar(int32_t x, int32_t y, uint16_t c, uint32_t color, uint32_t bg, uint8_t size) rather than M5.Lcd.drawChar(int16_t uniCode, int32_t x, uint16_t y, uint8_t font); Use of the font version was the main thing keeping other text sizes from working.
Obviously, all the TEXT_HEIGHT stuff had to be moved to use something derived form text_size.
Miscellaneous changes include back-calculating the y coord of the first line which may now draw a partial line, and cleaning up init, which didn't need to switch-case. The use of the other drawchar made foreground and background colors explicit, so those are included as well. I'd have liked to be able to get them from M5.Lcd, but that doesn't seem to be available.

@sshipman sshipman marked this pull request as ready for review November 29, 2020 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant