interesante truco (no lo he probado) que puede servir en muchos navegadores: pruebalo y me avisas
http://stackoverflow.com/questions/5...-in-javascript
Código:
var span = document.createElement("span");
span.appendChild(document.createTextNode("text here"));
//@maycolalvarez: aqui aplicarías la familia de fuentes como css, si quieres evitar que se muestre utiliza visibility:hidden y no display:none
//@maycolalvarez:
//span.style="white-space: nowrap;visibility:hidden;"
span.style = ""; // to make sure the elment doesn't have "display: none" or such
document.body.appendChild(span); // adding it to the DOM
var textWidth = span.offsetWidth;