\r in \r\n line endings renders as tofu (.notdef) glyph instead of being treated as line separator
Problem
When text contains Windows-style \r\n line endings, the \r character is rendered as a visible tofu box (.notdef glyph) instead of being consumed as part of the line separator.
Root Cause
In draw/src/text/layouter.rs, layout_multiline() splits lines using split('\n'):
This leaves \r at the end of each line. The \r is then passed to the shaper (rustybuzz), which looks it up in the font's cmap table. Since \r (U+000D) is a control character with no visible glyph, it maps to glyph ID 0 (.notdef), which renders as a tofu box.
Additionally, finish_current_row() hardcodes a +1 byte skip for the newline:
This assumes all line endings are exactly 1 byte (\n), so \r\n (2 bytes) and standalone \r (old Mac style) are not handled correctly.
Impact
\r\nline endings: \r renders as a visible tofu box at the end of every line- Standalone
\rline endings: text is not split into lines at all
Reproduction
Any text with \r\n line endings passed to a Label, TextInput, CodeEditor, or any widget that uses the layouter will exhibit this behavior. This is especially common on Windows where files typically use \r\n.
Source: makepad/makepad