You are here: How do you generate an array of actual font names from your /fonts folder in PHP? « PHP Programming Language « IT news, forums, messages
How do you generate an array of actual font names from your /fonts folder in PHP?

Posted by comp.lang.php on 01/10/07 07:16

Consider my code:

[PHP]
/**
* Set the TTF array property $ttfArray
*
* @access private
* @see actual_path
*/
function &setTTFArray() { // STATIC VOID METHOD
global $ttfPath; // OBTAIN VAR FROM project_globals.inc.php
if (is_dir($ttfPath)) {
$dirID = @opendir(actual_path($ttfPath));
while ($ttf = @readdir($dirID)) if
(@is_file(actual_path("$ttfPath/$ttf")) && preg_match('/\.ttf$/i',
$ttf)) @array_push($this->ttfArray, actual_path("$ttfPath/$ttf"));
}
}
[/PHP]

This will generate an array of TTF font names, however, the problem is
that it generates an array of TTF font FILE names, which is usually
utterly unreadable, at least unknowable, to the user.

How can I change it to be an array of the actual TTF font names and not
the literal TTF font FILE names?

The directory will be utterly dynamic as this is from a portable web
application.

Thanx
Phil

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация