note 106048 deleted from function.swffont.construct by danbrown
| From: | danbrown@php.net | Date: | Thu, 06 Oct 2011 16:15:19 +0000 |
| Subject: | note 106048 deleted from function.swffont.construct by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-183666@lists.php.net to get a copy of this message | ||
Note Submitter: rlamtabbet
----
Correcttion to the given example: (add a space after new)
<?php
$f = new SWFFont("_sans");
?>
I've tested this example on PHP5.3.5 and it failed measurably. The library is great but
it's not up-to-date.
It keeps sending a Fatal error: Loading font failed! Please use new SWFBrowserFont(string:fontname)
for player/browser fonts
I've tried using SWFBrowserFont
$font = new SWFBrowserFont('_sans');
$text = new SWFText();
$text->setFont($font);
Again it failed to set the font (Fatal error: SWFText::setFont() [swftext.setfont]: Called object is
not an SWFFont).
The only work around is to use a textfield instead as shown below
$font = new SWFBrowserFont('_sans');
$text = new SWFTextField();
$text->setFont($font);
or handle the text using Action Script.