function _textimage_font_list in Textimage 6.2
Same name and namespace in other branches
- 5.2 textimage_admin.inc \_textimage_font_list()
- 5 textimage.module \_textimage_font_list()
- 7.2 textimage.admin.inc \_textimage_font_list()
Returns an array of files with .otf/.ttf extensions in the specified directory.
Parameters
$fontdir: Full path of the font directory.
Return value
Array of font files.
2 calls to _textimage_font_list()
File
- ./
textimage_admin.inc, line 746
Code
function _textimage_font_list($fontdir) {
$filelist = array();
if (is_dir($fontdir) && ($handle = opendir($fontdir))) {
while ($file = readdir($handle)) {
if (preg_match("/\\.[ot]tf\$/i", $file) == 1) {
$font = _textimage_font_name($fontdir . '/' . $file);
$filelist[$file] = $font['name'];
}
}
closedir($handle);
}
asort($filelist);
return $filelist;
}