略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: SWFText

2024-11-14

The SWFText class

(PHP 5 < 5.3.0, PECL ming SVN)

简介

SWFText.

类摘要

SWFText {
/* 方法 */
addString ( string $string ) : void
addUTF8String ( string $text ) : void
__construct ( void )
getAscent ( void ) : float
getDescent ( void ) : float
getLeading ( void ) : float
getUTF8Width ( string $string ) : float
getWidth ( string $string ) : float
moveTo ( float $x , float $y ) : void
setColor ( int $red , int $green , int $blue [, int $a = 255 ] ) : void
setFont ( SWFFont $font ) : void
setHeight ( float $height ) : void
setSpacing ( float $spacing ) : void
}

Table of Contents

add a note add a note

User Contributed Notes 2 notes

up
2
franky at boucheros dot com
17 years ago
For windows platform :

<?php
$f
=new SWFFont("_sans");
$t=new SWFTextField();
?>

and comment the moveto line.
up
1
p_smiecho at interia dot pl
15 years ago
It seems to me that there is a bug: everything works perfect but only with Linux. SWFText crashes while working on Windows. So I do it that way:

<?php
   $f
= new SWFFont('Arial');
  
$t = new SWFTextField();
  
$t -> setFont($f);
  
$t -> addString('Hello world!!!');

  
$p = new SWFSprite();
  
$i = $p -> add($t);
  
$i -> moveto(100, 100);    // Here you can move text !!
   //$p -> remove($i);

  
$m = new SWFMovie();
//   ...
  
$m -> add($p);
?>

Of course it writes text where I want, but I still can't get other methods of SWFText class. For example: I can't get text width (swftext->getwidth).

官方地址:https://www.php.net/manual/en/class.swftext.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3