App-Basis-ConvertText2
view release on metacpan or search on metacpan
lib/App/Basis/ConvertText2/Plugin/Gle.pm view on Meta::CPAN
=head1 NAME
App::Basis::ConvertText2::Plugin::Gle
=head1 SYNOPSIS
my $content = "size 12 8
set font texcmr
begin graph
title "Fruit Production"
xtitle "Weekday"
ytitle "Production [x100 pound]"
xticks off
data "test.dat"
bar d1,d2 fill navy,skyblue
end graph" ;
my $params = {} ;
my $obj = App::Basis::ConvertText2::Plugin::Gle->new() ;
my $out = $obj->process( 'gle', $content, $params) ;
=head1 DESCRIPTION
convert a gle/glx text string into a PNG, requires gle program http://glx.sourceforge.net/
=cut
# ----------------------------------------------------------------------------
package App::Basis::ConvertText2::Plugin::Gle;
$App::Basis::ConvertText2::Plugin::Gle::VERSION = '0.4';
use 5.10.0;
use strict;
use warnings;
use Path::Tiny;
use Moo;
use Image::Resize ;
use App::Basis;
use App::Basis::ConvertText2::Support;
use namespace::autoclean;
has handles => (
is => 'ro',
init_arg => undef,
default => sub { [qw{gle glx}] }
);
use constant GLE => "gle";
use constant RES => 28 ;
# ----------------------------------------------------------------------------
=item gle
create a simple gle image
parameters
data - gle text
filename - filename to save the created image as
hashref params of
title - title to use for image alt attribute
size - size of image, widthxheight - optional, default 720x512
transparent - flag to set background transparent - optional
=cut
sub process {
my $self = shift;
( run in 0.551 second using v1.01-cache-2.11-cpan-5735350b133 )