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

Include fonts individually #32

Merged

Conversation

lutorm
Copy link
Contributor

@lutorm lutorm commented Apr 2, 2021

I'm extremely constrained on the amount of program space I have so this change makes it possible to not just exclude the large character font but all the others individually.

@lutorm lutorm force-pushed the include-fonts-individually branch from d09e522 to 0a9a233 Compare April 2, 2021 23:25
@PaulZC
Copy link
Contributor

PaulZC commented Apr 3, 2021

Hi Patrik (@lutorm ),
Thank you for submitting this PR!
Can you please re-target it at the release_candidate branch so we can test it? Instructions are here.
Thank you,
Paul

@lutorm lutorm changed the base branch from master to release_candidate April 3, 2021 06:35
@lutorm
Copy link
Contributor Author

lutorm commented Apr 3, 2021

@PaulZC done. Sorry I didn't read your CONTRIBUTING file... ;-)

@PaulZC
Copy link
Contributor

PaulZC commented Apr 3, 2021

Thank you Patrik,
I'll get this merged and tested as soon as I can.
Best wishes,
Paul

@PaulZC PaulZC merged commit edcf45b into sparkfun:release_candidate Apr 3, 2021
PaulZC added a commit that referenced this pull request Apr 3, 2021
@PaulZC
Copy link
Contributor

PaulZC commented Apr 3, 2021

Hi Patrik (@lutorm ),
I could not see where you were defining INCLUDE_FONT0, INCLUDE_FONT1 etc.. Did you forget to do that? Or maybe you do that in your code?
Anyway, it made me wonder if there was a different way of doing it.
Please pull the release_candidate branch and have a look at the latest changes. You can now comment the #include for the unwanted font header files, and they will be excluded. It is the same as your code, but uses the #define from each header file instead.
I also updated getTotalFonts.
Let me know what you think.
Best wishes,
Paul

@lutorm
Copy link
Contributor Author

lutorm commented Apr 3, 2021

Hi Paul,

I didn't do it that way because I don't want to have to make changes to the source file for the library to change which fonts a project is built with. Instead, I'm adding the -DINCLUDE_FONT0 etc to the compiler flags in the Makefiles of the individual projects.

@PaulZC
Copy link
Contributor

PaulZC commented Apr 3, 2021

Hi Patrik,
Ah, ok. The problem is that we need a solution which will work for most users, and most users are using the Arduino IDE where it is difficult to change the compiler flags.
If you want to add compiler flags to disable individual fonts, I’m ok with that.
Best wishes,
Paul

@lutorm
Copy link
Contributor Author

lutorm commented Apr 3, 2021

Ah, good point. Yeah that would work, too. Do you want me to make that change?

@PaulZC
Copy link
Contributor

PaulZC commented Apr 3, 2021

Yes please - it is just about bedtime here ;-)
Please cover all the options. Something like:

#if defined(DISABLE_FONT0) // Compiler flag
0x0,
#elif defined(FONT5X7_H) // Font header file
font5x7,
#else
0x0,
#endif

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