public static String guessFamily(String name) {
        String fam = name;
        int inx;
        // Family name usually precedes a common, ie. "Arial,BoldItalic"
        if ((inx = fam.indexOf(',')) > 0)
            fam = fam.substring(0, inx);
        // Family name usually precedes a dash, example "Times-Bold",
        if ((inx = fam.lastIndexOf('-')) > 0)
            fam = fam.substring(0, inx);
        // Family name with no dash or commas, example "TimesNewRomansBold" or
        // "CalibriBoldItalic"
        if ((inx = fam.toLowerCase().lastIndexOf(STYLE_BOLD_ITALIC)) > 0){
        	fam = fam.substring(0, inx);
        }else if ((inx = fam.toLowerCase().lastIndexOf(STYLE_DEMI_ITALIC)) > 0){
        	fam = fam.substring(0, inx);
        }else if ((inx = fam.toLowerCase().lastIndexOf(STYLE_BOLD)) > 0){
        	fam = fam.substring(0, inx);
        }else if ((inx = fam.toLowerCase().lastIndexOf(STYLE_ITALIC)) > 0){
        	fam = fam.substring(0, inx);
        }else if ((inx = fam.toLowerCase().lastIndexOf(STYLE_BLACK)) > 0){
        	fam = fam.substring(0, inx);
        }
        return fam;
    }