|
From: Klaus R. <kla...@rz...> - 2007-11-12 09:34:47
|
Hi,
> 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.
Have you tried other combinations ? Like using the exported font again with=
=20
ming or Adobe IDE ?=20
Klaus
>
> #!/usr/bin/perl -w
> use strict;
> BEGIN{
> use CGI qw(:standard);
> #print header('text/html');
> #print "<pre style=3D'font-family:Arial;font-size:14px;'>";
> use Carp qw( cluck );
> $|=3D1;
> open STDERR, ">&STDOUT" or die "Content-type:text/html\n\noops" ;
> $SIG{__DIE__} =3D sub{
> print header('text/html');
> print "<div
> style=3D'position:relative;width:800px;font-family:Arial;font-size:14px;'=
>";
> Carp::cluck;
> print "</div>";
> close STDERR;
> };
> }
> my $sample =3D param('sample') ? param('sample') :
> 'abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRDSTUVWXYZ1234567890@=E2=82=AC=
=C2=A7$%&/()=3D"!
>?[]{}#+*,. =C3=9F_-;:<>';
> $|=3D1;
> use SWF qw( :ALL );
>
> SWF::setVersion(8);
>
> my $m =3D new SWF::Movie();
> $m->setBackground(0xaa, 0xaa, 0xff);
> my $fontPath =3D '/home/axel/.gimp-2.2/fonts/freehan1.ttf';
> $fontPath =3D 'BIMINI__.ttf';
> #$fontPath =3D
> '/srv/www/htdocs/teamtrier.de/httpdocs/truetype/BIMINI__.TTF';
> $fontPath =3D '/home/axel/.gimp-2.2/fonts/BIMINI__.TTF';
> $fontPath =3D '/home/axel/.gimp-2.2/fonts/quill_s.ttf';
>
> die("Font $fontPath not found") unless -f $fontPath;
> my $font=3Dnew SWF::Font($fontPath);
>
> my $fontChar =3D $m->addFont($font);
> $fontChar->addChars($sample);
> $m->addExport($fontChar, "sample");
> $m->writeExports();
> $m->nextFrame();
> my $b =3D $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
|