<?php
if (!defined('_GNUBOARD_'))
  exit;

$font_sql = "SELECT * FROM {$g5['font_table']} ORDER BY font_name ASC";
$font_result = sql_query($font_sql);

echo "<style id=\"extra_font\">";
while ($row = sql_fetch_array($font_result)) {
  $font_family = $row['font_family'];
  $font_url = stripslashes($row['font_url']);
  $font_weight = $row['font_weight'];
  $font_style = $row['font_style'];

  if (strpos($font_url, '@import') !== false) {
    echo "{$font_url}\n\n";
  } else {
    echo "@font-face {\n";
    echo "  font-family: '{$font_family}';\n";
    echo "  src: {$font_url};\n";
    echo "  font-weight: {$font_weight};\n";
    echo "  font-style: {$font_style};\n";
    echo "}\n\n";
  }
}
echo "</style>";
