Class NkBakedFont

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class NkBakedFont extends Struct<NkBakedFont> implements NativeResource

 struct nk_baked_font {
     float height;
     float ascent;
     float descent;
     nk_rune glyph_offset;
     nk_rune glyph_count;
     nk_rune const * ranges;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int HEIGHT
      The struct member offsets.
    • ASCENT

      public static final int ASCENT
      The struct member offsets.
    • DESCENT

      public static final int DESCENT
      The struct member offsets.
    • GLYPH_OFFSET

      public static final int GLYPH_OFFSET
      The struct member offsets.
    • GLYPH_COUNT

      public static final int GLYPH_COUNT
      The struct member offsets.
    • RANGES

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

    • NkBakedFont

      public NkBakedFont(ByteBuffer container)
      Creates a NkBakedFont 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<NkBakedFont>
    • height

      public float height()
      Returns:
      the value of the height field.
    • ascent

      public float ascent()
      Returns:
      the value of the ascent field.
    • descent

      public float descent()
      Returns:
      the value of the descent field.
    • glyph_offset

      public int glyph_offset()
      Returns:
      the value of the glyph_offset field.
    • glyph_count

      public int glyph_count()
      Returns:
      the value of the glyph_count field.
    • ranges

      public @Nullable IntBuffer ranges(int capacity)
      Returns:
      a IntBuffer view of the data pointed to by the ranges field.
    • height

      public NkBakedFont height(float value)
      Sets the specified value to the height field.
    • ascent

      public NkBakedFont ascent(float value)
      Sets the specified value to the ascent field.
    • descent

      public NkBakedFont descent(float value)
      Sets the specified value to the descent field.
    • glyph_offset

      public NkBakedFont glyph_offset(int value)
      Sets the specified value to the glyph_offset field.
    • glyph_count

      public NkBakedFont glyph_count(int value)
      Sets the specified value to the glyph_count field.
    • ranges

      public NkBakedFont ranges(@Nullable IntBuffer value)
      Sets the address of the specified IntBuffer to the ranges field.
    • set

      public NkBakedFont set(float height, float ascent, float descent, int glyph_offset, int glyph_count, @Nullable IntBuffer ranges)
      Initializes this struct with the specified values.
    • set

      public NkBakedFont set(NkBakedFont src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static NkBakedFont.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new NkBakedFont.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
    • nheight

      public static float nheight(long struct)
      Unsafe version of height().
    • nascent

      public static float nascent(long struct)
      Unsafe version of ascent().
    • ndescent

      public static float ndescent(long struct)
      Unsafe version of descent().
    • nglyph_offset

      public static int nglyph_offset(long struct)
      Unsafe version of glyph_offset().
    • nglyph_count

      public static int nglyph_count(long struct)
      Unsafe version of glyph_count().
    • nranges

      public static @Nullable IntBuffer nranges(long struct, int capacity)
      Unsafe version of ranges.
    • nheight

      public static void nheight(long struct, float value)
      Unsafe version of height.
    • nascent

      public static void nascent(long struct, float value)
      Unsafe version of ascent.
    • ndescent

      public static void ndescent(long struct, float value)
      Unsafe version of descent.
    • nglyph_offset

      public static void nglyph_offset(long struct, int value)
      Unsafe version of glyph_offset.
    • nglyph_count

      public static void nglyph_count(long struct, int value)
      Unsafe version of glyph_count.
    • nranges

      public static void nranges(long struct, @Nullable IntBuffer value)
      Unsafe version of ranges.