1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 04:53:12 +01:00

Improve handling of braces

This commit is contained in:
Ted John
2020-11-21 18:16:56 +00:00
parent 9173ec2111
commit ec03ce5317
5 changed files with 61 additions and 3 deletions

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);