public int getTextDisplayedWidth(String text) {
		if (text == null)
			return 0;
		int width = 0;
		
		/*
		 * Iterate through every character in the text.
		 */
		for (int c = 0; c < text.length(); c++) {
			/*
			 * If the current character is the start of a colour
			 * code or a crown code we can skip it as it will be
			 * stripped out later and therefore not be displayed.
			 */
			if (text.charAt(c) == '@' 
					&& c + 4 < text.length()
					&& text.charAt(c + 4) == '@') {
				c += 4;
			} else {
				/*
				 * Add the displayed width of the current character's
				 * glyph to the total width of the text.
				 */
				width += glyphDisplayWidth[text.charAt(c)];
			}
		}
		
		return width;
	}