Add language-specific font configuration

meta.xml can now have a <font> tag, which gives the name of the font
that the language needs. This will directly control the interface font
when the language is active, and will soon also control the font used
for each option on the language screen.
This commit is contained in:
Dav999-v
2023-01-15 01:31:02 +01:00
committed by Misa Elizabeth Kai
parent dadb7f2623
commit 5dad6b38be
12 changed files with 94 additions and 23 deletions
+7 -1
View File
@@ -64,7 +64,7 @@ struct Font
struct FontContainer
{
size_t count;
uint8_t count;
Font* fonts;
};
@@ -105,6 +105,10 @@ struct PrintFlags
#define PR_CJK_LOW (1 << 20) /* larger fonts should stick out fully on the bottom (draw at Y) */
#define PR_CJK_HIGH (2 << 20) /* larger fonts should stick out fully on the top */
bool find_main_font_by_name(const char* name, uint8_t* idx);
const char* get_main_font_name(uint8_t idx);
uint8_t get_font_idx_8x8(void);
void load_main(void);
void load_custom(void);
void unload_custom(void);
@@ -114,6 +118,8 @@ std::string string_wordwrap(const std::string& s, int maxwidth, short *lines = N
std::string string_wordwrap_balanced(const std::string& s, int maxwidth);
std::string string_unwordwrap(const std::string& s);
bool glyph_dimensions_main(uint8_t idx, uint8_t* glyph_w, uint8_t* glyph_h);
int len(uint32_t flags, const std::string& t);
int height(const uint32_t flags);