/** get the data in this map as a ByteBuffer */ public ByteBuffer getData() { int size = getLength(); ByteBuffer buf = ByteBuffer.allocate(size); // write the offsets for (int i = 0; i < offsets.length; i++) { if (isLongFormat()) { buf.putInt(offsets[i]); } else { buf.putShort((short) (offsets[i] / 2)); } } // reset the start pointer buf.flip(); return buf; }
/** Initialize this structure from a ByteBuffer */ public void setData(ByteBuffer data) { for (int i = 0; i < glyphs.length; i++) { int location = loca.getOffset(i); int length = loca.getSize(i); if (length == 0) { // undefined glyph continue; } data.position(location); ByteBuffer glyfData = data.slice(); glyfData.limit(length); glyphs[i] = glyfData; } }
/** * Get the length of this table */ public int getLength() { if (isLongFormat()) { return offsets.length * 4; } else { return offsets.length * 2; } } }
break; case LOCA_TABLE: outTable = new LocaTable(ttf); break; case MAXP_TABLE: // maxp table
/** * Get the length of this table */ public int getLength() { if (isLongFormat()) { return offsets.length * 4; } else { return offsets.length * 2; } } }
break; case LOCA_TABLE: outTable = new LocaTable(ttf); break; case MAXP_TABLE: // maxp table
/** Initialize this structure from a ByteBuffer */ public void setData(ByteBuffer data) { for (int i = 0; i < glyphs.length; i++) { int location = loca.getOffset(i); int length = loca.getSize(i); if (length == 0) { // undefined glyph continue; } data.position(location); ByteBuffer glyfData = data.slice(); glyfData.limit(length); glyphs[i] = glyfData; } }
/** get the data in this map as a ByteBuffer */ public ByteBuffer getData() { int size = getLength(); ByteBuffer buf = ByteBuffer.allocate(size); // write the offsets for (int i = 0; i < offsets.length; i++) { if (isLongFormat()) { buf.putInt(offsets[i]); } else { buf.putShort((short) (offsets[i] / 2)); } } // reset the start pointer buf.flip(); return buf; }
/** * Get the length of this table */ public int getLength() { if (isLongFormat()) { return offsets.length * 4; } else { return offsets.length * 2; } } }
break; case LOCA_TABLE: outTable = new LocaTable(ttf); break; case MAXP_TABLE: // maxp table
/** Initialize this structure from a ByteBuffer */ public void setData(ByteBuffer data) { for (int i = 0; i < glyphs.length; i++) { int location = loca.getOffset(i); int length = loca.getSize(i); if (length == 0) { // undefined glyph continue; } data.position(location); ByteBuffer glyfData = data.slice(); glyfData.limit(length); glyphs[i] = glyfData; } }
/** get the data in this map as a ByteBuffer */ public ByteBuffer getData() { int size = getLength(); ByteBuffer buf = ByteBuffer.allocate(size); // write the offsets for (int i = 0; i < offsets.length; i++) { if (isLongFormat()) { buf.putInt(offsets[i]); } else { buf.putShort((short) (offsets[i] / 2)); } } // reset the start pointer buf.flip(); return buf; }
/** Initialize this structure from a ByteBuffer */ public void setData(ByteBuffer data) { for (int i = 0; i < offsets.length; i++) { if (isLongFormat()) { offsets[i] = data.getInt(); } else { offsets[i] = 2 * ( 0xFFFF & (int) data.getShort()); } } }
/** Initialize this structure from a ByteBuffer */ public void setData(ByteBuffer data) { for (int i = 0; i < offsets.length; i++) { if (isLongFormat()) { offsets[i] = data.getInt(); } else { offsets[i] = 2 * ( 0xFFFF & (int) data.getShort()); } } }
/** Initialize this structure from a ByteBuffer */ public void setData(ByteBuffer data) { for (int i = 0; i < offsets.length; i++) { if (isLongFormat()) { offsets[i] = data.getInt(); } else { offsets[i] = 2 * ( 0xFFFF & (int) data.getShort()); } } }