private boolean fixNameTable (TrueTypeFont ttf, NameTable name) {
        // if we didn't find the table, or there was an exception,
        // just create a new one
        if (name == null) {
            name = (NameTable) TrueTypeTable.createTable (ttf, "name");
            ttf.addTable ("name", name);
        }

        // first, figure out some info about the font
        String fName = this.getBaseFont ();
        String style = "Regular";

        if (fName.indexOf ("Italic") > -1 || fName.indexOf ("italic") > -1) {
            style = "Italic";
        } else if (fName.indexOf ("Bold") > -1 || fName.indexOf ("bold") > -1) {
            style = "Bold";
        }

        if (fName.indexOf ('-') > -1) {
            fName = fName.substring (0, fName.indexOf ('-'));
        }

        short platID = NameTable.PLATFORMID_MICROSOFT;
        short encID = 1;
        short langID = 1033;

        short[] nameIDs = {
            NameTable.NAMEID_COPYRIGHT,
            NameTable.NAMEID_FAMILY,
            NameTable.NAMEID_SUBFAMILY,
            NameTable.NAMEID_SUBFAMILY_UNIQUE,
            NameTable.NAMEID_FULL_NAME,
            NameTable.NAMEID_VERSION,
            NameTable.NAMEID_POSTSCRIPT_NAME,
            NameTable.NAMEID_TRADEMARK
        };

        String[] defaultValues = {
            "No copyright",
            fName,
            style,
            fName + " " + style,
            fName + " " + style,
            "1.0 (Fake)",
            fName,
            "No Trademark"
        };

        boolean changed = false;

        for (int i = 0; i < nameIDs.length; i++) {
            if (name.getRecord (platID, encID, langID, nameIDs[i]) == null) {
                name.addRecord (platID, encID, langID, nameIDs[i],
                        defaultValues[i]);
                changed = true;
            }
        }

        return changed;
    }