You are here

function _textimage_font_list in Textimage 5.2

Same name and namespace in other branches
  1. 5 textimage.module \_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 .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()
textimage_preset_edit in ./textimage_admin.inc
textimage_settings_form in ./textimage_admin.inc
@file

File

./textimage_admin.inc, line 747

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;
}