Add initial version of font::print_wrap

graphics.PrintWrap is now also deprecated. An advantage of the new
version (with flags) is that it'll be possible to do things like put
a border around wrapped text, wrap text at larger scales, etc, but
these things don't work perfectly yet.

This commit also has some other fixes, like the default advance of
6 pixels for characters 0x00-0x1F in 8x8 fonts.
This commit is contained in:
Dav999-v
2023-01-06 16:21:42 +01:00
committed by Misa Elizabeth Kai
parent 0475539075
commit 1d8494db8d
4 changed files with 101 additions and 48 deletions

View File

@@ -106,7 +106,23 @@ void destroy(void);
int get_advance(const Font* f, uint32_t codepoint); // TODO de-api
void print(uint32_t flags, int x, int y, const std::string& text, uint8_t r, uint8_t g, uint8_t b);
void print(
uint32_t flags,
int x,
int y,
const std::string& text,
uint8_t r, uint8_t g, uint8_t b
);
int print_wrap(
uint32_t flags,
int x,
int y,
const std::string& text,
uint8_t r, uint8_t g, uint8_t b,
int linespacing = -1,
int maxwidth = -1
);
} // namespace font