public static boolean isMonospaced(FontMetrics fm) {
		Font font = fm.getFont();
		String mono = "Monospaced";
		String family = "family";
		Map<TextAttribute, ?> attributes = font.getAttributes();
		if (attributes.containsValue(mono)) {
			return true;
		}
		Set<TextAttribute> keySet = attributes.keySet();
		for (TextAttribute key : keySet) {
			Object value = attributes.get(key);
			if (value != null && family.equalsIgnoreCase(key.toString())
					&& mono.equalsIgnoreCase(value.toString())) {
				return true;
			}
		}

		int en1 = fm.charWidth('l');
		int en2 = fm.charWidth('m');
		if (en1 == en2) {
			return true;
		}
		return false;
	}