/** * Get the data in this glyf as a byte buffer. Not implemented. */ @Override public ByteBuffer getData() { ByteBuffer buf = super.getData(); // don't flip the buffer, since it may be used by subclasses return buf; }
/** * Get the glyph at a given index, parsing it as needed */ public Glyf getGlyph(int index) { Object o = glyphs[index]; if (o == null) { return null; } if (o instanceof ByteBuffer) { Glyf g = Glyf.getGlyf((ByteBuffer) o); glyphs[index] = g; return g; } else { return (Glyf) o; } }
/** * Get the data in this glyf as a byte buffer. Return the basic * glyf data only, since there is no specific data. This method returns * the data un-flipped, so subclasses can simply append to the allocated * buffer. */ public ByteBuffer getData() { ByteBuffer buf = ByteBuffer.allocate(getLength()); buf.putShort(getNumContours()); buf.putShort(getMinX()); buf.putShort(getMinY()); buf.putShort(getMaxX()); buf.putShort(getMaxY()); // don't flip the buffer, since it may be used by subclasses return buf; }
/** * Get the length of this glyf. Not implemented. */ @Override public short getLength() { // start with the length of the superclass short length = super.getLength(); return length; }
/** * Get the length of this glyf. Not implemented. */ @Override public short getLength() { // start with the length of the superclass short length = super.getLength(); return length; }
/** * Get the data in this glyf as a byte buffer. Return the basic * glyf data only, since there is no specific data. This method returns * the data un-flipped, so subclasses can simply append to the allocated * buffer. */ public ByteBuffer getData() { ByteBuffer buf = ByteBuffer.allocate(getLength()); buf.putShort(getNumContours()); buf.putShort(getMinX()); buf.putShort(getMinY()); buf.putShort(getMaxX()); buf.putShort(getMaxY()); // don't flip the buffer, since it may be used by subclasses return buf; }
/** * Get the data in this glyf as a byte buffer. Not implemented. */ @Override public ByteBuffer getData() { ByteBuffer buf = super.getData(); // don't flip the buffer, since it may be used by subclasses return buf; }
/** * Get the length of this glyf. Not implemented. */ @Override public short getLength() { // start with the length of the superclass short length = super.getLength(); return length; }
/** * Get the glyph at a given index, parsing it as needed */ public Glyf getGlyph(int index) { Object o = glyphs[index]; if (o == null) { return null; } if (o instanceof ByteBuffer) { Glyf g = Glyf.getGlyf((ByteBuffer) o); glyphs[index] = g; return g; } else { return (Glyf) o; } }
/** * Get the data in this glyf as a byte buffer. Return the basic * glyf data only, since there is no specific data. This method returns * the data un-flipped, so subclasses can simply append to the allocated * buffer. */ public ByteBuffer getData() { ByteBuffer buf = ByteBuffer.allocate(getLength()); buf.putShort(getNumContours()); buf.putShort(getMinX()); buf.putShort(getMinY()); buf.putShort(getMaxX()); buf.putShort(getMaxY()); // don't flip the buffer, since it may be used by subclasses return buf; }
/** * Get the data in this glyf as a byte buffer. Not implemented. */ @Override public ByteBuffer getData() { ByteBuffer buf = super.getData(); // don't flip the buffer, since it may be used by subclasses return buf; }
/** * Get the length of this table */ public int getLength() { int length = 0; for (int i = 0; i < glyphs.length; i++) { Object o = glyphs[i]; if (o == null) { continue; } if (o instanceof ByteBuffer) { length += ((ByteBuffer) o).remaining(); } else { length += ((Glyf) o).getLength(); } } return length; }
/** * Get the glyph at a given index, parsing it as needed */ public Glyf getGlyph(int index) { Object o = glyphs[index]; if (o == null) { return null; } if (o instanceof ByteBuffer) { Glyf g = Glyf.getGlyf((ByteBuffer) o); glyphs[index] = g; return g; } else { return (Glyf) o; } }
/** 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 < glyphs.length; i++) { Object o = glyphs[i]; if (o == null) { continue; } ByteBuffer glyfData = null; if (o instanceof ByteBuffer) { glyfData = (ByteBuffer) o; } else { glyfData = ((Glyf) o).getData(); } glyfData.rewind(); buf.put(glyfData); glyfData.flip(); } // reset the start pointer buf.flip(); return buf; }
/** * Get the length of this table */ public int getLength() { int length = 0; for (int i = 0; i < glyphs.length; i++) { Object o = glyphs[i]; if (o == null) { continue; } if (o instanceof ByteBuffer) { length += ((ByteBuffer) o).remaining(); } else { length += ((Glyf) o).getLength(); } } return length; }
/** 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 < glyphs.length; i++) { Object o = glyphs[i]; if (o == null) { continue; } ByteBuffer glyfData = null; if (o instanceof ByteBuffer) { glyfData = (ByteBuffer) o; } else { glyfData = ((Glyf) o).getData(); } glyfData.rewind(); buf.put(glyfData); glyfData.flip(); } // reset the start pointer buf.flip(); return buf; }
/** * Get the length of this table */ public int getLength() { int length = 0; for (int i = 0; i < glyphs.length; i++) { Object o = glyphs[i]; if (o == null) { continue; } if (o instanceof ByteBuffer) { length += ((ByteBuffer) o).remaining(); } else { length += ((Glyf) o).getLength(); } } return length; }