static Font createFont(TextAttributes attributes, int size) {
		String fontName = attributes.getFontName();
		if (fontName == null) {
			fontName = DEFAULT_FONT_NAME;
		}

		FontStyle fontStyle = attributes.getFontStyle();
		if (fontStyle == null) {
			fontStyle = DEFAULT_FONT_STYLE;
		}
		int style = Font.PLAIN;
		if (fontStyle == FontStyle.BOLD) {
			style = Font.BOLD;
		} else if (fontStyle == FontStyle.ITALIC) {
			style = Font.ITALIC;
		} else if (fontStyle == FontStyle.BOLD_ITALIC) {
			style = Font.BOLD + Font.ITALIC;
		}

		if (size == 0) {
			size = DEFAULT_FONT_SIZE;
		}

		return new Font(fontName, style, size);
	}