Text::Flow

Flexible text flowing and word wrapping for not just ASCII output
Download

Text::Flow Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Stevan Little
  • Publisher web site:
  • http://search.cpan.org/~stevan/

Text::Flow Tags


Text::Flow Description

Flexible text flowing and word wrapping for not just ASCII output Text::Flow is a Perl module that provides a flexible way to wrap and flow text for both ASCII and non-ASCII outputs.SYNOPSIS use Text::Flow; # use it on ASCII text ... my $flow = Text::Flow- >new( check_height = > sub { my $paras = shift; sum(map { scalar @$_ } @$paras) Text::Flow::Wrap- >new( check_width = > sub { length($_) < 70 } ), ); my @sections = $flow- >flow($text); # @sections will now be an array of strings, each string # will contain no more than 10 lines of text each of which # will be no longer then 70 characters long # or use it on text in a PDF file ... my $flow = Text::Flow- >new( check_height = > sub { my $paras = shift; (sum(map { scalar @$_ } @$paras) * $pdf- >get_font_height) < 200; }, wrapper = > Text::Flow::Wrap- >new( check_width = > sub { my $string = shift; $pdf- >get_string_width($string) < 100 }, ) ); my @sections = $flow- >flow($text); # @sections will now be an array of strings, each string # will contain text which will fit within 200 pts and # each line will be no longer then 100 pts wide Requirements: · Perl


Text::Flow Related Software