mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 18:46:43 +00:00
Write the missing char U+FFFD when unable to render a char in term.write
This commit is contained in:
parent
001ce2f626
commit
3f9f036b49
1 changed files with 11 additions and 9 deletions
|
@ -202,7 +202,16 @@ internal class Term : IComponent
|
||||||
var charpos = realpos + CharOffset;
|
var charpos = realpos + CharOffset;
|
||||||
_game.Drawing.DrawRectangle(realpos, new(CharWidth, CharHeight), bg, Math.Min(CharWidth, CharHeight));
|
_game.Drawing.DrawRectangle(realpos, new(CharWidth, CharHeight), bg, Math.Min(CharWidth, CharHeight));
|
||||||
//_game.Drawing.DrawRectangle(realpos, new(CharWidth, CharHeight), Color.Red, 1);
|
//_game.Drawing.DrawRectangle(realpos, new(CharWidth, CharHeight), Color.Red, 1);
|
||||||
_game.Drawing.DrawString(charpos, ch.ToString(), fg);
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_game.Drawing.DrawString(charpos, ch.ToString(), fg);
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (ArgumentException ex) // UTF-16 fuckery
|
||||||
|
{
|
||||||
|
_game.Drawing.DrawString(charpos, "\xFFFD", fg);
|
||||||
|
}
|
||||||
|
|
||||||
if (!save)
|
if (!save)
|
||||||
return;
|
return;
|
||||||
|
@ -316,14 +325,7 @@ internal class Term : IComponent
|
||||||
if (!L.IsNone(1))
|
if (!L.IsNone(1))
|
||||||
str = L.ToString(1);
|
str = L.ToString(1);
|
||||||
|
|
||||||
try
|
Write(str);
|
||||||
{
|
|
||||||
Write(str);
|
|
||||||
}
|
|
||||||
catch (ArgumentException ex) // UTF-16 fuckery
|
|
||||||
{
|
|
||||||
L.Error(ex.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue