Repository navigation
Expand file tree
/
Copy pathfont.h
More file actions
61 lines (49 loc) · 1.41 KB
/
Copy pathfont.h
File metadata and controls
61 lines (49 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef _inc_font
#define _inc_font
#include <stdint.h>
typedef struct {
uint8_t FontWidth; /*!< Font width in pixels */
uint8_t FontHeight; /*!< Font height in pixels */
const uint16_t *data; /*!< Pointer to data font data array */
} FontDef_t;
/**
* @brief String length and height
*/
typedef struct {
uint16_t Length; /*!< String length in units of pixels */
uint16_t Height; /*!< String height in units of pixels */
} FONTS_SIZE_t;
/**
* @defgroup FONTS_FontVariables
* @brief Library font variables
* @{
*/
/**
* @brief 7 x 10 pixels font size structure
*/
extern FontDef_t Font_7x10;
/**
* @brief 11 x 18 pixels font size structure
*/
extern FontDef_t Font_11x18;
/**
* @brief 16 x 26 pixels font size structure
*/
extern FontDef_t Font_16x26;
/**
* @}
*/
/**
* @defgroup FONTS_Functions
* @brief Library functions
* @{
*/
/**
* @brief Calculates string length and height in units of pixels depending on string and font used
* @param *str: String to be checked for length and height
* @param *SizeStruct: Pointer to empty @ref FONTS_SIZE_t structure where informations will be saved
* @param *Font: Pointer to @ref FontDef_t font used for calculations
* @retval Pointer to string used for length and height
*/
char* FONTS_GetStringSize(char* str, FONTS_SIZE_t* SizeStruct, FontDef_t* Font);
#endif