Text weirdly spaced on Web
I tried to build an application for web and desktop that has a terminal.
On desktop (windows for me) it works just fine:
But when I try to run the exact same app with the exact same code on web, this is shown:
It's functional and works in general, but looks pretty ugly. I tried it in multiple browsers as well, but it doesn't work.
I have the same problem
So i managed to solve this. turns out its just a font issue:
child: TerminalView(
terminal,
controller: terminalController,
autofocus: true,
backgroundOpacity: 1,
textStyle: TerminalStyle(
fontFamily: GoogleFonts.robotoMono().fontFamily!,
fontSize: 14,
),
),
```
This makes the trick
This problem is still present on web in a WASM build - the font workaround works fine in a non-WASM build though.
You can solve this problem by the following methods.
TerminalView(
.......
onKeyEvent: (FocusNode node, KeyEvent event) {
if (!kIsWeb ||
event is! KeyUpEvent ||
event.logicalKey != LogicalKeyboardKey.space) {
return KeyEventResult.ignored;
}
_terminal.textInput(' ');
return KeyEventResult.handled;
},
.......
}