/*******************************************************************************
 * Size: 10 px
 * Bpp: 4
 * Opts: 
 ******************************************************************************/

#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif

#ifndef MXC_WRYH_CT_BPP4_10PX
#define MXC_WRYH_CT_BPP4_10PX 1
#endif

#if MXC_WRYH_CT_BPP4_10PX

/*-----------------
 *    BITMAPS
 *----------------*/

/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
    /* U+0030 "0" */
    0x5, 0xee, 0x80, 0x1f, 0xb8, 0xf5, 0x7f, 0x20,
    0xfa, 0x9f, 0x0, 0xdc, 0x9f, 0x0, 0xdb, 0x7f,
    0x20, 0xf9, 0x2f, 0xa8, 0xf4, 0x6, 0xef, 0x80,

    /* U+0031 "1" */
    0x0, 0x3, 0x0, 0x1c, 0xff, 0x0, 0x1a, 0xbf,
    0x0, 0x0, 0x8f, 0x0, 0x0, 0x8f, 0x0, 0x0,
    0x8f, 0x0, 0x0, 0x8f, 0x0, 0x5, 0xbf, 0x63,
    0x1f, 0xff, 0xfa,

    /* U+0032 "2" */
    0x9, 0xef, 0xa0, 0x1c, 0x79, 0xf6, 0x0, 0x1,
    0xf8, 0x0, 0x6, 0xf3, 0x0, 0x4f, 0x80, 0x4,
    0xf8, 0x0, 0x3f, 0xd7, 0x73, 0x6f, 0xff, 0xf8,

    /* U+0033 "3" */
    0xb, 0xfe, 0x80, 0x7, 0x5a, 0xf3, 0x0, 0x18,
    0xf2, 0x7, 0xff, 0x60, 0x1, 0x4a, 0xf3, 0x0,
    0x1, 0xf8, 0x38, 0x5a, 0xf4, 0x2d, 0xfe, 0x70,

    /* U+0034 "4" */
    0x0, 0xe, 0xf0, 0x0, 0x8f, 0xf0, 0x2, 0xf9,
    0xf0, 0xc, 0x77, 0xf0, 0x6d, 0x7, 0xf0, 0xcf,
    0xff, 0xfe, 0x23, 0x39, 0xf2, 0x0, 0x7, 0xf0,

    /* U+0035 "5" */
    0xe, 0xff, 0xf3, 0xe, 0xa6, 0x61, 0xe, 0x70,
    0x0, 0xe, 0xff, 0xa0, 0x4, 0x49, 0xf6, 0x0,
    0x1, 0xf7, 0x18, 0x5a, 0xf3, 0x1d, 0xfd, 0x60,

    /* U+0036 "6" */
    0x1, 0xaf, 0xf3, 0xb, 0xf7, 0x62, 0x2f, 0x60,
    0x0, 0x5f, 0xaf, 0xd2, 0x7f, 0x95, 0xfa, 0x5f,
    0x30, 0xcc, 0x1f, 0xb6, 0xf8, 0x4, 0xdf, 0xa0,

    /* U+0037 "7" */
    0x8f, 0xff, 0xfb, 0x36, 0x67, 0xf7, 0x0, 0x6,
    0xf1, 0x0, 0xc, 0xb0, 0x0, 0x3f, 0x50, 0x0,
    0xae, 0x0, 0x1, 0xf9, 0x0, 0x7, 0xf3, 0x0,

    /* U+0038 "8" */
    0x7, 0xef, 0xa0, 0x3f, 0x96, 0xf7, 0x3f, 0x52,
    0xf6, 0x8, 0xfe, 0xa0, 0x1d, 0x98, 0xe3, 0x7f,
    0x0, 0xca, 0x6f, 0x75, 0xf9, 0x9, 0xee, 0xa1,

    /* U+0039 "9" */
    0x7, 0xee, 0x70, 0x4f, 0x99, 0xf3, 0x8f, 0x0,
    0xf8, 0x7f, 0x43, 0xfa, 0x1d, 0xfe, 0xf9, 0x0,
    0x21, 0xf6, 0x16, 0x5c, 0xe0, 0x1e, 0xfc, 0x30,

    /* U+00B7 "·" */
    0x2f, 0xdd, 0xdf, 0x12, 0xa0, 0x0, 0xb1, 0x2a,
    0x0, 0xb, 0x12, 0xa0, 0x0, 0xb1, 0x2a, 0x0,
    0xb, 0x12, 0xa0, 0x0, 0xb1, 0x2a, 0x0, 0xb,
    0x12, 0xfd, 0xdd, 0xf1
};


/*---------------------
 *  GLYPH DESCRIPTION
 *--------------------*/

static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
    {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
    {.bitmap_index = 0, .adv_w = 99, .box_w = 6, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 24, .adv_w = 99, .box_w = 6, .box_h = 9, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 51, .adv_w = 99, .box_w = 6, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 75, .adv_w = 99, .box_w = 6, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 99, .adv_w = 99, .box_w = 6, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 123, .adv_w = 99, .box_w = 6, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 147, .adv_w = 99, .box_w = 6, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 171, .adv_w = 99, .box_w = 6, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 195, .adv_w = 99, .box_w = 6, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 219, .adv_w = 99, .box_w = 6, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 243, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = 0}
};

/*---------------------
 *  CHARACTER MAPPING
 *--------------------*/



/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
    {
        .range_start = 48, .range_length = 10, .glyph_id_start = 1,
        .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
    },
    {
        .range_start = 183, .range_length = 1, .glyph_id_start = 11,
        .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
    }
};



/*--------------------
 *  ALL CUSTOM DATA
 *--------------------*/

#if LVGL_VERSION_MAJOR == 8
/*Store all the custom data of the font*/
static  lv_font_fmt_txt_glyph_cache_t cache;
#endif

#if LVGL_VERSION_MAJOR >= 8
static const lv_font_fmt_txt_dsc_t font_dsc = {
#else
static lv_font_fmt_txt_dsc_t font_dsc = {
#endif
    .glyph_bitmap = glyph_bitmap,
    .glyph_dsc = glyph_dsc,
    .cmaps = cmaps,
    .kern_dsc = NULL,
    .kern_scale = 0,
    .cmap_num = 2,
    .bpp = 4,
    .kern_classes = 0,
    .bitmap_format = 0,
#if LVGL_VERSION_MAJOR == 8
    .cache = &cache
#endif
};


/*-----------------
 *  PUBLIC FONT
 *----------------*/

/*Initialize a public general font descriptor*/
#if LVGL_VERSION_MAJOR >= 8
const lv_font_t MXC_WRYH_CT_bpp4_10px = {
#else
lv_font_t MXC_WRYH_CT_bpp4_10px = {
#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 = 9,          /*The maximum line height required by the font*/
    .base_line = 0,             /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
    .subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8
    .underline_position = -1,
    .underline_thickness = 1,
#endif
    .dsc = &font_dsc,          /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
    .fallback = NULL,
    .user_data = NULL
};



#endif /*#if MXC_WRYH_CT_BPP4_10PX*/

