setFormat(data.getShort()); int count = data.getShort(); int stringOffset = data.getShort(); String charsetName = getCharsetName(platformID, platformSpecificID); Charset charset = Charset.forName(charsetName); addRecord(platformID, platformSpecificID, languageID, nameID, value);
ByteBuffer buf = ByteBuffer.allocate(getLength()); short headerLength = (short) (6 + (12 * getCount())); buf.putShort(getFormat()); buf.putShort(getCount()); buf.putShort(headerLength); String charsetName = getCharsetName(rec.platformID, rec.platformSpecificID); Charset charset = Charset.forName(charsetName);
public Collection<String> getNames() { NameTable table = (NameTable) getTable("name"); if (table != null) { return table.getNames(); } else { return Collections.emptyList(); } }
/** Get a pretty string */ public String toString() { StringBuffer buf = new StringBuffer(); String indent = " "; buf.append(indent + "Format: " + getFormat() + "\n"); buf.append(indent + "Count : " + getCount() + "\n"); for (Iterator i = records.keySet().iterator(); i.hasNext();) { NameRecord rec = (NameRecord) i.next(); buf.append(indent + " platformID: " + rec.platformID); buf.append(" platformSpecificID: " + rec.platformSpecificID); buf.append(" languageID: " + rec.languageID); buf.append(" nameID: " + rec.nameID + "\n"); buf.append(indent + " " + records.get(rec) + "\n"); } return buf.toString(); }
/** * Get the length of this table */ public int getLength() { // start with the size of the fixed header plus the size of the // records int length = 6 + (12 * getCount()); // add the size of each record for (Iterator i = records.keySet().iterator(); i.hasNext();) { NameRecord rec = (NameRecord) i.next(); String value = (String) records.get(rec); // choose the charset String charsetName = getCharsetName(rec.platformID, rec.platformSpecificID); Charset charset = Charset.forName(charsetName); // encode ByteBuffer buf = charset.encode(value); // add the size of the coded buffer length += buf.remaining(); } return length; }
break; case NAME_TABLE: // name table outTable = new NameTable(); break; case POST_TABLE: // post table
langID = 1033; name.addRecord(platID, encID, langID, NameTable.NAMEID_COPYRIGHT, "Copyright (c) 2000 Bigelow & Holmes Inc. Pat. Des 289,421."); name.addRecord(platID, encID, langID, NameTable.NAMEID_FAMILY, "Lucida Bright"); name.addRecord(platID, encID, langID, NameTable.NAMEID_SUBFAMILY, "Regular"); name.addRecord(platID, encID, langID, NameTable.NAMEID_SUBFAMILY_UNIQUE, "Lucida Bright Regular: B&H:2000"); name.addRecord(platID, encID, langID, NameTable.NAMEID_FULL_NAME, "Lucida Bright Regular"); name.addRecord(platID, encID, langID, NameTable.NAMEID_VERSION, "January 28, 2000; 1.10 (JAVA)"); name.addRecord(platID, encID, langID, NameTable.NAMEID_POSTSCRIPT_NAME, "LucidaBright"); name.addRecord(platID, encID, langID, NameTable.NAMEID_TRADEMARK, "Lucida is a registered trademark of Bigelow & Holmes Inc.");
/** Get a pretty string */ public String toString() { StringBuffer buf = new StringBuffer(); String indent = " "; buf.append(indent + "Format: " + getFormat() + "\n"); buf.append(indent + "Count : " + getCount() + "\n"); for (Iterator i = records.keySet().iterator(); i.hasNext();) { NameRecord rec = (NameRecord) i.next(); buf.append(indent + " platformID: " + rec.platformID); buf.append(" platformSpecificID: " + rec.platformSpecificID); buf.append(" languageID: " + rec.languageID); buf.append(" nameID: " + rec.nameID + "\n"); buf.append(indent + " " + records.get(rec) + "\n"); } return buf.toString(); }
/** * Get the length of this table */ public int getLength() { // start with the size of the fixed header plus the size of the // records int length = 6 + (12 * getCount()); // add the size of each record for (Iterator i = records.keySet().iterator(); i.hasNext();) { NameRecord rec = (NameRecord) i.next(); String value = (String) records.get(rec); // choose the charset String charsetName = getCharsetName(rec.platformID, rec.platformSpecificID); Charset charset = Charset.forName(charsetName); // encode ByteBuffer buf = charset.encode(value); // add the size of the coded buffer length += buf.remaining(); } return length; }
break; case NAME_TABLE: // name table outTable = new NameTable(); break; case POST_TABLE: // post table
ByteBuffer buf = ByteBuffer.allocate(getLength()); short headerLength = (short) (6 + (12 * getCount())); buf.putShort(getFormat()); buf.putShort(getCount()); buf.putShort(headerLength); String charsetName = getCharsetName(rec.platformID, rec.platformSpecificID); Charset charset = Charset.forName(charsetName);
setFormat(data.getShort()); int count = data.getShort(); int stringOffset = data.getShort(); String charsetName = getCharsetName(platformID, platformSpecificID); Charset charset = Charset.forName(charsetName); addRecord(platformID, platformSpecificID, languageID, nameID, value);
/** Get a pretty string */ public String toString() { StringBuffer buf = new StringBuffer(); String indent = " "; buf.append(indent + "Format: " + getFormat() + "\n"); buf.append(indent + "Count : " + getCount() + "\n"); for (Iterator i = records.keySet().iterator(); i.hasNext();) { NameRecord rec = (NameRecord) i.next(); buf.append(indent + " platformID: " + rec.platformID); buf.append(" platformSpecificID: " + rec.platformSpecificID); buf.append(" languageID: " + rec.languageID); buf.append(" nameID: " + rec.nameID + "\n"); buf.append(indent + " " + records.get(rec) + "\n"); } return buf.toString(); }
/** * Get the length of this table */ public int getLength() { // start with the size of the fixed header plus the size of the // records int length = 6 + (12 * getCount()); // add the size of each record for (Iterator i = records.keySet().iterator(); i.hasNext();) { NameRecord rec = (NameRecord) i.next(); String value = (String) records.get(rec); // choose the charset String charsetName = getCharsetName(rec.platformID, rec.platformSpecificID); Charset charset = Charset.forName(charsetName); // encode ByteBuffer buf = charset.encode(value); // add the size of the coded buffer length += buf.remaining(); } return length; }
break; case NAME_TABLE: // name table outTable = new NameTable(); break; case POST_TABLE: // post table
ByteBuffer buf = ByteBuffer.allocate(getLength()); short headerLength = (short) (6 + (12 * getCount())); buf.putShort(getFormat()); buf.putShort(getCount()); buf.putShort(headerLength); String charsetName = getCharsetName(rec.platformID, rec.platformSpecificID); Charset charset = Charset.forName(charsetName);
setFormat(data.getShort()); int count = data.getShort(); int stringOffset = data.getShort(); String charsetName = getCharsetName(platformID, platformSpecificID); Charset charset = Charset.forName(charsetName); addRecord(platformID, platformSpecificID, languageID, nameID, value);