title: Listing available fonts in PHP
body: <p>I'd like to query what fonts are available on a *nix-like system, ideally using PHP 5.2 or 5.3, but there doesn't seem to be many libraries available to do it in a system-independent way. <a href="https://code.google.com/p/php-font-lib/" rel="noreferrer">php-font-lib</a> just scans a directory (<a href="https://code.google.com/p/php-font-lib/source/browse/trunk/www/font_list.php" rel="noreferrer">code</a>, <a href="http://pxd.me/php-font-lib/www/font_explorer.html" rel="noreferrer">demo</a>) but I'd hope there is a more elegant way to do it. (In any case, scanning a folder is only part of the task; font files still need to be opened to retrieve name and other metadata).</p>
  
  <p>Background: I am rendering PDFs on a webserver using Inkscape, and would like to determine what fonts are available to render text elements. I'm developing on OS 10.6.8 and deploying on Linux.</p>
  
  <p>Edit: I've found a <a href="https://github.com/mgdm/php-pango" rel="noreferrer">PHP wrapper</a> for Pango, which is an advanced font renderer often used with Cairo; both of these are used in Inkscape. The wrapper is quite new, so I am not yet sure whether it can produce a font listing - but it does look interesting <code>:)</code>.</p>