note 73969 added to ref.ming
| From: | rolf at winmutt dot com | Date: | Sun, 18 Mar 2007 21:51:13 +0000 |
| Subject: | note 73969 added to ref.ming | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124579@lists.php.net to get a copy of this message | ||
Here is a little font browser I made to try and typeset match my designers font from the pack of
1300+ fdb I found on google:
<?
$m = new SWFMovie();
$m->setBackground(0xFF, 0xFF, 0xFF);
$m->setDimension(320, 40);
function drawGlyphString($string, $s, $f, $fill) {
$s->setRightFill($fill);
$s->movePenTo(0, $f->getAscent());
for ($i=0; $i<strlen($string); $i++) {
$s->drawGlyph($f, substr($string,$i,1), $size);
$s->movePen($f->getWidth(substr($string,$i,1)), 0);
}
}
function drawFont($f) {
$logo = new SWFShape();
$grey = $logo->addFill(0, 0, 0);
drawGlyphString('yrt '.$_REQUEST['fdb'], $logo, $f, $grey);
return $logo;
}
if ($_REQUEST['fdb']) {
$f = new SWFFont($_REQUEST['fdb']);
$i = $m->add(drawFont($f));
$i->scaleTo(0.5);
header('Content-type: application/x-shockwave-flash');
$m->output();
} else {
if (!$_REQUEST['o']) $_REQUEST['o']=0;
if (!$_REQUEST['l']) $_REQUEST['l']=80;
$o=$_REQUEST['o'];
$l=$_REQUEST['l'];
$d = dir(".");
while (false !== ($entry = $d->read())) {
if (stristr($entry, 'fdb') && !strstr($entry, '-I') &&
!strstr($entry, '-B')) {
if ($_REQUEST['o']) {
$_REQUEST['o']--;
} elseif ($_REQUEST['l'] ) {
$_REQUEST['l']--;
echo '<iframe height="30px"
src="fonts.php?fdb='.$entry.'&"
title="'.$entry.'"></iframe>';
} else {
echo '<img src="/creativesyndrome.com/logo.png"><br><a
href="?l='.$l.'&o='.($o+$l).'">next ></a>';exit;
}
}
}
$d->close();
}
?>
----
Server IP: 216.194.113.175
Probable Submitter: 24.98.32.175
----
Manual Page -- http://www.php.net/manual/en/ref.ming.php
Edit -- https://master.php.net/note/edit/73969
Del: integrated -- https://master.php.net/note/delete/73969/integrated
Del: useless -- https://master.php.net/note/delete/73969/useless
Del: bad code -- https://master.php.net/note/delete/73969/bad+code
Del: spam -- https://master.php.net/note/delete/73969/spam
Del: non-english -- https://master.php.net/note/delete/73969/non-english
Del: in docs -- https://master.php.net/note/delete/73969/in+docs
Del: other reasons-- https://master.php.net/note/delete/73969
Reject -- https://master.php.net/note/reject/73969
Search -- https://master.php.net/manage/user-notes.php