xterm.dart
xterm.dart copied to clipboard
Custom FontFamily in TerminalStyle
I would like to set the terminal font using GoogleFonts but in order to do this I would need to pass a TextStyle
rather than a font name. Is there a reason why the TerminalStyle
does not accept a TextStyle
? I can contribute a PR if you would be open to the change and if there are no other blockers. Thank you
Is there a reason why the TerminalStyle does not accept a TextStyle?
Due to some font related issues on flutter desktop platform like this one, a long fontFamilyFallback list is required to ensure monospace characters, emojis and other special characters are correctly rendered on all platforms.
To replace fontSize
and fontFamily
with a TextStyle
field in TerminalStyle
, perhaps we have to provide a way to inherit the default fontFamilyFallback.
Here's a PR (#9) where I added Google Fonts support, hopefully in a non-breaking way, by passing a TextStyle
-producing function into the TerminalStyle
constructor. If passing in a TextStyle
would also work, feel free to change #9 or do that in a different PR - I just wanted to get something working for a personal project. It's working for me in Linux and Web targets.