#pragma once
#include <Arduino.h>
#include <stdbool.h>
#include <stdint.h>

typedef struct
{
    int32_t x;
    int32_t y;
    int32_t width;
    int32_t height;
} Rect_t;

typedef enum
{
    BLACK_ON_WHITE = 1 << 0,
    WHITE_ON_WHITE = 1 << 1,
    WHITE_ON_BLACK = 1 << 2,
} DrawMode_t;

enum DrawFlags
{
    DRAW_BACKGROUND = 1 << 0,
};

typedef struct
{
    uint8_t  fg_color: 4;
    uint8_t  bg_color: 4;
    uint32_t fallback_glyph;
    uint32_t flags;
} FontProperties;

typedef struct
{
    uint8_t width;
    uint8_t height;
    uint8_t advance_x;
    int16_t left;
    int16_t top;
    uint16_t compressed_size;
    uint32_t data_offset;
} LGFXglyph;

typedef struct
{
    uint32_t first;
    uint32_t last;
    uint32_t offset;
} UnicodeInterval;

typedef struct
{
    uint8_t         *bitmap;
    LGFXglyph       *glyph;
    UnicodeInterval *intervals;
    uint32_t         interval_count;
    bool             compressed;
    uint8_t          advance_y;
    int32_t          ascender;
    int32_t          descender;
} LGFXfont;