Acme-SaBalTongMun

 view release on metacpan or  search on metacpan

lib/Acme/SaBalTongMun.pm  view on Meta::CPAN


has 'radius' => ( isa => 'Int', is => 'rw', required => 1 );


has 'font' => ( isa => 'Str', is => 'rw', required => 1 );


has 'font_size' => ( isa => 'Int', is => 'rw', required => 1 );


has 'font_charset' => ( isa => 'Str', is => 'rw', default => 'Unicode' );


has 'color' => ( isa => 'Str', is => 'rw', required => 1 );


has 'people' => ( isa => 'ArrayRef[Str]', is => 'rw', required => 1 );


sub generate {
    my $self = shift;

lib/Acme/SaBalTongMun.pm  view on Meta::CPAN


        $image->stringFT(
            $image->colorAllocate( _get_rgb( $self->color ) ),  # fgcolor
            $self->font,                                        # .ttf path
            $self->font_size,                                   # point size
            $string_angle,                                      # rotation angle
            $dest_x,                                            # X coordinates
            $dest_y,                                            # Y coordinates
            $string,
            {
                charmap     => $self->font_charset,
            },
        );

        $dest_angle += $angle;
    }

    return $image;
}

sub _get_rgb { map hex, $_[0] =~ m/^#(..)(..)(..)$/ }

lib/Acme/SaBalTongMun.pm  view on Meta::CPAN


=head2 font

This attribute stores the TrueType(*.ttf) font path.
Only the font which has unicode charmap is allowed.

=head2 font_size

This attribute stores the size of the font.

=head2 font_charset

This attribute stores the charset of the font.
This is optional and the default value is "Unicode".

=head2 color

This attribute stores the color of the font.

=head2 people

This attribte is an arrayref of strings
that are the members of the round robin.



( run in 0.230 second using v1.01-cache-2.11-cpan-4d50c553e7e )