Class NkFontConfig

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class NkFontConfig extends Struct<NkFontConfig> implements NativeResource

 struct nk_font_config {
     {@link NkFontConfig struct nk_font_config} * next;
     void * ttf_blob;
     nk_size ttf_size;
     unsigned char ttf_data_owned_by_atlas;
     unsigned char merge_mode;
     unsigned char pixel_snap;
     unsigned char oversample_v;
     unsigned char oversample_h;
     unsigned char padding[3];
     float size;
     enum nk_font_coord_type coord_type;
     {@link NkVec2 struct nk_vec2} spacing;
     nk_rune const * range;
     {@link NkBakedFont struct nk_baked_font} * font;
     nk_rune fallback_glyph;
     {@link NkFontConfig struct nk_font_config} * n;
     {@link NkFontConfig struct nk_font_config} * p;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int NEXT
      The struct member offsets.
    • TTF_BLOB

      public static final int TTF_BLOB
      The struct member offsets.
    • TTF_SIZE

      public static final int TTF_SIZE
      The struct member offsets.
    • TTF_DATA_OWNED_BY_ATLAS

      public static final int TTF_DATA_OWNED_BY_ATLAS
      The struct member offsets.
    • MERGE_MODE

      public static final int MERGE_MODE
      The struct member offsets.
    • PIXEL_SNAP

      public static final int PIXEL_SNAP
      The struct member offsets.
    • OVERSAMPLE_V

      public static final int OVERSAMPLE_V
      The struct member offsets.
    • OVERSAMPLE_H

      public static final int OVERSAMPLE_H
      The struct member offsets.
    • PADDING

      public static final int PADDING
      The struct member offsets.
    • SIZE

      public static final int SIZE
      The struct member offsets.
    • COORD_TYPE

      public static final int COORD_TYPE
      The struct member offsets.
    • SPACING

      public static final int SPACING
      The struct member offsets.
    • RANGE

      public static final int RANGE
      The struct member offsets.
    • FONT

      public static final int FONT
      The struct member offsets.
    • FALLBACK_GLYPH

      public static final int FALLBACK_GLYPH
      The struct member offsets.
    • N

      public static final int N
      The struct member offsets.
    • P

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

    • NkFontConfig

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

      public @Nullable NkFontConfig next()
      Returns:
      a NkFontConfig view of the struct pointed to by the next field.
    • ttf_blob

      public @Nullable ByteBuffer ttf_blob()
      Returns:
      a ByteBuffer view of the data pointed to by the ttf_blob field.
    • ttf_size

      public long ttf_size()
      Returns:
      the value of the ttf_size field.
    • ttf_data_owned_by_atlas

      public boolean ttf_data_owned_by_atlas()
      Returns:
      the value of the ttf_data_owned_by_atlas field.
    • merge_mode

      public boolean merge_mode()
      Returns:
      the value of the merge_mode field.
    • pixel_snap

      public boolean pixel_snap()
      Returns:
      the value of the pixel_snap field.
    • oversample_v

      public boolean oversample_v()
      Returns:
      the value of the oversample_v field.
    • oversample_h

      public boolean oversample_h()
      Returns:
      the value of the oversample_h field.
    • padding

      public ByteBuffer padding()
      Returns:
      a ByteBuffer view of the padding field.
    • padding

      public byte padding(int index)
      Returns:
      the value at the specified index of the padding field.
    • size

      public float size()
      Returns:
      the value of the size field.
    • coord_type

      public int coord_type()
      Returns:
      the value of the coord_type field.
    • spacing

      public NkVec2 spacing()
      Returns:
      a NkVec2 view of the spacing field.
    • range

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

      public @Nullable NkBakedFont font()
      Returns:
      a NkBakedFont view of the struct pointed to by the font field.
    • fallback_glyph

      public int fallback_glyph()
      Returns:
      the value of the fallback_glyph field.
    • n

      public @Nullable NkFontConfig n()
      Returns:
      a NkFontConfig view of the struct pointed to by the n field.
    • p

      public @Nullable NkFontConfig p()
      Returns:
      a NkFontConfig view of the struct pointed to by the p field.
    • next

      public NkFontConfig next(@Nullable NkFontConfig value)
      Sets the address of the specified NkFontConfig to the next field.
    • ttf_blob

      public NkFontConfig ttf_blob(@Nullable ByteBuffer value)
      Sets the address of the specified ByteBuffer to the ttf_blob field.
    • ttf_size

      public NkFontConfig ttf_size(long value)
      Sets the specified value to the ttf_size field.
    • ttf_data_owned_by_atlas

      public NkFontConfig ttf_data_owned_by_atlas(boolean value)
      Sets the specified value to the ttf_data_owned_by_atlas field.
    • merge_mode

      public NkFontConfig merge_mode(boolean value)
      Sets the specified value to the merge_mode field.
    • pixel_snap

      public NkFontConfig pixel_snap(boolean value)
      Sets the specified value to the pixel_snap field.
    • oversample_v

      public NkFontConfig oversample_v(boolean value)
      Sets the specified value to the oversample_v field.
    • oversample_h

      public NkFontConfig oversample_h(boolean value)
      Sets the specified value to the oversample_h field.
    • padding

      public NkFontConfig padding(ByteBuffer value)
      Copies the specified ByteBuffer to the padding field.
    • padding

      public NkFontConfig padding(int index, byte value)
      Sets the specified value at the specified index of the padding field.
    • size

      public NkFontConfig size(float value)
      Sets the specified value to the size field.
    • coord_type

      public NkFontConfig coord_type(int value)
      Sets the specified value to the coord_type field.
    • spacing

      public NkFontConfig spacing(NkVec2 value)
      Copies the specified NkVec2 to the spacing field.
    • spacing

      public NkFontConfig spacing(Consumer<NkVec2> consumer)
      Passes the spacing field to the specified Consumer.
    • range

      public NkFontConfig range(@Nullable IntBuffer value)
      Sets the address of the specified IntBuffer to the range field.
    • font

      public NkFontConfig font(@Nullable NkBakedFont value)
      Sets the address of the specified NkBakedFont to the font field.
    • fallback_glyph

      public NkFontConfig fallback_glyph(int value)
      Sets the specified value to the fallback_glyph field.
    • n

      public NkFontConfig n(@Nullable NkFontConfig value)
      Sets the address of the specified NkFontConfig to the n field.
    • p

      public NkFontConfig p(@Nullable NkFontConfig value)
      Sets the address of the specified NkFontConfig to the p field.
    • set

      public NkFontConfig set(@Nullable NkFontConfig next, @Nullable ByteBuffer ttf_blob, long ttf_size, boolean ttf_data_owned_by_atlas, boolean merge_mode, boolean pixel_snap, boolean oversample_v, boolean oversample_h, ByteBuffer padding, float size, int coord_type, NkVec2 spacing, @Nullable IntBuffer range, @Nullable NkBakedFont font, int fallback_glyph, @Nullable NkFontConfig n, @Nullable NkFontConfig p)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static @Nullable NkFontConfig nnext(long struct)
      Unsafe version of next().
    • nttf_blob

      public static @Nullable ByteBuffer nttf_blob(long struct)
      Unsafe version of ttf_blob.
    • nttf_size

      public static long nttf_size(long struct)
      Unsafe version of ttf_size().
    • nttf_data_owned_by_atlas

      public static boolean nttf_data_owned_by_atlas(long struct)
      Unsafe version of ttf_data_owned_by_atlas().
    • nmerge_mode

      public static boolean nmerge_mode(long struct)
      Unsafe version of merge_mode().
    • npixel_snap

      public static boolean npixel_snap(long struct)
      Unsafe version of pixel_snap().
    • noversample_v

      public static boolean noversample_v(long struct)
      Unsafe version of oversample_v().
    • noversample_h

      public static boolean noversample_h(long struct)
      Unsafe version of oversample_h().
    • npadding

      public static ByteBuffer npadding(long struct)
      Unsafe version of padding().
    • npadding

      public static byte npadding(long struct, int index)
      Unsafe version of padding.
    • nsize

      public static float nsize(long struct)
      Unsafe version of size().
    • ncoord_type

      public static int ncoord_type(long struct)
      Unsafe version of coord_type().
    • nspacing

      public static NkVec2 nspacing(long struct)
      Unsafe version of spacing().
    • nrange

      public static @Nullable IntBuffer nrange(long struct, int capacity)
      Unsafe version of range.
    • nfont

      public static @Nullable NkBakedFont nfont(long struct)
      Unsafe version of font().
    • nfallback_glyph

      public static int nfallback_glyph(long struct)
      Unsafe version of fallback_glyph().
    • nn

      public static @Nullable NkFontConfig nn(long struct)
      Unsafe version of n().
    • np

      public static @Nullable NkFontConfig np(long struct)
      Unsafe version of p().
    • nnext

      public static void nnext(long struct, @Nullable NkFontConfig value)
      Unsafe version of next.
    • nttf_blob

      public static void nttf_blob(long struct, @Nullable ByteBuffer value)
      Unsafe version of ttf_blob.
    • nttf_size

      public static void nttf_size(long struct, long value)
      Sets the specified value to the ttf_size field of the specified struct.
    • nttf_data_owned_by_atlas

      public static void nttf_data_owned_by_atlas(long struct, boolean value)
      Unsafe version of ttf_data_owned_by_atlas.
    • nmerge_mode

      public static void nmerge_mode(long struct, boolean value)
      Unsafe version of merge_mode.
    • npixel_snap

      public static void npixel_snap(long struct, boolean value)
      Unsafe version of pixel_snap.
    • noversample_v

      public static void noversample_v(long struct, boolean value)
      Unsafe version of oversample_v.
    • noversample_h

      public static void noversample_h(long struct, boolean value)
      Unsafe version of oversample_h.
    • npadding

      public static void npadding(long struct, ByteBuffer value)
      Unsafe version of padding.
    • npadding

      public static void npadding(long struct, int index, byte value)
      Unsafe version of padding.
    • nsize

      public static void nsize(long struct, float value)
      Unsafe version of size.
    • ncoord_type

      public static void ncoord_type(long struct, int value)
      Unsafe version of coord_type.
    • nspacing

      public static void nspacing(long struct, NkVec2 value)
      Unsafe version of spacing.
    • nrange

      public static void nrange(long struct, @Nullable IntBuffer value)
      Unsafe version of range.
    • nfont

      public static void nfont(long struct, @Nullable NkBakedFont value)
      Unsafe version of font.
    • nfallback_glyph

      public static void nfallback_glyph(long struct, int value)
      Unsafe version of fallback_glyph.
    • nn

      public static void nn(long struct, @Nullable NkFontConfig value)
      Unsafe version of n.
    • np

      public static void np(long struct, @Nullable NkFontConfig value)
      Unsafe version of p.