drawille icon indicating copy to clipboard operation
drawille copied to clipboard

Implement text rendering methods

Open avindra opened this issue 4 years ago • 2 comments

https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeText https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillText

If we ignore ctx.font to start with, we don't need to worry about font size or a specific font, as terminals generally use the same font and font-size for everything.

https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font

avindra avatar Jan 10 '21 22:01 avindra

I started testing drawille in my snake game here:

https://github.com/avindra/snake/blob/src/src/tty.ts https://github.com/avindra/snake/blob/b7604e1c189ae160e76c06f3d53b35a89aa44baf/Makefile#L13

I might take a stab at it if I get around to hacking more snake.

avindra avatar Jan 10 '21 22:01 avindra

:+1: for this. It seems to be an easy task looking at how asciimoo/drawille does it - https://github.com/asciimoo/drawille/blob/166fe0ceed4c13ab0c25505fd9dd72e9e7b56d66/drawille.py#L168-L177

littledivy avatar Jan 15 '21 04:01 littledivy