<?php
# Show seven fonts in random sizes and colors.
# Reload to see the changes
header("Content-type: application/x-shockwave-flash");
# Higher values for $frames make it quicker!
$frames = 1;
swf_openfile("php://stdout", 256, 256, $frames, .9, .9, .9);
# Viewport. Bigger values give a bigger viewport and tinier content
define("VIEWPORT", 150);
swf_ortho2(-VIEWPORT, VIEWPORT, -VIEWPORT, VIEWPORT);
# Start with empty frame
swf_showframe();
$tmp = 500;
$fontnum = -1;
$fonts = explode(",", "Curl-Roman,Haeberli,Inja,Ligon-Bold,Ligon-Roman,Mod,Pix3");
swf_translate(-100, 100, 0);
for( $i = 0; $i< sizeof( $fonts ); $i++ ){
swf_addcolor(rnd01(), rnd01(), rnd01(), 0);
swf_definefont(++$fontnum, $fonts[$i]);
swf_fontsize( rand(6,45) );
# Show font name. Remove "-" from font name as Curl-Roman does not support that character!
swf_definetext(++$tmp, str_replace("-", "", $fonts[$i] ), 0);
swf_translate(0, -20, 0);
swf_placeobject($tmp, 60);
swf_showframe();
}
swf_closefile();
# Return random color value i.e. value between 0 and 1
function rnd01(){ return (mt_rand(0,0xFF) / 0xFF); }
?>
swf_definefont
(PHP 4)
swf_definefont — フォントを定義する
説明
void swf_definefont ( int fontid, string fontname )関数 swf_definefont() は、パラメータ fontname で指定したフォントを定義し、パラメータ fontid で指定した ID に設定します。この関数は、fontname で指定したフォントを 現在のフォントに設定します。
パラメータ
- fontid
フォントに指定する ID。
- fontname
現在のフォントとして設定するフォント。
返り値
値を返しません。
swf_definefont
Joachim Kruyswijk
28-Jan-2006 10:50
28-Jan-2006 10:50
greg at newtechy dot com
17-Aug-2001 11:35
17-Aug-2001 11:35
These are the standard fonts that I have found so far that come with this engine.
"Curl-Roman"
"Haeberli"
"Inja"
"Ligon-Bold"
"Ligon-Roman"
"Mod"
"Pix3"
Most of them are not too great but they are the only ones that come by default. There are ways to convert other fonts so that you can use them. I haven't converted any yet so I don't know for sure how well it works.
hotkey at hehe dot com
16-May-2001 03:42
16-May-2001 03:42
For detailed instructions on how to convert fonts into Flash-Fonts check
http://developer.bestbytes.de
regards, HotKey