From 42ab81cac5d0ac9224225e5d8377be90c357f20b Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 4 Mar 2021 19:41:55 +0100 Subject: [PATCH] add #ifs --- src/lv_font/lv_font_montserrat_14.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/lv_font/lv_font_montserrat_14.c b/src/lv_font/lv_font_montserrat_14.c index 390812b80..4ad95b217 100644 --- a/src/lv_font/lv_font_montserrat_14.c +++ b/src/lv_font/lv_font_montserrat_14.c @@ -2106,11 +2106,13 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = /*-------------------- * ALL CUSTOM DATA *--------------------*/ - -static lv_font_fmt_txt_glyph_cache_t cache; - +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { +#else +static lv_font_fmt_txt_dsc_t font_dsc = { +#endif .glyph_bitmap = gylph_bitmap, .glyph_dsc = glyph_dsc, .cmaps = cmaps, @@ -2120,7 +2122,9 @@ static const lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, +#if LV_VERSION_CHECK(8, 0, 0) .cache = &cache +#endif }; /*----------------- @@ -2128,7 +2132,11 @@ static const lv_font_fmt_txt_dsc_t font_dsc = { *----------------*/ /*Initialize a public general font descriptor*/ +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_14 = { +#else +lv_font_t lv_font_montserrat_14 = { +#endif .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ .line_height = 16, /*The maximum line height required by the font*/