Well, assuming that craigh is incorrect (which he's not) and that every person happened to have the exact same settings as you, this is how you could go about doing such a thing:
Save the link text (what's between the <a> and the </a>) to a string, and then, using the GD library, use imagettfbbox() to calculate how much space the text takes up:
$size = imagettfbbox("12",0,"fonts/arial.ttf",$linktext);
$width = abs($size[4]-$size[0]);
Then, do it all again... 6 times. 🙂