Improve handling of braces

This commit is contained in:
Ted John committed 2020-11-27 18:54:57 +00:00
1 parent 9173ec2111
commit ec03ce5317
5 files changed
+61 -3

No files matched your search

+12
View File
@@ -824,6 +824,13 @@ static void ttf_process_string_literal(rct_drawpixelinfo* dpi, const std::string
#endif // NO_TTF
}
static void ttf_process_string_codepoint(rct_drawpixelinfo* dpi, codepoint_t codepoint, text_draw_info* info)
{
char buffer[8]{};
utf8_write_codepoint(buffer, codepoint);
ttf_process_string_literal(dpi, buffer, info);
}
static void ttf_process_string(rct_drawpixelinfo* dpi, std::string_view text, text_draw_info* info)
{
FmtString fmt(text);
@@ -833,6 +840,11 @@ static void ttf_process_string(rct_drawpixelinfo* dpi, std::string_view text, te
{
ttf_process_string_literal(dpi, token.text, info);
}
else if (token.IsCodepoint())
{
auto codepoint = token.GetCodepoint();
ttf_process_string_codepoint(dpi, codepoint, info);
}
else
{
ttf_process_format_code(dpi, token, info);