Uploading the first files
This commit is contained in:
commit
eab3a5dd48
356 files changed
+78694
No files matched your search
@@ -0,0 +1,287 @@
|
||||
/**
|
||||
* @file lv_font.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_FONT_H
|
||||
#define LV_FONT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "liblvgl/lv_conf_internal.h"
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "lv_symbol_def.h"
|
||||
#include "liblvgl/misc/lv_area.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/* imgfont identifier */
|
||||
#define LV_IMGFONT_BPP 9
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/*------------------
|
||||
* General types
|
||||
*-----------------*/
|
||||
|
||||
struct _lv_font_t;
|
||||
/** Describes the properties of a glyph.*/
|
||||
typedef struct {
|
||||
const struct _lv_font_t *
|
||||
resolved_font; /**< Pointer to a font where the glyph was actually found after handling fallbacks*/
|
||||
uint16_t adv_w; /**< The glyph needs this space. Draw the next glyph after this width.*/
|
||||
uint16_t box_w; /**< Width of the glyph's bounding box*/
|
||||
uint16_t box_h; /**< Height of the glyph's bounding box*/
|
||||
int16_t ofs_x; /**< x offset of the bounding box*/
|
||||
int16_t ofs_y; /**< y offset of the bounding box*/
|
||||
uint8_t bpp: 4; /**< Bit-per-pixel: 1, 2, 4, 8*/
|
||||
uint8_t is_placeholder: 1; /** Glyph is missing. But placeholder will still be displayed */
|
||||
} lv_font_glyph_dsc_t;
|
||||
|
||||
/** The bitmaps might be upscaled by 3 to achieve subpixel rendering.*/
|
||||
enum {
|
||||
LV_FONT_SUBPX_NONE,
|
||||
LV_FONT_SUBPX_HOR,
|
||||
LV_FONT_SUBPX_VER,
|
||||
LV_FONT_SUBPX_BOTH,
|
||||
};
|
||||
|
||||
typedef uint8_t lv_font_subpx_t;
|
||||
|
||||
/** Describe the properties of a font*/
|
||||
typedef struct _lv_font_t {
|
||||
/** Get a glyph's descriptor from a font*/
|
||||
bool (*get_glyph_dsc)(const struct _lv_font_t *, lv_font_glyph_dsc_t *, uint32_t letter, uint32_t letter_next);
|
||||
|
||||
/** Get a glyph's bitmap from a font*/
|
||||
const uint8_t * (*get_glyph_bitmap)(const struct _lv_font_t *, uint32_t);
|
||||
|
||||
/*Pointer to the font in a font pack (must have the same line height)*/
|
||||
lv_coord_t line_height; /**< The real line height where any text fits*/
|
||||
lv_coord_t base_line; /**< Base line measured from the top of the line_height*/
|
||||
uint8_t subpx : 2; /**< An element of `lv_font_subpx_t`*/
|
||||
|
||||
int8_t underline_position; /**< Distance between the top of the underline and base line (< 0 means below the base line)*/
|
||||
int8_t underline_thickness; /**< Thickness of the underline*/
|
||||
|
||||
const void * dsc; /**< Store implementation specific or run_time data or caching here*/
|
||||
const struct _lv_font_t * fallback; /**< Fallback font for missing glyph. Resolved recursively */
|
||||
#if LV_USE_USER_DATA
|
||||
void * user_data; /**< Custom user data for font.*/
|
||||
#endif
|
||||
} lv_font_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Return with the bitmap of a font.
|
||||
* @param font_p pointer to a font
|
||||
* @param letter a UNICODE character code
|
||||
* @return pointer to the bitmap of the letter
|
||||
*/
|
||||
const uint8_t * lv_font_get_glyph_bitmap(const lv_font_t * font_p, uint32_t letter);
|
||||
|
||||
/**
|
||||
* Get the descriptor of a glyph
|
||||
* @param font_p pointer to font
|
||||
* @param dsc_out store the result descriptor here
|
||||
* @param letter a UNICODE letter code
|
||||
* @param letter_next the next letter after `letter`. Used for kerning
|
||||
* @return true: descriptor is successfully loaded into `dsc_out`.
|
||||
* false: the letter was not found, no data is loaded to `dsc_out`
|
||||
*/
|
||||
bool lv_font_get_glyph_dsc(const lv_font_t * font_p, lv_font_glyph_dsc_t * dsc_out, uint32_t letter,
|
||||
uint32_t letter_next);
|
||||
|
||||
/**
|
||||
* Get the width of a glyph with kerning
|
||||
* @param font pointer to a font
|
||||
* @param letter a UNICODE letter
|
||||
* @param letter_next the next letter after `letter`. Used for kerning
|
||||
* @return the width of the glyph
|
||||
*/
|
||||
uint16_t lv_font_get_glyph_width(const lv_font_t * font, uint32_t letter, uint32_t letter_next);
|
||||
|
||||
/**
|
||||
* Get the line height of a font. All characters fit into this height
|
||||
* @param font_p pointer to a font
|
||||
* @return the height of a font
|
||||
*/
|
||||
static inline lv_coord_t lv_font_get_line_height(const lv_font_t * font_p)
|
||||
{
|
||||
return font_p->line_height;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#define LV_FONT_DECLARE(font_name) extern const lv_font_t font_name;
|
||||
|
||||
#if LV_FONT_MONTSERRAT_8
|
||||
LV_FONT_DECLARE(lv_font_montserrat_8)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_10
|
||||
LV_FONT_DECLARE(lv_font_montserrat_10)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_12
|
||||
LV_FONT_DECLARE(lv_font_montserrat_12)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_14
|
||||
LV_FONT_DECLARE(lv_font_montserrat_14)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_16
|
||||
LV_FONT_DECLARE(lv_font_montserrat_16)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_18
|
||||
LV_FONT_DECLARE(lv_font_montserrat_18)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_20
|
||||
LV_FONT_DECLARE(lv_font_montserrat_20)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_22
|
||||
LV_FONT_DECLARE(lv_font_montserrat_22)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_24
|
||||
LV_FONT_DECLARE(lv_font_montserrat_24)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_26
|
||||
LV_FONT_DECLARE(lv_font_montserrat_26)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_28
|
||||
LV_FONT_DECLARE(lv_font_montserrat_28)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_30
|
||||
LV_FONT_DECLARE(lv_font_montserrat_30)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_32
|
||||
LV_FONT_DECLARE(lv_font_montserrat_32)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_34
|
||||
LV_FONT_DECLARE(lv_font_montserrat_34)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_36
|
||||
LV_FONT_DECLARE(lv_font_montserrat_36)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_38
|
||||
LV_FONT_DECLARE(lv_font_montserrat_38)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_40
|
||||
LV_FONT_DECLARE(lv_font_montserrat_40)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_42
|
||||
LV_FONT_DECLARE(lv_font_montserrat_42)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_44
|
||||
LV_FONT_DECLARE(lv_font_montserrat_44)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_46
|
||||
LV_FONT_DECLARE(lv_font_montserrat_46)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_48
|
||||
LV_FONT_DECLARE(lv_font_montserrat_48)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_12_SUBPX
|
||||
LV_FONT_DECLARE(lv_font_montserrat_12_subpx)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_MONTSERRAT_28_COMPRESSED
|
||||
LV_FONT_DECLARE(lv_font_montserrat_28_compressed)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_DEJAVU_16_PERSIAN_HEBREW
|
||||
LV_FONT_DECLARE(lv_font_dejavu_16_persian_hebrew)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_SIMSUN_16_CJK
|
||||
LV_FONT_DECLARE(lv_font_simsun_16_cjk)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_UNSCII_8
|
||||
LV_FONT_DECLARE(lv_font_unscii_8)
|
||||
#endif
|
||||
|
||||
#if LV_FONT_UNSCII_16
|
||||
LV_FONT_DECLARE(lv_font_unscii_16)
|
||||
#endif
|
||||
|
||||
// TODO: reimplement some of the '_LATIN_SUP' fonts as custom fonts
|
||||
|
||||
/*Declare the custom (user defined) fonts*/
|
||||
#ifdef LV_FONT_CUSTOM_DECLARE
|
||||
LV_FONT_CUSTOM_DECLARE
|
||||
#endif
|
||||
#if USE_PROS_FONT_DEJAVU_MONO_10
|
||||
LV_FONT_DECLARE(pros_font_dejavu_mono_10);
|
||||
#endif
|
||||
#if USE_PROS_FONT_DEJAVU_MONO_10_LATIN_SUP
|
||||
LV_FONT_DECLARE(pros_font_dejavu_mono_10_latin_sup);
|
||||
#endif
|
||||
#if USE_PROS_FONT_DEJAVU_MONO_18
|
||||
LV_FONT_DECLARE(pros_font_dejavu_mono_18);
|
||||
#endif
|
||||
#if USE_PROS_FONT_DEJAVU_MONO_18_LATIN_SUP
|
||||
LV_FONT_DECLARE(pros_font_dejavu_mono_18_latin_sup);
|
||||
#endif
|
||||
#if USE_PROS_FONT_DEJAVU_MONO_30
|
||||
LV_FONT_DECLARE(pros_font_dejavu_mono_30);
|
||||
#endif
|
||||
#if USE_PROS_FONT_DEJAVU_MONO_30_LATIN_SUP
|
||||
LV_FONT_DECLARE(pros_font_dejavu_mono_30_latin_sup);
|
||||
#endif
|
||||
#if USE_PROS_FONT_DEJAVU_MONO_40
|
||||
LV_FONT_DECLARE(pros_font_dejavu_mono_40);
|
||||
#endif
|
||||
#if USE_PROS_FONT_DEJAVU_MONO_40_LATIN_SUP
|
||||
LV_FONT_DECLARE(pros_font_dejavu_mono_40_latin_sup);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Just a wrapper around LV_FONT_DEFAULT because it might be more convenient to use a function in some cases
|
||||
* @return pointer to LV_FONT_DEFAULT
|
||||
*/
|
||||
static inline const lv_font_t * lv_font_default(void)
|
||||
{
|
||||
return LV_FONT_DEFAULT;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif /*USE_FONT*/
|
||||
@@ -0,0 +1,240 @@
|
||||
/**
|
||||
* @file lv_font_fmt_txt.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_FONT_FMT_TXT_H
|
||||
#define LV_FONT_FMT_TXT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
#include "lv_font.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/** This describes a glyph.*/
|
||||
typedef struct {
|
||||
#if LV_FONT_FMT_TXT_LARGE == 0
|
||||
uint32_t bitmap_index : 20; /**< Start index of the bitmap. A font can be max 1 MB.*/
|
||||
uint32_t adv_w : 12; /**< Draw the next glyph after this width. 8.4 format (real_value * 16 is stored).*/
|
||||
uint8_t box_w; /**< Width of the glyph's bounding box*/
|
||||
uint8_t box_h; /**< Height of the glyph's bounding box*/
|
||||
int8_t ofs_x; /**< x offset of the bounding box*/
|
||||
int8_t ofs_y; /**< y offset of the bounding box. Measured from the top of the line*/
|
||||
#else
|
||||
uint32_t bitmap_index; /**< Start index of the bitmap. A font can be max 4 GB.*/
|
||||
uint32_t adv_w; /**< Draw the next glyph after this width. 28.4 format (real_value * 16 is stored).*/
|
||||
uint16_t box_w; /**< Width of the glyph's bounding box*/
|
||||
uint16_t box_h; /**< Height of the glyph's bounding box*/
|
||||
int16_t ofs_x; /**< x offset of the bounding box*/
|
||||
int16_t ofs_y; /**< y offset of the bounding box. Measured from the top of the line*/
|
||||
#endif
|
||||
} lv_font_fmt_txt_glyph_dsc_t;
|
||||
|
||||
/** Format of font character map.*/
|
||||
enum {
|
||||
LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL,
|
||||
LV_FONT_FMT_TXT_CMAP_SPARSE_FULL,
|
||||
LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY,
|
||||
LV_FONT_FMT_TXT_CMAP_SPARSE_TINY,
|
||||
};
|
||||
|
||||
typedef uint8_t lv_font_fmt_txt_cmap_type_t;
|
||||
|
||||
/**
|
||||
* Map codepoints to a `glyph_dsc`s
|
||||
* Several formats are supported to optimize memory usage
|
||||
* See https://github.com/lvgl/lv_font_conv/blob/master/doc/font_spec.md
|
||||
*/
|
||||
typedef struct {
|
||||
/** First Unicode character for this range*/
|
||||
uint32_t range_start;
|
||||
|
||||
/** Number of Unicode characters related to this range.
|
||||
* Last Unicode character = range_start + range_length - 1*/
|
||||
uint16_t range_length;
|
||||
|
||||
/** First glyph ID (array index of `glyph_dsc`) for this range*/
|
||||
uint16_t glyph_id_start;
|
||||
|
||||
/*
|
||||
According the specification there are 4 formats:
|
||||
https://github.com/lvgl/lv_font_conv/blob/master/doc/font_spec.md
|
||||
|
||||
For simplicity introduce "relative code point":
|
||||
rcp = codepoint - range_start
|
||||
|
||||
and a search function:
|
||||
search a "value" in an "array" and returns the index of "value".
|
||||
|
||||
Format 0 tiny
|
||||
unicode_list == NULL && glyph_id_ofs_list == NULL
|
||||
glyph_id = glyph_id_start + rcp
|
||||
|
||||
Format 0 full
|
||||
unicode_list == NULL && glyph_id_ofs_list != NULL
|
||||
glyph_id = glyph_id_start + glyph_id_ofs_list[rcp]
|
||||
|
||||
Sparse tiny
|
||||
unicode_list != NULL && glyph_id_ofs_list == NULL
|
||||
glyph_id = glyph_id_start + search(unicode_list, rcp)
|
||||
|
||||
Sparse full
|
||||
unicode_list != NULL && glyph_id_ofs_list != NULL
|
||||
glyph_id = glyph_id_start + glyph_id_ofs_list[search(unicode_list, rcp)]
|
||||
*/
|
||||
|
||||
const uint16_t * unicode_list;
|
||||
|
||||
/** if(type == LV_FONT_FMT_TXT_CMAP_FORMAT0_...) it's `uint8_t *`
|
||||
* if(type == LV_FONT_FMT_TXT_CMAP_SPARSE_...) it's `uint16_t *`
|
||||
*/
|
||||
const void * glyph_id_ofs_list;
|
||||
|
||||
/** Length of `unicode_list` and/or `glyph_id_ofs_list`*/
|
||||
uint16_t list_length;
|
||||
|
||||
/** Type of this character map*/
|
||||
lv_font_fmt_txt_cmap_type_t type;
|
||||
} lv_font_fmt_txt_cmap_t;
|
||||
|
||||
/** A simple mapping of kern values from pairs*/
|
||||
typedef struct {
|
||||
/*To get a kern value of two code points:
|
||||
1. Get the `glyph_id_left` and `glyph_id_right` from `lv_font_fmt_txt_cmap_t
|
||||
2. for(i = 0; i < pair_cnt * 2; i += 2)
|
||||
if(gylph_ids[i] == glyph_id_left &&
|
||||
gylph_ids[i+1] == glyph_id_right)
|
||||
return values[i / 2];
|
||||
*/
|
||||
const void * glyph_ids;
|
||||
const int8_t * values;
|
||||
uint32_t pair_cnt : 30;
|
||||
uint32_t glyph_ids_size : 2; /*0: `glyph_ids` is stored as `uint8_t`; 1: as `uint16_t`*/
|
||||
} lv_font_fmt_txt_kern_pair_t;
|
||||
|
||||
/** More complex but more optimal class based kern value storage*/
|
||||
typedef struct {
|
||||
/*To get a kern value of two code points:
|
||||
1. Get the `glyph_id_left` and `glyph_id_right` from `lv_font_fmt_txt_cmap_t
|
||||
2. Get the class of the left and right glyphs as `left_class` and `right_class`
|
||||
left_class = left_class_mapping[glyph_id_left];
|
||||
right_class = right_class_mapping[glyph_id_right];
|
||||
3. value = class_pair_values[(left_class-1)*right_class_cnt + (right_class-1)]
|
||||
*/
|
||||
|
||||
const int8_t * class_pair_values; /*left_class_cnt * right_class_cnt value*/
|
||||
const uint8_t * left_class_mapping; /*Map the glyph_ids to classes: index -> glyph_id -> class_id*/
|
||||
const uint8_t * right_class_mapping; /*Map the glyph_ids to classes: index -> glyph_id -> class_id*/
|
||||
uint8_t left_class_cnt;
|
||||
uint8_t right_class_cnt;
|
||||
} lv_font_fmt_txt_kern_classes_t;
|
||||
|
||||
/** Bitmap formats*/
|
||||
typedef enum {
|
||||
LV_FONT_FMT_TXT_PLAIN = 0,
|
||||
LV_FONT_FMT_TXT_COMPRESSED = 1,
|
||||
LV_FONT_FMT_TXT_COMPRESSED_NO_PREFILTER = 1,
|
||||
} lv_font_fmt_txt_bitmap_format_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t last_letter;
|
||||
uint32_t last_glyph_id;
|
||||
} lv_font_fmt_txt_glyph_cache_t;
|
||||
|
||||
/*Describe store additional data for fonts*/
|
||||
typedef struct {
|
||||
/*The bitmaps of all glyphs*/
|
||||
const uint8_t * glyph_bitmap;
|
||||
|
||||
/*Describe the glyphs*/
|
||||
const lv_font_fmt_txt_glyph_dsc_t * glyph_dsc;
|
||||
|
||||
/*Map the glyphs to Unicode characters.
|
||||
*Array of `lv_font_cmap_fmt_txt_t` variables*/
|
||||
const lv_font_fmt_txt_cmap_t * cmaps;
|
||||
|
||||
/**
|
||||
* Store kerning values.
|
||||
* Can be `lv_font_fmt_txt_kern_pair_t * or `lv_font_kern_classes_fmt_txt_t *`
|
||||
* depending on `kern_classes`
|
||||
*/
|
||||
const void * kern_dsc;
|
||||
|
||||
/*Scale kern values in 12.4 format*/
|
||||
uint16_t kern_scale;
|
||||
|
||||
/*Number of cmap tables*/
|
||||
uint16_t cmap_num : 9;
|
||||
|
||||
/*Bit per pixel: 1, 2, 3, 4, 8*/
|
||||
uint16_t bpp : 4;
|
||||
|
||||
/*Type of `kern_dsc`*/
|
||||
uint16_t kern_classes : 1;
|
||||
|
||||
/*
|
||||
* storage format of the bitmap
|
||||
* from `lv_font_fmt_txt_bitmap_format_t`
|
||||
*/
|
||||
uint16_t bitmap_format : 2;
|
||||
|
||||
/*Cache the last letter and is glyph id*/
|
||||
lv_font_fmt_txt_glyph_cache_t * cache;
|
||||
} lv_font_fmt_txt_dsc_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Used as `get_glyph_bitmap` callback in LittelvGL's native font format if the font is uncompressed.
|
||||
* @param font pointer to font
|
||||
* @param unicode_letter a unicode letter which bitmap should be get
|
||||
* @return pointer to the bitmap or NULL if not found
|
||||
*/
|
||||
const uint8_t * lv_font_get_bitmap_fmt_txt(const lv_font_t * font, uint32_t letter);
|
||||
|
||||
/**
|
||||
* Used as `get_glyph_dsc` callback in LittelvGL's native font format if the font is uncompressed.
|
||||
* @param font_p pointer to font
|
||||
* @param dsc_out store the result descriptor here
|
||||
* @param letter a UNICODE letter code
|
||||
* @return true: descriptor is successfully loaded into `dsc_out`.
|
||||
* false: the letter was not found, no data is loaded to `dsc_out`
|
||||
*/
|
||||
bool lv_font_get_glyph_dsc_fmt_txt(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter,
|
||||
uint32_t unicode_letter_next);
|
||||
|
||||
/**
|
||||
* Free the allocated memories.
|
||||
*/
|
||||
void _lv_font_clean_up_fmt_txt(void);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* ADD BUILT IN FONTS
|
||||
**********************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif /*LV_FONT_FMT_TXT_H*/
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* @file lv_font_loader.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_FONT_LOADER_H
|
||||
#define LV_FONT_LOADER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
lv_font_t * lv_font_load(const char * fontName);
|
||||
void lv_font_free(lv_font_t * font);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif /*LV_FONT_LOADER_H*/
|
||||
@@ -0,0 +1,353 @@
|
||||
#ifndef LV_SYMBOL_DEF_H
|
||||
#define LV_SYMBOL_DEF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "liblvgl/lv_conf_internal.h"
|
||||
|
||||
/*-------------------------------
|
||||
* Symbols from "normal" font
|
||||
*-----------------------------*/
|
||||
#if !defined LV_SYMBOL_BULLET
|
||||
#define LV_SYMBOL_BULLET "\xE2\x80\xA2" /*20042, 0x2022*/
|
||||
#endif
|
||||
|
||||
/*-------------------------------
|
||||
* Symbols from FontAwesome font
|
||||
*-----------------------------*/
|
||||
|
||||
/*In the font converter use this list as range:
|
||||
61441, 61448, 61451, 61452, 61453, 61457, 61459, 61461, 61465, 61468,
|
||||
61473, 61478, 61479, 61480, 61502, 61507, 61512, 61515, 61516, 61517,
|
||||
61521, 61522, 61523, 61524, 61543, 61544, 61550, 61552, 61553, 61556,
|
||||
61559, 61560, 61561, 61563, 61587, 61589, 61636, 61637, 61639, 61641,
|
||||
61664, 61671, 61674, 61683, 61724, 61732, 61787, 61931, 62016, 62017,
|
||||
62018, 62019, 62020, 62087, 62099, 62189, 62212, 62810, 63426, 63650
|
||||
*/
|
||||
|
||||
/* These symbols can be prefined in the lv_conf.h file.
|
||||
* If they are not predefined, they will use the following values
|
||||
*/
|
||||
|
||||
|
||||
#if !defined LV_SYMBOL_AUDIO
|
||||
#define LV_SYMBOL_AUDIO "\xEF\x80\x81" /*61441, 0xF001*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_VIDEO
|
||||
#define LV_SYMBOL_VIDEO "\xEF\x80\x88" /*61448, 0xF008*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_LIST
|
||||
#define LV_SYMBOL_LIST "\xEF\x80\x8B" /*61451, 0xF00B*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_OK
|
||||
#define LV_SYMBOL_OK "\xEF\x80\x8C" /*61452, 0xF00C*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_CLOSE
|
||||
#define LV_SYMBOL_CLOSE "\xEF\x80\x8D" /*61453, 0xF00D*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_POWER
|
||||
#define LV_SYMBOL_POWER "\xEF\x80\x91" /*61457, 0xF011*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_SETTINGS
|
||||
#define LV_SYMBOL_SETTINGS "\xEF\x80\x93" /*61459, 0xF013*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_HOME
|
||||
#define LV_SYMBOL_HOME "\xEF\x80\x95" /*61461, 0xF015*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_DOWNLOAD
|
||||
#define LV_SYMBOL_DOWNLOAD "\xEF\x80\x99" /*61465, 0xF019*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_DRIVE
|
||||
#define LV_SYMBOL_DRIVE "\xEF\x80\x9C" /*61468, 0xF01C*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_REFRESH
|
||||
#define LV_SYMBOL_REFRESH "\xEF\x80\xA1" /*61473, 0xF021*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_MUTE
|
||||
#define LV_SYMBOL_MUTE "\xEF\x80\xA6" /*61478, 0xF026*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_VOLUME_MID
|
||||
#define LV_SYMBOL_VOLUME_MID "\xEF\x80\xA7" /*61479, 0xF027*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_VOLUME_MAX
|
||||
#define LV_SYMBOL_VOLUME_MAX "\xEF\x80\xA8" /*61480, 0xF028*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_IMAGE
|
||||
#define LV_SYMBOL_IMAGE "\xEF\x80\xBE" /*61502, 0xF03E*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_TINT
|
||||
#define LV_SYMBOL_TINT "\xEF\x81\x83" /*61507, 0xF043*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_PREV
|
||||
#define LV_SYMBOL_PREV "\xEF\x81\x88" /*61512, 0xF048*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_PLAY
|
||||
#define LV_SYMBOL_PLAY "\xEF\x81\x8B" /*61515, 0xF04B*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_PAUSE
|
||||
#define LV_SYMBOL_PAUSE "\xEF\x81\x8C" /*61516, 0xF04C*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_STOP
|
||||
#define LV_SYMBOL_STOP "\xEF\x81\x8D" /*61517, 0xF04D*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_NEXT
|
||||
#define LV_SYMBOL_NEXT "\xEF\x81\x91" /*61521, 0xF051*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_EJECT
|
||||
#define LV_SYMBOL_EJECT "\xEF\x81\x92" /*61522, 0xF052*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_LEFT
|
||||
#define LV_SYMBOL_LEFT "\xEF\x81\x93" /*61523, 0xF053*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_RIGHT
|
||||
#define LV_SYMBOL_RIGHT "\xEF\x81\x94" /*61524, 0xF054*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_PLUS
|
||||
#define LV_SYMBOL_PLUS "\xEF\x81\xA7" /*61543, 0xF067*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_MINUS
|
||||
#define LV_SYMBOL_MINUS "\xEF\x81\xA8" /*61544, 0xF068*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_EYE_OPEN
|
||||
#define LV_SYMBOL_EYE_OPEN "\xEF\x81\xAE" /*61550, 0xF06E*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_EYE_CLOSE
|
||||
#define LV_SYMBOL_EYE_CLOSE "\xEF\x81\xB0" /*61552, 0xF070*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_WARNING
|
||||
#define LV_SYMBOL_WARNING "\xEF\x81\xB1" /*61553, 0xF071*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_SHUFFLE
|
||||
#define LV_SYMBOL_SHUFFLE "\xEF\x81\xB4" /*61556, 0xF074*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_UP
|
||||
#define LV_SYMBOL_UP "\xEF\x81\xB7" /*61559, 0xF077*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_DOWN
|
||||
#define LV_SYMBOL_DOWN "\xEF\x81\xB8" /*61560, 0xF078*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_LOOP
|
||||
#define LV_SYMBOL_LOOP "\xEF\x81\xB9" /*61561, 0xF079*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_DIRECTORY
|
||||
#define LV_SYMBOL_DIRECTORY "\xEF\x81\xBB" /*61563, 0xF07B*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_UPLOAD
|
||||
#define LV_SYMBOL_UPLOAD "\xEF\x82\x93" /*61587, 0xF093*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_CALL
|
||||
#define LV_SYMBOL_CALL "\xEF\x82\x95" /*61589, 0xF095*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_CUT
|
||||
#define LV_SYMBOL_CUT "\xEF\x83\x84" /*61636, 0xF0C4*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_COPY
|
||||
#define LV_SYMBOL_COPY "\xEF\x83\x85" /*61637, 0xF0C5*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_SAVE
|
||||
#define LV_SYMBOL_SAVE "\xEF\x83\x87" /*61639, 0xF0C7*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_BARS
|
||||
#define LV_SYMBOL_BARS "\xEF\x83\x89" /*61641, 0xF0C9*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_ENVELOPE
|
||||
#define LV_SYMBOL_ENVELOPE "\xEF\x83\xA0" /*61664, 0xF0E0*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_CHARGE
|
||||
#define LV_SYMBOL_CHARGE "\xEF\x83\xA7" /*61671, 0xF0E7*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_PASTE
|
||||
#define LV_SYMBOL_PASTE "\xEF\x83\xAA" /*61674, 0xF0EA*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_BELL
|
||||
#define LV_SYMBOL_BELL "\xEF\x83\xB3" /*61683, 0xF0F3*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_KEYBOARD
|
||||
#define LV_SYMBOL_KEYBOARD "\xEF\x84\x9C" /*61724, 0xF11C*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_GPS
|
||||
#define LV_SYMBOL_GPS "\xEF\x84\xA4" /*61732, 0xF124*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_FILE
|
||||
#define LV_SYMBOL_FILE "\xEF\x85\x9B" /*61787, 0xF158*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_WIFI
|
||||
#define LV_SYMBOL_WIFI "\xEF\x87\xAB" /*61931, 0xF1EB*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_BATTERY_FULL
|
||||
#define LV_SYMBOL_BATTERY_FULL "\xEF\x89\x80" /*62016, 0xF240*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_BATTERY_3
|
||||
#define LV_SYMBOL_BATTERY_3 "\xEF\x89\x81" /*62017, 0xF241*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_BATTERY_2
|
||||
#define LV_SYMBOL_BATTERY_2 "\xEF\x89\x82" /*62018, 0xF242*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_BATTERY_1
|
||||
#define LV_SYMBOL_BATTERY_1 "\xEF\x89\x83" /*62019, 0xF243*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_BATTERY_EMPTY
|
||||
#define LV_SYMBOL_BATTERY_EMPTY "\xEF\x89\x84" /*62020, 0xF244*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_USB
|
||||
#define LV_SYMBOL_USB "\xEF\x8a\x87" /*62087, 0xF287*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_BLUETOOTH
|
||||
#define LV_SYMBOL_BLUETOOTH "\xEF\x8a\x93" /*62099, 0xF293*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_TRASH
|
||||
#define LV_SYMBOL_TRASH "\xEF\x8B\xAD" /*62189, 0xF2ED*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_EDIT
|
||||
#define LV_SYMBOL_EDIT "\xEF\x8C\x84" /*62212, 0xF304*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_BACKSPACE
|
||||
#define LV_SYMBOL_BACKSPACE "\xEF\x95\x9A" /*62810, 0xF55A*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_SD_CARD
|
||||
#define LV_SYMBOL_SD_CARD "\xEF\x9F\x82" /*63426, 0xF7C2*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_NEW_LINE
|
||||
#define LV_SYMBOL_NEW_LINE "\xEF\xA2\xA2" /*63650, 0xF8A2*/
|
||||
#endif
|
||||
|
||||
#if !defined LV_SYMBOL_DUMMY
|
||||
/** Invalid symbol at (U+F8FF). If written before a string then `lv_img` will show it as a label*/
|
||||
#define LV_SYMBOL_DUMMY "\xEF\xA3\xBF"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following list is generated using
|
||||
* cat src/font/lv_symbol_def.h | sed -E -n 's/^#define\s+LV_(SYMBOL_\w+).*".*$/ _LV_STR_\1,/p'
|
||||
*/
|
||||
enum {
|
||||
_LV_STR_SYMBOL_BULLET,
|
||||
_LV_STR_SYMBOL_AUDIO,
|
||||
_LV_STR_SYMBOL_VIDEO,
|
||||
_LV_STR_SYMBOL_LIST,
|
||||
_LV_STR_SYMBOL_OK,
|
||||
_LV_STR_SYMBOL_CLOSE,
|
||||
_LV_STR_SYMBOL_POWER,
|
||||
_LV_STR_SYMBOL_SETTINGS,
|
||||
_LV_STR_SYMBOL_HOME,
|
||||
_LV_STR_SYMBOL_DOWNLOAD,
|
||||
_LV_STR_SYMBOL_DRIVE,
|
||||
_LV_STR_SYMBOL_REFRESH,
|
||||
_LV_STR_SYMBOL_MUTE,
|
||||
_LV_STR_SYMBOL_VOLUME_MID,
|
||||
_LV_STR_SYMBOL_VOLUME_MAX,
|
||||
_LV_STR_SYMBOL_IMAGE,
|
||||
_LV_STR_SYMBOL_TINT,
|
||||
_LV_STR_SYMBOL_PREV,
|
||||
_LV_STR_SYMBOL_PLAY,
|
||||
_LV_STR_SYMBOL_PAUSE,
|
||||
_LV_STR_SYMBOL_STOP,
|
||||
_LV_STR_SYMBOL_NEXT,
|
||||
_LV_STR_SYMBOL_EJECT,
|
||||
_LV_STR_SYMBOL_LEFT,
|
||||
_LV_STR_SYMBOL_RIGHT,
|
||||
_LV_STR_SYMBOL_PLUS,
|
||||
_LV_STR_SYMBOL_MINUS,
|
||||
_LV_STR_SYMBOL_EYE_OPEN,
|
||||
_LV_STR_SYMBOL_EYE_CLOSE,
|
||||
_LV_STR_SYMBOL_WARNING,
|
||||
_LV_STR_SYMBOL_SHUFFLE,
|
||||
_LV_STR_SYMBOL_UP,
|
||||
_LV_STR_SYMBOL_DOWN,
|
||||
_LV_STR_SYMBOL_LOOP,
|
||||
_LV_STR_SYMBOL_DIRECTORY,
|
||||
_LV_STR_SYMBOL_UPLOAD,
|
||||
_LV_STR_SYMBOL_CALL,
|
||||
_LV_STR_SYMBOL_CUT,
|
||||
_LV_STR_SYMBOL_COPY,
|
||||
_LV_STR_SYMBOL_SAVE,
|
||||
_LV_STR_SYMBOL_BARS,
|
||||
_LV_STR_SYMBOL_ENVELOPE,
|
||||
_LV_STR_SYMBOL_CHARGE,
|
||||
_LV_STR_SYMBOL_PASTE,
|
||||
_LV_STR_SYMBOL_BELL,
|
||||
_LV_STR_SYMBOL_KEYBOARD,
|
||||
_LV_STR_SYMBOL_GPS,
|
||||
_LV_STR_SYMBOL_FILE,
|
||||
_LV_STR_SYMBOL_WIFI,
|
||||
_LV_STR_SYMBOL_BATTERY_FULL,
|
||||
_LV_STR_SYMBOL_BATTERY_3,
|
||||
_LV_STR_SYMBOL_BATTERY_2,
|
||||
_LV_STR_SYMBOL_BATTERY_1,
|
||||
_LV_STR_SYMBOL_BATTERY_EMPTY,
|
||||
_LV_STR_SYMBOL_USB,
|
||||
_LV_STR_SYMBOL_BLUETOOTH,
|
||||
_LV_STR_SYMBOL_TRASH,
|
||||
_LV_STR_SYMBOL_EDIT,
|
||||
_LV_STR_SYMBOL_BACKSPACE,
|
||||
_LV_STR_SYMBOL_SD_CARD,
|
||||
_LV_STR_SYMBOL_NEW_LINE,
|
||||
_LV_STR_SYMBOL_DUMMY,
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif /*LV_SYMBOL_DEF_H*/
|
||||
Reference in new issue
Block a user