/**
 @file fonts.h
 */
/*
 * ============================================================================
 * (C) Copyright,  Bridgetek Pte. Ltd.
 * ============================================================================
 *
 * This source code ("the Software") is provided by Bridgetek Pte Ltd
 * ("Bridgetek") subject to the licence terms set out
 * https://brtchip.com/wp-content/uploads/2021/11/BRT_Software_License_Agreement.pdf ("the Licence Terms").
 * You must read the Licence Terms before downloading or using the Software.
 * By installing or using the Software you agree to the Licence Terms. If you
 * do not agree to the Licence Terms then do not download or use the Software.
 *
 * Without prejudice to the Licence Terms, here is a summary of some of the key
 * terms of the Licence Terms (and in the event of any conflict between this
 * summary and the Licence Terms then the text of the Licence Terms will
 * prevail).
 *
 * The Software is provided "as is".
 * There are no warranties (or similar) in relation to the quality of the
 * Software. You use it at your own risk.
 * The Software should not be used in, or for, any medical device, system or
 * appliance. There are exclusions of Bridgetek liability for certain types of loss
 * such as: special loss or damage; incidental loss or damage; indirect or
 * consequential loss or damage; loss of income; loss of business; loss of
 * profits; loss of revenue; loss of contracts; business interruption; loss of
 * the use of money or anticipated savings; loss of information; loss of
 * opportunity; loss of goodwill or reputation; and/or loss of, damage to or
 * corruption of data.
 * There is a monetary cap on Bridgetek's liability.
 * The Software may have subsequently been amended by another user and then
 * distributed by that other user ("Adapted Software").  If so that user may
 * have additional licence terms that apply to those amendments. However, Bridgetek
 * has no liability in relation to those amendments.
 * ============================================================================
 */

#ifndef EVE_FONTS_H
#define EVE_FONTS_H

/**
 @brief Maximum number of characters to cache form a font.
 */
#define FONT_MAX_CHARACTERS 128

 /**
 @brief Structure to hold cache of font settings.
 @details This is used to store the font parameters to accelerate drawing
 the glyphs during the application.
 */
struct eve_font_cache {
    uint8_t handle;
    uint8_t legacy;
    uint8_t widths[FONT_MAX_CHARACTERS];
    uint32_t glyphs[FONT_MAX_CHARACTERS];
    uint16_t height;
    uint16_t width;
    uint16_t format;
    uint16_t linestride;
    uint8_t first;
};


uint8_t font_getmax(void);
uint32_t font_getromptr(uint8_t fontnumber);
void font_getfontinforom(struct eve_font_cache *cache, uint8_t fontnumber);
void font_getfontinfocustom(struct eve_font_cache *cache, uint8_t fontnumber, uint32_t fontptr, uint8_t first_character);
uint16_t font_getheight(struct eve_font_cache *cache);
uint16_t font_getwidth(struct eve_font_cache *cache);
uint16_t font_getcharwidth(struct eve_font_cache *cache, uint8_t ch);

#endif // EVE_FONTS_H
