public static void doneFace(Face face) { doneFace(face.address); ByteBuffer buffer = face.library.fontData.get(face.address); if (buffer != null) { face.library.fontData.remove(face.address); BufferUtils.disposeUnsafeByteBuffer(buffer); } }
public static Face newMemoryFace(Library library, byte[] data, int dataSize, int faceIndex) { ByteBuffer buffer = BufferUtils.newUnsafeByteBuffer(data.length); BufferUtils.copy(data, 0, buffer, data.length); long address = newMemoryFace(library.address, buffer, dataSize, faceIndex); if (address == 0) { BufferUtils.disposeUnsafeByteBuffer(buffer); throw new GdxRuntimeException("Couldn't load font"); } else { library.fontData.put(address, buffer); return new Face(address, library); } }
public static void doneFreeType(Library library) { doneFreeType(library.address); for (ByteBuffer buffer : library.fontData.values()) { BufferUtils.disposeUnsafeByteBuffer(buffer); } }
/** Releases the native resources of the ETC1Data instance. */ public void dispose() { BufferUtils.disposeUnsafeByteBuffer(compressedData); }