perl-Text-KnuthPlass-1.02-alt4.1.i586.rpm


Advertisement

Description

perl-Text-KnuthPlass - Breaks paragraphs into lines using the TeX algorithm

Property Value
Distribution ALT Linux Sisyphus
Repository Autoimports i586
Package filename perl-Text-KnuthPlass-1.02-alt4.1.i586.rpm
Package name perl-Text-KnuthPlass
Package version 1.02
Package release alt4.1
Package architecture i586
Package type rpm
Category Development/Perl
Homepage -
License -
Maintainer -
Download size 49.13 KB
Installed size 49.13 KB
use Text::KnuthPlass;
my $typesetter = Text::KnuthPlass->new();
my @lines = $typesetter->typeset($paragraph);
...
To use with plain text:
for (@lines) {
for (@{$_->{nodes}}) {
if ($_->isa("Text::KnuthPlass::Box")) { print $_->value }
elsif ($_->isa("Text::KnuthPlass::Glue")) { print " " }
}
if ($_->{nodes}[-1]->is_penalty) { print "-" }
print "\n";
}
To use with PDF::API2:
my $text = $page->text;
$text->font($font, 12);
$text->lead(13.5);
my $t = Text::KnuthPlass->new(
measure => sub { $text->advancewidth(shift) },
linelengths => [235]
);
my @lines = $t->typeset($paragraph);
my $y = 500;
for my $line (@lines) {
$x = 50;
for my $node (@{$line->{nodes}}) {
$text->translate($x,$y);
if ($node->isa("Text::KnuthPlass::Box")) {
$text->text($node->value);
$x += $node->width;
} elsif ($node->isa("Text::KnuthPlass::Glue")) {
$x += $node->width + $line->{ratio} *
($line->{ratio} < 0 ? $node->shrink : $node->stretch);
}
}
if ($line->{nodes}[-1]->is_penalty) { $text->text("-") }
$y -= $text->lead();
}

Alternatives

Package Version Architecture Repository
perl-Text-KnuthPlass-1.02-alt4.1.x86_64.rpm 1.02 x86_64 Autoimports
perl-Text-KnuthPlass - - -

Requires

Name Value
/usr/lib/perl5 -
libc.so.6(GLIBC_2.1.3) -
libc.so.6(GLIBC_2.4) -
libperl-5.28.so -
libpthread.so.0(GLIBC_2.0) -
perl(Class/Accessor.pm) -
perl(Data/Dumper.pm) -
perl(XSLoader.pm) -
perl(base.pm) -
perl(constant.pm) -
rpmlib(PayloadIsLzma) -
rpmlib(SetVersions) -
rtld(GNU_HASH) -

Provides

Name Value
perl(Text/KnuthPlass.pm) = 1.020
perl-Text-KnuthPlass = 1.02-alt4.1

Download

Type URL
Mirror ftp.altlinux.org
Binary Package perl-Text-KnuthPlass-1.02-alt4.1.i586.rpm
Source Package perl-Text-KnuthPlass-1.02-alt4.1.src.rpm

Install Howto

  1. Add the following line to /etc/apt/sources.list:
    
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus i586 autoimports
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    
  2. Update the package index:
    # sudo apt-get update
  3. Install perl-Text-KnuthPlass rpm package:
    # sudo apt-get install perl-Text-KnuthPlass

Files

Path
/usr/lib/perl5/Text/KnuthPlass.pm
/usr/lib/perl5/auto/Text/
/usr/lib/perl5/auto/Text/KnuthPlass/KnuthPlass.so
/usr/share/doc/perl-Text-KnuthPlass-1.02/Changes
/usr/share/doc/perl-Text-KnuthPlass-1.02/README

See Also

Package Description
perl-Text-Levenshtein-Damerau-XS-3.2-alt2.1.i586.rpm XS Damerau Levenshtein edit distance
perl-Text-Levenshtein-Flexible-0.09-alt5.1.i586.rpm XS Levenshtein distance calculation with bounds and costs
perl-Text-Levenshtein-XS-0.503-alt3.1.i586.rpm XS Levenshtein edit distance
perl-Text-LevenshteinXS-0.03-alt9_37.i586.rpm XS implementation of the Levenshtein edit distance
perl-Text-Markdown-Discount-0.11-alt3.1.i586.rpm fast function for converting markdown to HTML (requires C compiler)
perl-Text-Match-FastAlternatives-1.05-alt4.1.i586.rpm efficient search for many strings
perl-Text-Metaphone-20160805-alt3.1.i586.rpm A modern soundex. Phonetic encoding of words
perl-Text-Prefix-XS-0.15-alt4.1.i586.rpm Fast prefix searching
perl-Text-QRCode-0.05-alt3.1.i586.rpm Generate text base QR Code
perl-Text-QueryString-0.03-alt4.1.i586.rpm Fast QueryString Parser
perl-Text-Reflow-1.17-alt3.1.i586.rpm perl module Text-Reflow
perl-Text-Reflow-scripts-1.17-alt3.1.i586.rpm perl-Text-Reflow scripts
perl-Text-Sass-XS-0.11-alt4.1.i586.rpm Perl Binding for libsass
perl-Text-Scan-0.31-alt4.1.i586.rpm Fast search for very large numbers of keys in a body of text
perl-Text-SpeedyFx-0.012-alt3.1.i586.rpm tokenize/hash large amount of strings efficiently
Advertisement
Advertisement