Class BDF_Property

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class BDF_Property extends Struct<BDF_Property> implements NativeResource

 struct BDF_PropertyRec {
     BDF_PropertyType type;
     union {
         char const * atom;
         FT_Int32 integer;
         FT_UInt32 cardinal;
     } u;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • TYPE

      public static final int TYPE
      The struct member offsets.
    • U

      public static final int U
      The struct member offsets.
    • U_ATOM

      public static final int U_ATOM
      The struct member offsets.
    • U_INTEGER

      public static final int U_INTEGER
      The struct member offsets.
    • U_CARDINAL

      public static final int U_CARDINAL
      The struct member offsets.
  • Constructor Details

    • BDF_Property

      public BDF_Property(ByteBuffer container)
      Creates a BDF_Property instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<BDF_Property>
    • type

      public int type()
      Returns:
      the value of the type field.
    • u_atom

      public @Nullable ByteBuffer u_atom()
      Returns:
      a ByteBuffer view of the null-terminated string pointed to by the u.atom field.
    • u_atomString

      public @Nullable String u_atomString()
      Returns:
      the null-terminated string pointed to by the u.atom field.
    • u_integer

      public int u_integer()
      Returns:
      the value of the u.integer field.
    • u_cardinal

      public int u_cardinal()
      Returns:
      the value of the u.cardinal field.
    • malloc

      public static BDF_Property malloc()
      Returns a new BDF_Property instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static BDF_Property calloc()
      Returns a new BDF_Property instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static BDF_Property create()
      Returns a new BDF_Property instance allocated with BufferUtils.
    • create

      public static BDF_Property create(long address)
      Returns a new BDF_Property instance for the specified memory address.
    • createSafe

      public static @Nullable BDF_Property createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static BDF_Property.Buffer malloc(int capacity)
      Returns a new BDF_Property.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static BDF_Property.Buffer calloc(int capacity)
      Returns a new BDF_Property.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static BDF_Property.Buffer create(int capacity)
      Returns a new BDF_Property.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static BDF_Property.Buffer create(long address, int capacity)
      Create a BDF_Property.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable BDF_Property.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static BDF_Property malloc(MemoryStack stack)
      Returns a new BDF_Property instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static BDF_Property calloc(MemoryStack stack)
      Returns a new BDF_Property instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static BDF_Property.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new BDF_Property.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static BDF_Property.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new BDF_Property.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • ntype

      public static int ntype(long struct)
      Unsafe version of type().
    • nu_atom

      public static @Nullable ByteBuffer nu_atom(long struct)
      Unsafe version of u_atom().
    • nu_atomString

      public static @Nullable String nu_atomString(long struct)
      Unsafe version of u_atomString().
    • nu_integer

      public static int nu_integer(long struct)
      Unsafe version of u_integer().
    • nu_cardinal

      public static int nu_cardinal(long struct)
      Unsafe version of u_cardinal().