public static int guessAWTFontStyle(String name) {
        name = name.toLowerCase();
        int decorations = 0;
        if (name.indexOf(AWT_STYLE_BOLD_ITAL) > 0 ||
                name.indexOf(AWT_STYLE_DEMI_ITAL) > 0) {
            decorations |= java.awt.Font.BOLD | java.awt.Font.ITALIC;
        } else if (name.indexOf(STYLE_BOLD) > 0 ||
                name.indexOf(STYLE_BLACK) > 0 ||
                name.indexOf(STYLE_DEMI) > 0) {
            decorations |= java.awt.Font.BOLD;
        } else if (name.indexOf(AWT_STYLE_ITAL) > 0 ||
                name.indexOf(AWT_STYLE_OBLI) > 0) {
            decorations |= java.awt.Font.ITALIC;
        } else {
            decorations |= java.awt.Font.PLAIN;
        }
        return decorations;
    }