You are here

function imagecache_textactions_help in ImageCache Actions 6

Same name and namespace in other branches
  1. 5.3 imagecache_textactions.module \imagecache_textactions_help()
  2. 5.2 imagecache_textactions.module \imagecache_textactions_help()

Experimental diagnostic page to assist locating valid fonts on the system. Only tuned for Ubuntu so far. I've been unable do find ubiquitous tools that provide useful font listings.'

File

./imagecache_textactions.module, line 37

Code

function imagecache_textactions_help($path, $arg) {
  switch ($path) {
    case 'admin/help#imagecache_textactions':
      $output = "<p>\n        For text rendering to work on a server, we <em>must</em>\n        know the system path to the font <em>file</em>, not just the name.\n        Font library handling differs too much on different systems and\n        the available PHP toolkits are unable to return good diagnostics.\n        </p><p>\n        On Debian/Ubuntu, you may find your fonts in and under\n        <code>/usr/share/fonts/truetype/</code>\n        eg <code>'/usr/share/fonts/truetype/ttf-bitstream-vera/VeraMono.ttf'</code>\n        </p><p>\n        On OSX, they are probably in <code>/Library/Fonts/</code>\n        eg <code>'/Library/Fonts/Times New Roman Bold Italic.ttf'</code>\n        </p><p>\n        On Windows, they are probably in <code>C://WINDOWS/Fonts/</code>\n        eg <code>'C://WINDOWS/Fonts/comic.TTF'</code>\n        </p><p>\n        Of course, this will change if you deploy to a different server!\n        so the best approach is to place your own TTF font file inside your\n        <em>files</em> directory and use that. \n        Just give the filename with no path and it should be found..\n        </p>\n      ";
      $output .= t("<p>Files directory is !files</p>", array(
        '!files' => file_directory_path(),
      ));
      if (ini_get('safe_mode')) {
        $output .= t("<p>\n          It appears PHP 'safe mode' is on. \n          This prevents me for knowing which fonts are on your system. \n          You will have to know the exact path and filename of the fonts you intend to use \n          - or upload some *.ttf files to your 'files' directory and use them from there.\n        </p>");
      }
      else {
        $list = `find /usr/share/fonts -name \\*.ttf`;
        $output .= "<p>Fonts Found : <pre>" . $list . "</pre></p>";
      }
      return $output;
      break;
  }
}