Term::Drawille - Draw to your terminal using Braille characters
version 0.01
use Term::Drawille;
binmode STDOUT, ':encoding(utf8)';
my $canvas = Term::Drawille->new(
width => 400,
height => 400,
);
for(my $i = 0; $i < 400; $i++) {
$canvas->set($i, $i, 1);
}
print $canvas->as_string;
Text::Drawille makes use of Braille characters to allow you to draw lines, circles, pictures, etc, to your terminal with a surprising amount of precision. It's based on a Python library (https://github.com/asciimoo/drawille); its page has some screenshots that demonstrate what it and this module can accomplish.
Creates a new canvas to draw on.
Valid key value pairs for %params
are:
Specify the width of the canvas in pixels.
Specify the height of the canvas in pixels.
Sets the value of the pixel at ($x
, $y
) to $value
. If $value
is omitted, it defaults to 1
.
The $value is interpreted as a boolean: whether or not to draw the pixel at the given position.
Draws the canvas as a string of Braille characters and returns it. Note that the string consists of Unicode characters and not raw bytes; this means you'll likely have to encode it before sending it to the terminal. This may change in future releases.
https://github.com/asciimoo/drawille
Rob Hoelz <rob@hoelz.ro>
This software is copyright (c) 2014 by Rob Hoelz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Please report any bugs or feature requests on the bugtracker website https://github.com/hoelzro/term-drawille/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.