Beispiel #1
0
 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);
   }
 }
Beispiel #2
0
 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);
   }
 }
Beispiel #3
0
 public static void doneFreeType(Library library) {
   doneFreeType(library.address);
   for (ByteBuffer buffer : library.fontData.values()) {
     BufferUtils.disposeUnsafeByteBuffer(buffer);
   }
 }
Beispiel #4
0
 /** Releases the native resources of the ETC1Data instance. */
 public void dispose() {
   BufferUtils.disposeUnsafeByteBuffer(compressedData);
 }