mirror of https://github.com/OpenTTD/OpenTTD.git
Add: Support zero-width space {ZWSP} to indicate where strings may break.
This commit is contained in:
parent
b3f31a6523
commit
77f3b529af
|
@ -93,6 +93,8 @@ static inline void GetLayouter(Layouter::LineCacheItem &line, std::string_view s
|
||||||
state.PopColour();
|
state.PopColour();
|
||||||
} else if (c >= SCC_FIRST_FONT && c <= SCC_LAST_FONT) {
|
} else if (c >= SCC_FIRST_FONT && c <= SCC_LAST_FONT) {
|
||||||
state.SetFontSize((FontSize)(c - SCC_FIRST_FONT));
|
state.SetFontSize((FontSize)(c - SCC_FIRST_FONT));
|
||||||
|
} else if (c == 0x200B) {
|
||||||
|
/* Zero-width space. */
|
||||||
} else {
|
} else {
|
||||||
/* Filter out non printable characters */
|
/* Filter out non printable characters */
|
||||||
if (!IsPrintable(c)) continue;
|
if (!IsPrintable(c)) continue;
|
||||||
|
|
|
@ -140,6 +140,7 @@ static const CmdStruct _cmd_structs[] = {
|
||||||
{"RIGHT_ARROW", EmitSingleChar, SCC_RIGHT_ARROW, 0, -1, C_DONTCOUNT},
|
{"RIGHT_ARROW", EmitSingleChar, SCC_RIGHT_ARROW, 0, -1, C_DONTCOUNT},
|
||||||
{"SMALL_LEFT_ARROW", EmitSingleChar, SCC_LESS_THAN, 0, -1, C_DONTCOUNT},
|
{"SMALL_LEFT_ARROW", EmitSingleChar, SCC_LESS_THAN, 0, -1, C_DONTCOUNT},
|
||||||
{"SMALL_RIGHT_ARROW", EmitSingleChar, SCC_GREATER_THAN, 0, -1, C_DONTCOUNT},
|
{"SMALL_RIGHT_ARROW", EmitSingleChar, SCC_GREATER_THAN, 0, -1, C_DONTCOUNT},
|
||||||
|
{"ZWSP", EmitSingleChar, 0x200B, 0, -1, C_DONTCOUNT},
|
||||||
|
|
||||||
/* The following are directional formatting codes used to get the RTL strings right:
|
/* The following are directional formatting codes used to get the RTL strings right:
|
||||||
* http://www.unicode.org/unicode/reports/tr9/#Directional_Formatting_Codes */
|
* http://www.unicode.org/unicode/reports/tr9/#Directional_Formatting_Codes */
|
||||||
|
|
Loading…
Reference in New Issue