src/main/java/com/mxgraph/util/mxUtils.java
public static HTMLDocument createHtmlDocumentObject(
			Map<String, Object> style, double scale)
	{
		// Applies the font settings
		HTMLDocument document = new HTMLDocument();

		StringBuffer rule = new StringBuffer("body {");
		rule.append("font-family:"
				+ getString(style, mxConstants.STYLE_FONTFAMILY,
						mxConstants.DEFAULT_FONTFAMILIES) + ";");
		rule.append("font-size:"
				+ (int) (getInt(style, mxConstants.STYLE_FONTSIZE,
						mxConstants.DEFAULT_FONTSIZE) * scale) + "pt;");

		String color = mxUtils.getString(style, mxConstants.STYLE_FONTCOLOR);

		if (color != null)
		{
			rule.append("color:" + color + ";");
		}

		int fontStyle = mxUtils.getInt(style, mxConstants.STYLE_FONTSTYLE);

		if ((fontStyle & mxConstants.FONT_BOLD) == mxConstants.FONT_BOLD)
		{
			rule.append("font-weight:bold;");
		}

		if ((fontStyle & mxConstants.FONT_ITALIC) == mxConstants.FONT_ITALIC)
		{
			rule.append("font-style:italic;");
		}

		String txtDecor = "";
		
		if ((fontStyle & mxConstants.FONT_UNDERLINE) == mxConstants.FONT_UNDERLINE)
	    {
			txtDecor = "underline";
	    }
	    
	    if ((fontStyle & mxConstants.FONT_STRIKETHROUGH) == mxConstants.FONT_STRIKETHROUGH) 
	    {
	    	txtDecor += " line-through";
	    }

	    if (txtDecor.length() > 0)
	    {
	    	rule.append("text-decoration: " + txtDecor + ";");
	    }
	    
		String align = getString(style, mxConstants.STYLE_ALIGN,
				mxConstants.ALIGN_LEFT);

		if (align.equals(mxConstants.ALIGN_CENTER))
		{
			rule.append("text-align:center;");
		}
		else if (align.equals(mxConstants.ALIGN_RIGHT))
		{
			rule.append("text-align:right;");
		}

		rule.append("}");
		document.getStyleSheet().addRule(rule.toString());

		return document;
	}
/**
	 * Returns a new, empty DOM document.
	 * 
	 * @return Returns a new DOM document.
	 */
Returns a new, empty DOM document.

@return Returns a new DOM document.
Returns a new empty DOM document . @return Returns a new DOM document .
public static HTMLDocument createHtmlDocumentObject(
			Map<String, Object> style, double scale)
	{
		HTMLDocument document = new HTMLDocument();
		StringBuffer rule = new StringBuffer("body {");
		rule.append("font-family:"
				+ getString(style, mxConstants.STYLE_FONTFAMILY,
						mxConstants.DEFAULT_FONTFAMILIES) + ";");
		rule.append("font-size:"
				+ (int) (getInt(style, mxConstants.STYLE_FONTSIZE,
						mxConstants.DEFAULT_FONTSIZE) * scale) + "pt;");
		String color = mxUtils.getString(style, mxConstants.STYLE_FONTCOLOR);
		if (color != null)
		{
			rule.append("color:" + color + ";");
		}
		int fontStyle = mxUtils.getInt(style, mxConstants.STYLE_FONTSTYLE);
		if ((fontStyle & mxConstants.FONT_BOLD) == mxConstants.FONT_BOLD)
		{
			rule.append("font-weight:bold;");
		}
		if ((fontStyle & mxConstants.FONT_ITALIC) == mxConstants.FONT_ITALIC)
		{
			rule.append("font-style:italic;");
		}
		String txtDecor = "";
		if ((fontStyle & mxConstants.FONT_UNDERLINE) == mxConstants.FONT_UNDERLINE)
	    {
			txtDecor = "underline";
	    }
	    if ((fontStyle & mxConstants.FONT_STRIKETHROUGH) == mxConstants.FONT_STRIKETHROUGH) 
	    {
	    	txtDecor += " line-through";
	    }
	    if (txtDecor.length() > 0)
	    {
	    	rule.append("text-decoration: " + txtDecor + ";");
	    }
		String align = getString(style, mxConstants.STYLE_ALIGN,
				mxConstants.ALIGN_LEFT);
		if (align.equals(mxConstants.ALIGN_CENTER))
		{
			rule.append("text-align:center;");
		}
		else if (align.equals(mxConstants.ALIGN_RIGHT))
		{
			rule.append("text-align:right;");
		}
		rule.append("}");
		document.getStyleSheet().addRule(rule.toString());
		return document;
	}
public static HTMLDocument createHtmlDocumentObject ( Map < String , Object > style , double scale ) { HTMLDocument document = new HTMLDocument ( ) ; StringBuffer rule = new StringBuffer ( "body {" ) ; rule . append ( "font-family:" + getString ( style , mxConstants . STYLE_FONTFAMILY , mxConstants . DEFAULT_FONTFAMILIES ) + ";" ) ; rule . append ( "font-size:" + ( int ) ( getInt ( style , mxConstants . STYLE_FONTSIZE , mxConstants . DEFAULT_FONTSIZE ) * scale ) + "pt;" ) ; String color = mxUtils . getString ( style , mxConstants . STYLE_FONTCOLOR ) ; if ( color != null ) { rule . append ( "color:" + color + ";" ) ; } int fontStyle = mxUtils . getInt ( style , mxConstants . STYLE_FONTSTYLE ) ; if ( ( fontStyle & mxConstants . FONT_BOLD ) == mxConstants . FONT_BOLD ) { rule . append ( "font-weight:bold;" ) ; } if ( ( fontStyle & mxConstants . FONT_ITALIC ) == mxConstants . FONT_ITALIC ) { rule . append ( "font-style:italic;" ) ; } String txtDecor = "" ; if ( ( fontStyle & mxConstants . FONT_UNDERLINE ) == mxConstants . FONT_UNDERLINE ) { txtDecor = "underline" ; } if ( ( fontStyle & mxConstants . FONT_STRIKETHROUGH ) == mxConstants . FONT_STRIKETHROUGH ) { txtDecor += " line-through" ; } if ( txtDecor . length ( ) > 0 ) { rule . append ( "text-decoration: " + txtDecor + ";" ) ; } String align = getString ( style , mxConstants . STYLE_ALIGN , mxConstants . ALIGN_LEFT ) ; if ( align . equals ( mxConstants . ALIGN_CENTER ) ) { rule . append ( "text-align:center;" ) ; } else if ( align . equals ( mxConstants . ALIGN_RIGHT ) ) { rule . append ( "text-align:right;" ) ; } rule . append ( "}" ) ; document . getStyleSheet ( ) . addRule ( rule . toString ( ) ) ; return document ; }
Returns a new, empty DOM document.
Returns a new empty DOM document .
// Applies the font settings