Class NkFontGlyph

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class NkFontGlyph extends Struct<NkFontGlyph> implements NativeResource

 struct nk_font_glyph {
     nk_rune codepoint;
     float xadvance;
     float x0;
     float y0;
     float x1;
     float y1;
     float w;
     float h;
     float u0;
     float v0;
     float u1;
     float v1;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int CODEPOINT
      The struct member offsets.
    • XADVANCE

      public static final int XADVANCE
      The struct member offsets.
    • X0

      public static final int X0
      The struct member offsets.
    • Y0

      public static final int Y0
      The struct member offsets.
    • X1

      public static final int X1
      The struct member offsets.
    • Y1

      public static final int Y1
      The struct member offsets.
    • W

      public static final int W
      The struct member offsets.
    • H

      public static final int H
      The struct member offsets.
    • U0

      public static final int U0
      The struct member offsets.
    • V0

      public static final int V0
      The struct member offsets.
    • U1

      public static final int U1
      The struct member offsets.
    • V1

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

    • NkFontGlyph

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

      public int codepoint()
      Returns:
      the value of the codepoint field.
    • xadvance

      public float xadvance()
      Returns:
      the value of the xadvance field.
    • x0

      public float x0()
      Returns:
      the value of the x0 field.
    • y0

      public float y0()
      Returns:
      the value of the y0 field.
    • x1

      public float x1()
      Returns:
      the value of the x1 field.
    • y1

      public float y1()
      Returns:
      the value of the y1 field.
    • w

      public float w()
      Returns:
      the value of the w field.
    • h

      public float h()
      Returns:
      the value of the h field.
    • u0

      public float u0()
      Returns:
      the value of the u0 field.
    • v0

      public float v0()
      Returns:
      the value of the v0 field.
    • u1

      public float u1()
      Returns:
      the value of the u1 field.
    • v1

      public float v1()
      Returns:
      the value of the v1 field.
    • codepoint

      public NkFontGlyph codepoint(int value)
      Sets the specified value to the codepoint field.
    • xadvance

      public NkFontGlyph xadvance(float value)
      Sets the specified value to the xadvance field.
    • x0

      public NkFontGlyph x0(float value)
      Sets the specified value to the x0 field.
    • y0

      public NkFontGlyph y0(float value)
      Sets the specified value to the y0 field.
    • x1

      public NkFontGlyph x1(float value)
      Sets the specified value to the x1 field.
    • y1

      public NkFontGlyph y1(float value)
      Sets the specified value to the y1 field.
    • w

      public NkFontGlyph w(float value)
      Sets the specified value to the w field.
    • h

      public NkFontGlyph h(float value)
      Sets the specified value to the h field.
    • u0

      public NkFontGlyph u0(float value)
      Sets the specified value to the u0 field.
    • v0

      public NkFontGlyph v0(float value)
      Sets the specified value to the v0 field.
    • u1

      public NkFontGlyph u1(float value)
      Sets the specified value to the u1 field.
    • v1

      public NkFontGlyph v1(float value)
      Sets the specified value to the v1 field.
    • set

      public NkFontGlyph set(int codepoint, float xadvance, float x0, float y0, float x1, float y1, float w, float h, float u0, float v0, float u1, float v1)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static int ncodepoint(long struct)
      Unsafe version of codepoint().
    • nxadvance

      public static float nxadvance(long struct)
      Unsafe version of xadvance().
    • nx0

      public static float nx0(long struct)
      Unsafe version of x0().
    • ny0

      public static float ny0(long struct)
      Unsafe version of y0().
    • nx1

      public static float nx1(long struct)
      Unsafe version of x1().
    • ny1

      public static float ny1(long struct)
      Unsafe version of y1().
    • nw

      public static float nw(long struct)
      Unsafe version of w().
    • nh

      public static float nh(long struct)
      Unsafe version of h().
    • nu0

      public static float nu0(long struct)
      Unsafe version of u0().
    • nv0

      public static float nv0(long struct)
      Unsafe version of v0().
    • nu1

      public static float nu1(long struct)
      Unsafe version of u1().
    • nv1

      public static float nv1(long struct)
      Unsafe version of v1().
    • ncodepoint

      public static void ncodepoint(long struct, int value)
      Unsafe version of codepoint.
    • nxadvance

      public static void nxadvance(long struct, float value)
      Unsafe version of xadvance.
    • nx0

      public static void nx0(long struct, float value)
      Unsafe version of x0.
    • ny0

      public static void ny0(long struct, float value)
      Unsafe version of y0.
    • nx1

      public static void nx1(long struct, float value)
      Unsafe version of x1.
    • ny1

      public static void ny1(long struct, float value)
      Unsafe version of y1.
    • nw

      public static void nw(long struct, float value)
      Unsafe version of w.
    • nh

      public static void nh(long struct, float value)
      Unsafe version of h.
    • nu0

      public static void nu0(long struct, float value)
      Unsafe version of u0.
    • nv0

      public static void nv0(long struct, float value)
      Unsafe version of v0.
    • nu1

      public static void nu1(long struct, float value)
      Unsafe version of u1.
    • nv1

      public static void nv1(long struct, float value)
      Unsafe version of v1.