PDF-Kit

 view release on metacpan or  search on metacpan

lib/PDF/Kit.pm  view on Meta::CPAN

      $trailing_width = $space_width;
      if( $two_spaces ){
        $trailing_spaces .= $SPACE;
        $trailing_width .= $space_width;
      }
    }

    $space_width = &{$opts{-compute_length}}( { %opts, -print=>0, }, $SPACE ); # must redo every time since might have changed from previous

    # process the text
    my @text = split m{ ( \s+ ) }msx, $text;
    while( @text ){
      my $word = shift @text;

      if( $word =~ m{ \A \s }msx ){
        $space_pending = 1;
        next;
      }

      my $word_length = &{$opts{-compute_length}}( { %opts, -print=>0, }, $word );
      my $extended_length = $word_length;



( run in 0.676 second using v1.01-cache-2.11-cpan-71847e10f99 )