aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gdisp/mcufont/mf_bwfont.c5
-rw-r--r--src/gdisp/mcufont/mf_config.h9
-rw-r--r--src/gdisp/mcufont/mf_encoding.c5
-rw-r--r--src/gdisp/mcufont/mf_font.c5
-rw-r--r--src/gdisp/mcufont/mf_justify.c5
-rw-r--r--src/gdisp/mcufont/mf_kerning.c5
-rw-r--r--src/gdisp/mcufont/mf_rlefont.c4
-rw-r--r--src/gdisp/mcufont/mf_scaledfont.c3
-rw-r--r--src/gdisp/mcufont/mf_wordwrap.c4
9 files changed, 44 insertions, 1 deletions
diff --git a/src/gdisp/mcufont/mf_bwfont.c b/src/gdisp/mcufont/mf_bwfont.c
index b185b57f..8dc88f9d 100644
--- a/src/gdisp/mcufont/mf_bwfont.c
+++ b/src/gdisp/mcufont/mf_bwfont.c
@@ -6,6 +6,9 @@
*/
#include "mf_bwfont.h"
+
+#ifndef MF_NO_COMPILE
+
#include <stdbool.h>
/* Find the character range and index that contains a given glyph.. */
@@ -139,3 +142,5 @@ uint8_t mf_bwfont_character_width(const struct mf_font_s *font,
return get_width(range, index);
}
+
+#endif //MF_NO_COMPILE
diff --git a/src/gdisp/mcufont/mf_config.h b/src/gdisp/mcufont/mf_config.h
index 317e36f5..36268c6b 100644
--- a/src/gdisp/mcufont/mf_config.h
+++ b/src/gdisp/mcufont/mf_config.h
@@ -10,8 +10,16 @@
#ifndef _MF_CONFIG_H_
#define _MF_CONFIG_H_
+/*******************************************************
+ * Configuration settings related to GFX *
+ *******************************************************/
+
#include <gfx.h>
+#if !GFX_USE_GDISP || !GDISP_NEED_TEXT
+ #define MF_NO_COMPILE // Don't compile any font code
+#endif
+
/* Prevent double definitions of standard int types */
#define MF_NO_STDINT_H
@@ -29,7 +37,6 @@
#define MF_USE_ADVANCED_WORDWRAP 0
#define MF_USE_JUSTIFY 0
-
/*******************************************************
* Configuration settings related to build environment *
*******************************************************/
diff --git a/src/gdisp/mcufont/mf_encoding.c b/src/gdisp/mcufont/mf_encoding.c
index e0c89355..86ef54d9 100644
--- a/src/gdisp/mcufont/mf_encoding.c
+++ b/src/gdisp/mcufont/mf_encoding.c
@@ -7,6 +7,8 @@
#include "mf_encoding.h"
+#ifndef MF_NO_COMPILE
+
#if MF_ENCODING == MF_ENCODING_UTF8
mf_char mf_getchar(mf_str *str)
@@ -89,3 +91,6 @@ void mf_rewind(mf_str *str)
}
#endif
+
+#endif //MF_NO_COMPILE
+
diff --git a/src/gdisp/mcufont/mf_font.c b/src/gdisp/mcufont/mf_font.c
index 60350d99..7a4ebf95 100644
--- a/src/gdisp/mcufont/mf_font.c
+++ b/src/gdisp/mcufont/mf_font.c
@@ -6,6 +6,9 @@
*/
#include "mf_font.h"
+
+#ifndef MF_NO_COMPILE
+
#include <stdbool.h>
/* This will be made into a list of included fonts using macro magic. */
@@ -82,3 +85,5 @@ const struct mf_font_list_s *mf_get_font_list()
return MF_INCLUDED_FONTS;
}
+#endif //MF_NO_COMPILE
+
diff --git a/src/gdisp/mcufont/mf_justify.c b/src/gdisp/mcufont/mf_justify.c
index 598c0787..857777cd 100644
--- a/src/gdisp/mcufont/mf_justify.c
+++ b/src/gdisp/mcufont/mf_justify.c
@@ -8,6 +8,8 @@
#include "mf_justify.h"
#include "mf_kerning.h"
+#ifndef MF_NO_COMPILE
+
#if MF_USE_TABS
/* Round the X coordinate up to the nearest tab stop. */
static int16_t mf_round_to_tab(const struct mf_font_s *font,
@@ -338,3 +340,6 @@ void mf_render_justified(const struct mf_font_s *font,
#endif
+#endif //MF_NO_COMPILE
+
+
diff --git a/src/gdisp/mcufont/mf_kerning.c b/src/gdisp/mcufont/mf_kerning.c
index 0163fbd9..4118b78e 100644
--- a/src/gdisp/mcufont/mf_kerning.c
+++ b/src/gdisp/mcufont/mf_kerning.c
@@ -6,6 +6,9 @@
*/
#include "mf_kerning.h"
+
+#ifndef MF_NO_COMPILE
+
#include <stdbool.h>
#if MF_USE_KERNING
@@ -123,3 +126,5 @@ int8_t mf_compute_kerning(const struct mf_font_s *font,
}
#endif
+
+#endif //MF_NO_COMPILE
diff --git a/src/gdisp/mcufont/mf_rlefont.c b/src/gdisp/mcufont/mf_rlefont.c
index ca628674..c4b344c6 100644
--- a/src/gdisp/mcufont/mf_rlefont.c
+++ b/src/gdisp/mcufont/mf_rlefont.c
@@ -7,6 +7,8 @@
#include "mf_rlefont.h"
+#ifndef MF_NO_COMPILE
+
/* Number of reserved codes before the dictionary entries. */
#define DICT_START 24
@@ -288,3 +290,5 @@ uint8_t mf_rlefont_character_width(const struct mf_font_s *font,
return *p;
}
+
+#endif //MF_NO_COMPILE
diff --git a/src/gdisp/mcufont/mf_scaledfont.c b/src/gdisp/mcufont/mf_scaledfont.c
index f49be1e4..4f9de208 100644
--- a/src/gdisp/mcufont/mf_scaledfont.c
+++ b/src/gdisp/mcufont/mf_scaledfont.c
@@ -7,6 +7,8 @@
#include "mf_scaledfont.h"
+#ifndef MF_NO_COMPILE
+
struct scaled_renderstate
{
mf_pixel_callback_t orig_callback;
@@ -88,3 +90,4 @@ void mf_scale_font(struct mf_scaledfont_s *newfont,
newfont->y_scale = y_scale;
}
+#endif //MF_NO_COMPILE
diff --git a/src/gdisp/mcufont/mf_wordwrap.c b/src/gdisp/mcufont/mf_wordwrap.c
index ebf3a537..ee57ee99 100644
--- a/src/gdisp/mcufont/mf_wordwrap.c
+++ b/src/gdisp/mcufont/mf_wordwrap.c
@@ -7,6 +7,8 @@
#include "mf_wordwrap.h"
+#ifndef MF_NO_COMPILE
+
/* Returns true if the line can be broken at this character. */
static bool is_wrap_space(uint16_t c)
{
@@ -294,3 +296,5 @@ void mf_wordwrap(const struct mf_font_s *font, int16_t width,
}
#endif
+
+#endif //MF_NO_COMPILE