Skip to content

Exclude either by defining or by changing the default. #33

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 32 additions & 13 deletions src/SFE_MicroOLED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,41 +53,60 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define PROGMEM __attribute__((section(".progmem.data")))
#endif

// Add header of the fonts here. Comment as many as possible to conserve FLASH memory.
#include "util/font5x7.h" // Comment this line if you do not need the 5x7 font
#include "util/font8x16.h" // Comment this line if you do not need the 8x16 font
#include "util/fontlargenumber.h" // Comment this line if you do not need the large number font
#include "util/7segment.h" // Comment this line if you do not need the 7segment font
// The 31x48 font is handy, but uses a big chunk of flash memory - about 7k.
// If you want to use this font, uncomment the line below:
//#include "util/fontlargeletter31x48.h"
// Add header of the fonts here. Fonts that aren't included below are
// eliminated by the compiler.
#include "util/font5x7.h"
#include "util/font8x16.h"
#include "util/fontlargenumber.h"
#include "util/7segment.h"
#include "util/fontlargeletter31x48.h"

#define MAXFONTS 5 // Do not change this line

// To save flash memory, change these to zeros for the fonts you do
// not want. In particular, the 31x48 font is handy, but uses a big
// chunk of flash memory - about 7k. It is excluded by default.
#ifndef INCLUDE_FONT_5x7
#define INCLUDE_FONT_5x7 1
#endif
#ifndef INCLUDE_FONT_8x16
#define INCLUDE_FONT_8x16 1
#endif
#ifndef INCLUDE_FONT_7SEG
#define INCLUDE_FONT_7SEG 1
#endif
#ifndef INCLUDE_FONT_LARGENUMBER
#define INCLUDE_FONT_LARGENUMBER 1
#endif
#ifndef INCLUDE_FONT_LARGELETTER
#define INCLUDE_FONT_LARGELETTER 0
#endif


// Add the font name as declared in the header file. Remove as many
// as possible to conserve FLASH memory.
const unsigned char *MicroOLED::fontsPointer[] = {
#ifdef FONT5X7_H
#if INCLUDE_FONT_5x7
font5x7,
#else
0x0,
#endif
#ifdef FONT8X16_H
#if INCLUDE_FONT_8x16
font8x16,
#else
0x0,
#endif
#ifdef FONT7SEGMENT_H
#if INCLUDE_FONT_7SEG
sevensegment,
#else
0x0,
#endif
#ifdef FONTLARGENUMBER_H
#if INCLUDE_FONT_LARGENUMBER
fontlargenumber,
#else
0x0,
#endif
#ifdef FONTLARGELETTER31X48_H
#if INCLUDE_FONT_LARGELETTER
fontlargeletter31x48
#else
0x0
Expand Down