Acme-Pony
view release on metacpan or search on metacpan
lib/Acme/Pony.pm view on Meta::CPAN
my @chars=grep { /[buffy]/i; } split(//, pop);
foreach (@chars) {
$_=($_=~/[buffy]/)?0:1;
}
pack "b*", join '', @chars;
}
sub scalepony {
my @chars = @_;
my $chars = join '', @chars;
my $wantlength = length $chars;
my $scale;
# What scale do we want?
if ($wantlength > 201242) {
$scale = 1000 * sqrt($wantlength / 201242);
} else {
$scale = 1000 / sqrt(201242 / $wantlength);
}
$scale *= 0.95;
# These were worked out by hand with very accurate graph paper
my @xpoints = (0.26735840061026, 0.290728815714195, 0.297102536393109, 0.299227321848579, 0.322598690483758, 0.348092937511919, 0.36933761362914, 0.403331002479181, 0.430951624181552, 0.450073104062043, 0.471317780179264, 0.484066492912084, 0.49681...
# ... or I may have used Sketch...
my @ypoints = (0.0303060573188429, 0.0417852818858603, 0.0264797254557372, 0.0150004436442946, 0.0417852818858603, 0.0666571259291486, 0.0685702346162763, 0.0915289699724368, 0.118313922702853, 0.141272371836888, 0.169970719476557, 0.21014800546111...
# Scale the points (with ASCII 'fixed' font size scaling too)
@xpoints = map { $_ *= $scale; $_ = int($_) } @xpoints;
( run in 0.572 second using v1.01-cache-2.11-cpan-65fba6d93b7 )