|
From: Axel H. <ax...@3d...> - 2007-11-11 06:23:26
|
Hi Klaus,
all reported problems solved.
But now I found another little bug which is there also in php:
with my script attached the chars 'wyz' are rendered always uppercase when
I use the exported font in another swf (created with haxe)
while the font works well if I use it in a textfield directly...
tried a few fonts - always the same result.
#!/usr/bin/perl -w
use strict;
BEGIN{
use CGI qw(:standard);
#print header('text/html');
#print "<pre style='font-family:Arial;font-size:14px;'>";
use Carp qw( cluck );
$|=1;
open STDERR, ">&STDOUT" or die "Content-type:text/html\n\noops" ;
$SIG{__DIE__} = sub{
print header('text/html');
print "<div
style='position:relative;width:800px;font-family:Arial;font-size:14px;' >";
Carp::cluck;
print "</div>";
close STDERR;
};
}
my $sample = param('sample') ? param('sample') :
'abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRDSTUVWXYZ1234567890@€§$%&/()="!?[]{}#+*,.
ß_-;:<>';
$|=1;
use SWF qw( :ALL );
SWF::setVersion(8);
my $m = new SWF::Movie();
$m->setBackground(0xaa, 0xaa, 0xff);
my $fontPath = '/home/axel/.gimp-2.2/fonts/freehan1.ttf';
$fontPath = 'BIMINI__.ttf';
#$fontPath =
'/srv/www/htdocs/teamtrier.de/httpdocs/truetype/BIMINI__.TTF';
$fontPath = '/home/axel/.gimp-2.2/fonts/BIMINI__.TTF';
$fontPath = '/home/axel/.gimp-2.2/fonts/quill_s.ttf';
die("Font $fontPath not found") unless -f $fontPath;
my $font=new SWF::Font($fontPath);
my $fontChar = $m->addFont($font);
$fontChar->addChars($sample);
$m->addExport($fontChar, "sample");
$m->writeExports();
$m->nextFrame();
my $b = $m->save("sample.swf", 9);
print header(),"$b bytes written to sample.swf\n";
>>Hmm, I was surprised that no extra module SWF::FontCharacter
>>was build
>>- meanwhile I noticed that use SWF qw(:ALL) dosn't work anymore :
>>Can't locate SWF/FontCharacter.pm in @INC
>>
>>
>
>I added FontCharacter.pm. Should work now...
>
> Klaus
>
>
>
>
>
|