docs: function(text, fontSize, fontFamily, textWidth)
  	{
  		fontSize = (fontSize != null) ? fontSize : mxConstants.DEFAULT_FONTSIZE;
  		fontFamily = (fontFamily != null) ? fontFamily : mxConstants.DEFAULT_FONTFAMILY;
  		var div = document.createElement('div');
  		
  		// Sets the font size and family
  		div.style.fontFamily = fontFamily;
  		div.style.fontSize = Math.round(fontSize) + 'px';
  		div.style.lineHeight = Math.round(fontSize * mxConstants.LINE_HEIGHT) + 'px';
  		
  		// Disables block layout and outside wrapping and hides the div
  		div.style.position = 'absolute';
  		div.style.visibility = 'hidden';
  		div.style.display = (mxClient.IS_QUIRKS) ? 'inline' : 'inline-block';
  		div.style.zoom = '1';
  		
  		if (textWidth != null)
  		{
  			div.style.width = textWidth + 'px';
  			div.style.whiteSpace = 'normal';
  		}
  		else
  		{
  			div.style.whiteSpace = 'nowrap';
  		}
  		
  		// Adds the text and inserts into DOM for updating of size
  		div.innerHTML = text;
  		document.body.appendChild(div);
  		
  		// Gets the size and removes from DOM
  		var size = new mxRectangle(0, 0, div.offsetWidth, div.offsetHeight);
  		document.body.removeChild(div);
  		
  		return size;
  	}