The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Tickit::Widget::Figlet - trivial wrapper around Text::FIGlet for banner rendering

VERSION

version 0.003

SYNOPSIS

 #!/usr/bin/env perl
 use strict;
 use warnings;
 use Tickit;
 use Tickit::Widget::Figlet;
 
 Tickit->new(
        root => Tickit::Widget::Figlet->new(
                font => shift // 'block',
                text => 'Tickit & FIGlet'
        )
 )->run;

DESCRIPTION

Provides a minimal implementation for wrapping Text::FIGlet. Essentially just creates a Text::FIGlet instance and calls figify for rendering into a window.

Basic rendering:

Simple FIGlet rendering with Tickit

METHODS

new

Creates a new instance.

Named parameters:

  • text - the string to display

  • font - which font to use

  • path (optional) - path to load fonts from, will obey $ENV{FIGLIB} by default

  • align (optional) - horizontal alignment to apply to text, can be a number from 0..1 or the text 'left', 'right', 'centre' (or 'center')

Returns the instance.

render_to_rb

Handles rendering.

text

Returns the current text to display. Pass a new string in to update the rendered text.

 $figlet->text('new text');
 is($figlet->text, 'new text');

figlet

Returns the Text::FIGlet instance. Probably a Text::FIGlet::Font subclass.

SEE ALSO

Text::FIGlet, http://www.figlet.org/, http://www.jave.de/figlet/fonts.html

INHERITED METHODS

Tickit::Widget

get_style_pen, get_style_text, get_style_values, key_focus_next_after, key_focus_next_before, on_pen_changed, parent, pen, redraw, requested_cols, requested_lines, requested_size, reshape, resized, set_parent, set_pen, set_requested_size, set_style, set_style_tag, set_window, style_classes, take_focus, window, window_gained, window_lost

AUTHOR

Tom Molesworth <cpan@perlsite.co.uk>

LICENSE

Copyright Tom Molesworth 2015. Licensed under the same terms as Perl itself.