Changeset - r24111:2dabe397dfc5
[Not reviewed]
master
0 1 0
glx - 5 years ago 2020-02-15 02:08:29
glx@openttd.org
Fix: Ignore not printable characters when layouting a string
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/gfx_layout.cpp
Show inline comments
 
@@ -628,12 +628,14 @@ static inline void GetLayouter(Layouter:
 
			state.PushColour();
 
		} else if (c == SCC_POP_COLOUR) {
 
			state.PopColour();
 
		} else if (c >= SCC_FIRST_FONT && c <= SCC_LAST_FONT) {
 
			state.SetFontSize((FontSize)(c - SCC_FIRST_FONT));
 
		} else {
 
			/* Filter out non printable characters */
 
			if (!IsPrintable(c)) continue;
 
			/* Filter out text direction characters that shouldn't be drawn, and
 
			 * will not be handled in the fallback non ICU case because they are
 
			 * mostly needed for RTL languages which need more ICU support. */
 
			if (!T::SUPPORTS_RTL && IsTextDirectionChar(c)) continue;
 
			buff += T::AppendToBuffer(buff, buffer_last, c);
 
			continue;
0 comments (0 inline, 0 general)