I crossposted this at devshed and they were able to help me. In case anyone is interested here is the solution to what i was looking for.
Demos:
http://upit.section31.us/?tags
http://image.azulinteractive.com/?tags
Here is what the code looks like implemented.
<?php
define('TAG_MIN_FONT_EM', 1);
define('TAG_MAX_FONT_EM', 3);
function setFontEm($weight) {
$em = ($weight * (TAG_MAX_FONT_EM - TAG_MIN_FONT_EM)) + TAG_MIN_FONT_EM;
return round($em, 2);
}
$tagCounts = array();
$result = mysql_query("select distinct count(*) as tagCount from upit_tags group by tag order by tagCount asc");
while ($row = mysql_fetch_assoc($result)) {
$tagCounts[] = $row['tagCount'];
}
mysql_free_result($result);
$tagCounts = array_flip($tagCounts);
$tagSizes = array(); $count = count($tagCounts);
foreach ($tagCounts as $tagCount => $pos) {
$tagSizes[$tagCount] = setFontEm(($pos + 1) / $count)
}
unset($tagCounts);
$sql = "select tag, count(*) as tagCount from upit_tags group by tag order by tag asc";
$result = mysql_query($sql);
?>
<div id="allTags">
<? while ($row = mysql_fetch_assoc($result)) : ?>
<a href="?browse&search=<?= $row['tag'] ?>" style="font-size: <?= $tagSizes[$row['tagCount']] ?>em;"><?= $row['tag'] ?></a> ...
<? endwhile; mysql_free_result($result); ?>
</div>