This can't be done with CSS font-size, as the inherited size relating to glyphs is the parents font-size, and not it's box width.
It can be done with Javascript as mentioned here.
Matthew Riches put some code on JSFiddle to demonstrate this. I'm adding it here too so SO also has it:
<div id="container" style="width: 200px; background: #cccccc;">
<span id="container">M</span>
</div>
and some js:
$(document).ready(function() {
var fontSize = parseInt($("#container").height())+"px";
$("#container span").css('font-size', fontSize);
});