-
Notifications
You must be signed in to change notification settings - Fork 6
Alternative Font Sizes #2
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
Comments
@iangchristensen thanks for the issue, I'll try to provide a little guidance. BreakdownThere are two main components here:
Character Drawing in HyperDisplayFundamentally HyperDisplay only needs to know how to set a given (X,Y) pixel to the color of your choice in order to make use of all the more advanced drawing functions, including fonts. For example
To better understand how
To get a different character to show up the information inside
As you can see there are two versions of Interpreting MicroView 'font5x7.h'Refer to the
Basically what those steps mean is that [each byte in the 5x7 font map represents 1/5 vertical columns of an 8-pixel tall character}(https://learn.sparkfun.com/tutorials/microview-hookup-guide/creating-fonts-for-microview). That mapping obviously can't apply directly to the 8x16 font - more likely that some pair of two bytes will represent 1/8 vertical column of the 16-pixel tall character. I can't say for sure which two bytes that would be... I vaguely remember that the top and bottom halves might be separated by a great distance within the font map. I don't know of a good place to find this information out other than just drawing it out on graph paper (that's what I had to do when I was looking at these fonts as well) Other Ways to Custom Font in HyperDisplayHyperDisplay is meant to be very flexible, so there are several ways that you can implement a custom font. Before working on HyperDisplay I tried out some similar ideas in the RGB OLED Arduino Library. You can check out the custom font example here. My favorite font was the 'QR Code Font' which took the 8-bit number for a given character and displayed it as a 2x4 area of blocks, and cycled through the rainbow as you typed. Custom Font with Character InfoYou can change
And then the default HyperDisplay Note to self: Current default Custom Font by Overwriting
|
@iangchristensen by your pull request I assume that you got this working? I've added the explanation to the wiki (which can be contributed to via this repo: https://github.com/sparkfun/SparkFun_HyperDisplay-wiki). |
Subject of the issue
I'm attempting to add alternative font sizes to the HyperDisplay library.
Your workbench
The microcontroller is a SparkFun ESP32 Thing
The display is a SparkFun TFT LCD Breakout 1.8" screen with 128x160 pixels
Steps to reproduce
I've attempted to add an alternative font size to the hyperdisplay library, but I would appreciate some help. I began by adding the microview 8x16font.h bitmap from geekammo's repository (https://github.com/geekammo/MicroView-Arduino-Library/blob/master/font8x16.h). I copied the getCharInfo() method in hyperdisplay.cpp, and I'm attempting to rework the algorithm for the 8x16font.h, however, I'm running into some issues. When I try writing out the bitmap on graphing paper I end up with gibberish, and the size is still 5x7 unless I swap indi and indj here (I don't think this is a valid option):
From what I understand, the display does not support fonts with heights larger than eight pixels. Each character has to be split into two pieces that are displayed seperately with one below the other giving the illusion of a single character. I'm still running into issues though.
Here is the link to my modified code that I'll push to your repo once I've finished:
https://github.com/iangchristensen/SparkFun_HyperDisplay_Library/blob/master/SparkFun_HyperDisplay_Library/src/hyperdisplay.cpp
Expected behaviour
The HyperDisplay should generate a font that is 8x16.
Actual behaviour
Text continues to print in 5x7 and prints gibberish rather than the specified characters.
The text was updated successfully, but these errors were encountered: