/** * Get a map from the given data * * This method reads the format, data and length variables of * the map. */ public static CMap getMap (ByteBuffer data) { short format = data.getShort (); short lengthShort = data.getShort (); int length = 0xFFFF & (int) lengthShort; // System.out.println ( // "CMAP, length: " + length + ", short: " + lengthShort); // make sure our slice of the data only contains up to the length // of this table data.limit (Math.min (length, data.limit ())); short language = data.getShort (); CMap outMap = createMap (format, language); if (outMap == null) { return null; } outMap.setData (data.limit (), data); return outMap; }
/** Print a pretty string */ @Override public String toString () { String indent = " "; return indent + " format: " + getFormat () + " length: " + getLength () + " language: " + getLanguage () + "\n"; } }
/** * lookup the outline using the CMAPs, as specified in 32000-1:2008, * 9.6.6.4, when an Encoding is specified. * * @param val * @param width * @return GeneralPath */ protected synchronized GeneralPath getOutlineFromCMaps (char val, float width) { // find the cmaps CmapTable cmap = (CmapTable) font.getTable ("cmap"); if (cmap == null) { return null; } // try maps in required order of (3, 1), (1, 0) CMap map = cmap.getCMap ((short) 3, (short) 1); if (map == null) { map = cmap.getCMap ((short) 1, (short) 0); } int idx = map.map (val); if (idx != 0) { return getOutline (idx, width); } return null; }
/** Print a pretty string */ @Override public String toString() { StringBuffer buf = new StringBuffer(); String indent = " "; buf.append(indent + "Version: " + this.getVersion() + "\n"); buf.append(indent + "NumMaps: " + this.getNumberSubtables() + "\n"); for (Iterator i = subtables.keySet().iterator(); i.hasNext();) { CmapSubtable key = (CmapSubtable) i.next(); buf.append(indent + "Map: platformID: " + key.platformID + " PlatformSpecificID: " + key.platformSpecificID + "\n"); CMap map = (CMap) subtables.get(key); buf.append(map.toString()); } return buf.toString(); }
/** * Get the size of the table, in bytes */ @Override public int getLength() { // start with the size of the fixed data int length = 4; // add the size of the subtables length += subtables.size() * 8; // add the size of the dynamic data for (Iterator i = subtables.values().iterator(); i.hasNext();) { // add the size of the subtable data CMap map = (CMap) i.next(); length += map.getLength(); } return length; }
CMap cMap = CMap.getMap(mapData); if (cMap != null) { addCMap(platformID, platformSpecificID, cMap);
CMap map = cmapTable.getCMap (mapIDs[i], mapIDs[i + 1]); if (map != null) { mappedChar = map.reverseMap (glyphID);
/** * lookup the outline using the CMAPs, as specified in 32000-1:2008, * 9.6.6.4, when an Encoding is specified. * * @param val * @param width * @return GeneralPath */ protected synchronized GeneralPath getOutlineFromCMaps (char val, float width) { // find the cmaps CmapTable cmap = (CmapTable) font.getTable ("cmap"); if (cmap == null) { return null; } // try maps in required order of (3, 1), (1, 0) CMap map = cmap.getCMap ((short) 3, (short) 1); if (map == null) { map = cmap.getCMap ((short) 1, (short) 0); } int idx = map.map (val); if (idx != 0) { return getOutline (idx, width); } return null; }
/** Print a pretty string */ @Override public String toString() { StringBuffer buf = new StringBuffer(); String indent = " "; buf.append(indent + "Version: " + this.getVersion() + "\n"); buf.append(indent + "NumMaps: " + this.getNumberSubtables() + "\n"); for (Iterator i = subtables.keySet().iterator(); i.hasNext();) { CmapSubtable key = (CmapSubtable) i.next(); buf.append(indent + "Map: platformID: " + key.platformID + " PlatformSpecificID: " + key.platformSpecificID + "\n"); CMap map = (CMap) subtables.get(key); buf.append(map.toString()); } return buf.toString(); }
/** * Get the size of the table, in bytes */ @Override public int getLength() { // start with the size of the fixed data int length = 4; // add the size of the subtables length += subtables.size() * 8; // add the size of the dynamic data for (Iterator i = subtables.values().iterator(); i.hasNext();) { // add the size of the subtable data CMap map = (CMap) i.next(); length += map.getLength(); } return length; }
CMap cMap = CMap.getMap(mapData); if (cMap != null) { addCMap(platformID, platformSpecificID, cMap);
CMap map = cmapTable.getCMap (mapIDs[i], mapIDs[i + 1]); if (map != null) { mappedChar = map.reverseMap (glyphID);
/** Print a pretty string */ @Override public String toString () { String indent = " "; return indent + " format: " + getFormat () + " length: " + getLength () + " language: " + getLanguage () + "\n"; } }
/** * Get a map from the given data * * This method reads the format, data and length variables of * the map. */ public static CMap getMap (ByteBuffer data) { short format = data.getShort (); short lengthShort = data.getShort (); int length = 0xFFFF & (int) lengthShort; // System.out.println ( // "CMAP, length: " + length + ", short: " + lengthShort); // make sure our slice of the data only contains up to the length // of this table data.limit (Math.min (length, data.limit ())); short language = data.getShort (); CMap outMap = createMap (format, language); if (outMap == null) { return null; } outMap.setData (data.limit (), data); return outMap; }
/** * lookup the outline using the CMAPs, as specified in 32000-1:2008, * 9.6.6.4, when an Encoding is specified. * * @param val * @param width * @return GeneralPath */ protected synchronized GeneralPath getOutlineFromCMaps (char val, float width) { // find the cmaps CmapTable cmap = (CmapTable) font.getTable ("cmap"); if (cmap == null) { return null; } // try maps in required order of (3, 1), (1, 0) CMap map = cmap.getCMap ((short) 3, (short) 1); if (map == null) { map = cmap.getCMap ((short) 1, (short) 0); } int idx = map.map (val); if (idx != 0) { return getOutline (idx, width); } return null; }
/** Print a pretty string */ @Override public String toString() { StringBuffer buf = new StringBuffer(); String indent = " "; buf.append(indent + "Version: " + this.getVersion() + "\n"); buf.append(indent + "NumMaps: " + this.getNumberSubtables() + "\n"); for (Iterator i = subtables.keySet().iterator(); i.hasNext();) { CmapSubtable key = (CmapSubtable) i.next(); buf.append(indent + "Map: platformID: " + key.platformID + " PlatformSpecificID: " + key.platformSpecificID + "\n"); CMap map = (CMap) subtables.get(key); buf.append(map.toString()); } return buf.toString(); }