You are here

function _textimage_font_list in Textimage 5

Same name and namespace in other branches
  1. 5.2 textimage_admin.inc \_textimage_font_list()
  2. 6.2 textimage_admin.inc \_textimage_font_list()
  3. 7.2 textimage.admin.inc \_textimage_font_list()

Returns an array of files with TTF extensions in the specified directory.

2 calls to _textimage_font_list()
textimage_preset_edit in ./textimage.module
textimage_settings_form in ./textimage.module

File

./textimage.module, line 1158

Code

function _textimage_font_list($fontdir) {
  $filelist = array();
  if (is_dir($fontdir) && ($handle = opendir($fontdir))) {
    while ($file = readdir($handle)) {
      if (preg_match("/\\.ttf\$/i", $file) == 1) {
        $filelist[] = $file;
      }
    }
    closedir($handle);
  }
  return $filelist;
}