<?php

require 'browserhawk.php';

  // This file is provided under the terms of the BrowserHawk4J license
  // agreement.  Copyright (c) 2004-2011 cyScape, Inc. All rights reserved.

  // First we make sure the system executing this example has an
  // Enterprise Edition license as required for this test.
  // Note: This is NOT needed in your pages, only for this sample.
  if (strpos($BrowserHawk->getVersion(), "Ent") === false) {
    echo "Enterprise License Required.  ";
    echo "You are using " . $BrowserHawk->getVersion() . ".  ";
    echo "See <a href='http://www.cyscape.com/order/'>http://www.cyscape.com/order/</a> for upgrade information.";
    return;
  }

  $fonts = "Arial";

  $options->addProperty("FontsInstalled");
  $options->setFontsToCheck($fonts);

  $options->setPageMessage("Checking your browser. Please wait...");
  $options->setBodyTag("BGCOLOR=#FFFFFF");
  $options->setPageTitle("Please wait...");

  $einfo = bhextended($options);
?>

<html>
<head><title>Font Test Page</title></head>

<body bgcolor=white>
<font face="helvetica">

<h2>Font Test Page</h2>

<?php
// The PHP Java bridge doesn't let you compare complex Java objects for
// equality, so we'll see if their toString() forms match.
if ($einfo->toString() === $UNSUPPORTED->toString()) { ?>
  <big>No extended information is available.  Only Netscape,
  Mozilla, Firefox, Chrome, IE, Opera, Safari, and AOLBrowser clients 
  are supported.</big>
<?php } else if ($einfo->getJavaScriptEnabled() === false) { ?>
  <big>No extended information is available.  This client has
  JavaScript disabled.</big>
<?php } else if ((!$info->getBrowser() == "IE") || !($info->getVersion() > 5)) { ?>
  <big>No font detection is available.  Your browser has to be IE on Windows or
  Mac version 5 or later.</big>
<?php } else { ?>

This example tests if your browser has "Arial" installed.<br>

<br>

<table>
<tr><th align="left">Font Name</th><th>Installed</th></tr>
<tr><td width="150"><font face="Arial">Arial</font></td>
        <td><?php boolprint($einfo->getFontInstalled("Arial")) ?></td></tr>
</table>

<?php } ?>

<P>
<b><a href="fontcheck_basic.php">Retry this test</a></b><P>
<b><a href="index.html">Return to list of other PHP samples</a></b><P>
<b><a href="http://www.cyscape.com/order/">BrowserHawk Pricing and Ordering</a></b><P>
<b><a href="http://www.cyscape.com/">cyScape home page</a></b><P>
</font>
</body>
</html>
