Skip to content

Modified getCharInfo to accomodate for multiple fonts #3

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

Closed

Conversation

iangrahamchristensen
Copy link

The getCharInfo function has been modified to extract the necessary data for decoding different font-maps from whatever font file is being used, and a new font file has been added.

@@ -4,10 +4,12 @@ SparkFun Master Display Library

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

White space changes (presumably cause by different tab width settings) make this diff hard to process.

@oclyke
Copy link
Contributor

oclyke commented Jul 25, 2019

Hi @iangchristensen thanks for making a pull request! I'm not convinced that the addition of another font is the right move for this library and here's why:

  1. Program Memory Access
    • pgm_read_byte() is supported by <avr/pgmspace.h> which is not available in a widely cross-platform form. (For example it is unavailable in the ESP32 Arduino core). I think pgmspace usage will disappear in the near future with access to advanced microcontrollers that are not on the AVR architecture.
    • Otherwise HyperDisplay is (at least very close to) a standard C++ only library that won't require any other dependencies and can run similarly on a microcontroller and a desktop computer.
  2. Hundreds and Thousands and Millions of Cats
    • If include the 8x16 font then should we also include a larger font? What about a sub-pixel rendering font?
    • HyperDisplay provides 'basic'/'generalized' drawing functions that allow you to build up what you want more easily. Fonts, however, tend to be very specific (particularly these MicroView fonts) and I would not want to have to include specific code for each of the above examples.
    • I think it is best to leave the font specification responsibility out of HD. Maybe we can think of a solution that plays nicely?
  3. #defines
    • This is a personal complaint but I do not want to see the code become littered with a sea of #define, #ifdef, and other preprocessor relics. To me the preprocessor is a powerful tool when used correctly and sparingly, but otherwise kind of evil (reminds me that I heard an interesting definition of the word 'evil' wrt SW but I can't find it...)

Next Up?

So... that's my peace. I'd still like to make it easy to integrate fonts with HD though. Can you tell me more about your needs for fonts?

Maybe we can work together to plan / implement a companion library that makes it easy to use not just 1 or 2 fonts but 100 - 1000 fonts! And makes it easy to share fonts that are created by other users... or that makes it easy to use fonts that have already been created for PC use... or that allows you to use extra cool font rendering techniques!

Super Cool Font Stuff

Subpixel Rendering
Font Hinting

PR Comments

I see that this is your first PR. Really thanks again for making it b/c it shows that there is interest in making HD better! I just would recommend that in future PRs you do two things differently:

  1. Use more commits - this can help guide people through the process logically. For example:
    • commit: add new font file "font8x16.h"
    • commit: change includes and configuration
    • commit: modify 'getCharInfo()' to handle new fonts
  2. Keep differences pertinent to functionality - things like big whitespace changes make the changes harder to spot so I keep them out of PRs. Typos and spelling in comments (I think) should be fixed but could use a PR of their own.

@iangrahamchristensen
Copy link
Author

@oclyke I'm definitely interested in possibly getting Subpixel Rendering or Font Hinting working, but I might need a little help getting started. I'm not entirely sure what my needs for new fonts are because I'm doing this as an internship, but from what I understand we just need more font sizes.

Thanks for the pointers on using github--I'm still figuring stuff out.

@oclyke
Copy link
Contributor

oclyke commented Aug 7, 2019

@iangchristensen I will make a new issue regarding font handling in general in cas you or anyone else is interested in continuing the discussion.

@oclyke oclyke closed this Aug 7, 2019
@oclyke oclyke mentioned this pull request Aug 7, 2019
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.

2 participants