public Font difference(Font font) {
        String dFamilyname = font.getFamilyname();
        if(dFamilyname == null || dFamilyname.trim().equals("") || dFamilyname.trim().equalsIgnoreCase("unknown")) {
            dFamilyname = this.fontName;
        }

        float dSize = font.getSize();
        if(dSize == Font.UNDEFINED) {
            dSize = this.getSize();
        }

        int dStyle = Font.UNDEFINED;
        if(this.getStyle() != Font.UNDEFINED && font.getStyle() != Font.UNDEFINED) {
            dStyle = this.getStyle() | font.getStyle();
        } else if(this.getStyle() != Font.UNDEFINED) {
            dStyle = this.getStyle();
        } else if(font.getStyle() != Font.UNDEFINED) {
            dStyle = font.getStyle();
        }

        Color dColor = font.getColor();
        if(dColor == null) {
            dColor = this.getColor();
        }
        
        int dCharset = this.charset;
        if(font instanceof RtfFont) {
            dCharset = ((RtfFont) font).getCharset();
        }
        
        return new RtfFont(dFamilyname, dSize, dStyle, dColor, dCharset);
    }
public Font difference ( Font font ) { String dFamilyname = font . getFamilyname ( ) ; if ( dFamilyname == null || dFamilyname . trim ( ) . equals ( "" ) || dFamilyname . trim ( ) . equalsIgnoreCase ( "unknown" ) ) { dFamilyname = this . fontName ; } float dSize = font . getSize ( ) ; if ( dSize == Font . UNDEFINED ) { dSize = this . getSize ( ) ; } int dStyle = Font . UNDEFINED ; if ( this . getStyle ( ) != Font . UNDEFINED && font . getStyle ( ) != Font . UNDEFINED ) { dStyle = this . getStyle ( ) | font . getStyle ( ) ; } else if ( this . getStyle ( ) != Font . UNDEFINED ) { dStyle = this . getStyle ( ) ; } else if ( font . getStyle ( ) != Font . UNDEFINED ) { dStyle = font . getStyle ( ) ; } Color dColor = font . getColor ( ) ; if ( dColor == null ) { dColor = this . getColor ( ) ; } int dCharset = this . charset ; if ( font instanceof RtfFont ) { dCharset = ( ( RtfFont ) font ) . getCharset ( ) ; } return new RtfFont ( dFamilyname , dSize , dStyle , dColor , dCharset ) ; }
Replaces the attributes that are equal to <VAR>null</VAR> with
the attributes of a given font.

@param font The surrounding font
@return A RtfFont