55 lines
1.7 KiB
C
55 lines
1.7 KiB
C
|
|
/*
|
||
|
|
* fontLibrary.h
|
||
|
|
*
|
||
|
|
* Created on: Feb 9, 2022
|
||
|
|
* Author: Brian.Bailey
|
||
|
|
*/
|
||
|
|
|
||
|
|
#ifndef FONTS_FONTLIBRARY_H_
|
||
|
|
#define FONTS_FONTLIBRARY_H_
|
||
|
|
|
||
|
|
#include <Fonts/bfcfont.h>
|
||
|
|
#include "../lcd.h" //include for LCD_DRAW_MODE_t
|
||
|
|
#include "translate.h"
|
||
|
|
|
||
|
|
|
||
|
|
//extern all fonts (required)
|
||
|
|
extern const BFC_FONT fontCalibriBoldBasic10_15h[];
|
||
|
|
extern const BFC_FONT fontCalibriBoldBasic11_18h[];
|
||
|
|
extern const BFC_FONT fontCalibriBoldBasic12_19h[];
|
||
|
|
extern const BFC_FONT fontCalibriBoldBasic14_23h[];
|
||
|
|
extern const BFC_FONT fontCalibriBoldBasic16_26h[];
|
||
|
|
extern const BFC_FONT fontCalibriBoldBasic18_29h[];
|
||
|
|
|
||
|
|
extern const BFC_FONT fontSimSunBold12_19h[];
|
||
|
|
|
||
|
|
//quick names for fonts (optional)
|
||
|
|
#define font10Bold fontCalibriBoldBasic10_15h
|
||
|
|
#define font11Bold fontCalibriBoldBasic11_18h
|
||
|
|
#define font12Bold fontCalibriBoldBasic12_19h
|
||
|
|
#define font14Bold fontCalibriBoldBasic14_23h
|
||
|
|
#define font16Bold fontCalibriBoldBasic16_26h
|
||
|
|
#define font18Bold fontCalibriBoldBasic18_29h
|
||
|
|
|
||
|
|
#define fontSimsun fontSimSunBold12_19h
|
||
|
|
|
||
|
|
typedef enum {
|
||
|
|
FL_ALIGN_LEFT,
|
||
|
|
FL_ALIGN_CENTER,
|
||
|
|
FL_ALIGN_RIGHT,
|
||
|
|
FL_ALIGN_NUM
|
||
|
|
} FL_ALIGN;
|
||
|
|
|
||
|
|
|
||
|
|
uint32_t FL_GetCodepointInfo(const char * str, uint32_t * codepoint, uint32_t * charCount);
|
||
|
|
uint32_t FL_GetFontHeight(const BFC_FONT * font);
|
||
|
|
void FL_DrawTranslatedString(const char *str, int16_t x, int16_t y, const BFC_FONT *pFont, LCD_DRAWMODE_t drawMode, FL_ALIGN align);
|
||
|
|
void FL_DrawString(const char *str, int16_t x, int16_t y, const BFC_FONT *font, LCD_DRAWMODE_t drawMode, FL_ALIGN align);
|
||
|
|
uint32_t FL_DrawChar(uint16_t codepoint, int x0, int y0, const BFC_FONT *pFont, LCD_DRAWMODE_t drawMode);
|
||
|
|
uint32_t FL_GetStringLengthInPixels(const char * str, const BFC_FONT *pFont);
|
||
|
|
const BFC_CHARINFO* FL_GetCharInfo(const BFC_FONT *pFont, unsigned short ch);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
#endif /* FONTS_FONTLIBRARY_H_ */
|