public class NkUserFont
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
userdata – user provided font handleheight – max height of the fontwidth – font string width in pixel callbackquery – font glyph callback to query drawing infotexture – texture handle to the used font atlas or texture
struct nk_user_font {
nk_handle userdata;
float height;
nk_text_width_f width;
nk_query_font_glyph_f query;
nk_handle texture;
}| Modifier and Type | Class and Description |
|---|---|
static class |
NkUserFont.Buffer
An array of
NkUserFont structs. |
| Modifier and Type | Field and Description |
|---|---|
static int |
ALIGNOF
The struct alignment in bytes.
|
static int |
HEIGHT
The struct member offsets.
|
static int |
QUERY
The struct member offsets.
|
static int |
SIZEOF
The struct size in bytes.
|
static int |
TEXTURE
The struct member offsets.
|
static int |
USERDATA
The struct member offsets.
|
static int |
WIDTH
The struct member offsets.
|
| Constructor and Description |
|---|
NkUserFont(java.nio.ByteBuffer container)
Creates a
NkUserFont instance at the current position of the specified ByteBuffer container. |
| Modifier and Type | Method and Description |
|---|---|
static NkUserFont |
calloc()
Returns a new
NkUserFont instance allocated with memCalloc. |
static NkUserFont.Buffer |
calloc(int capacity)
Returns a new
NkUserFont.Buffer instance allocated with memCalloc. |
static NkUserFont |
callocStack()
Returns a new
NkUserFont instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static NkUserFont.Buffer |
callocStack(int capacity)
Returns a new
NkUserFont.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static NkUserFont.Buffer |
callocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
NkUserFont.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static NkUserFont |
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
NkUserFont instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static NkUserFont |
create()
Returns a new
NkUserFont instance allocated with BufferUtils. |
static NkUserFont.Buffer |
create(int capacity)
Returns a new
NkUserFont.Buffer instance allocated with BufferUtils. |
static NkUserFont |
create(long address)
Returns a new
NkUserFont instance for the specified memory address. |
static NkUserFont.Buffer |
create(long address,
int capacity)
Create a
NkUserFont.Buffer instance at the specified memory. |
static NkUserFont |
createSafe(long address)
|
static NkUserFont.Buffer |
createSafe(long address,
int capacity)
|
float |
height()
Returns the value of the
height field. |
NkUserFont |
height(float value)
Sets the specified value to the
height field. |
static NkUserFont |
malloc()
Returns a new
NkUserFont instance allocated with memAlloc. |
static NkUserFont.Buffer |
malloc(int capacity)
Returns a new
NkUserFont.Buffer instance allocated with memAlloc. |
static NkUserFont |
mallocStack()
Returns a new
NkUserFont instance allocated on the thread-local MemoryStack. |
static NkUserFont.Buffer |
mallocStack(int capacity)
Returns a new
NkUserFont.Buffer instance allocated on the thread-local MemoryStack. |
static NkUserFont.Buffer |
mallocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
NkUserFont.Buffer instance allocated on the specified MemoryStack. |
static NkUserFont |
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
NkUserFont instance allocated on the specified MemoryStack. |
static float |
nheight(long struct)
Unsafe version of
height(). |
static void |
nheight(long struct,
float value)
Unsafe version of
height. |
static NkQueryFontGlyphCallback |
nquery(long struct)
Unsafe version of
query(). |
static void |
nquery(long struct,
NkQueryFontGlyphCallbackI value)
Unsafe version of
query. |
static NkHandle |
ntexture(long struct)
Unsafe version of
texture(). |
static void |
ntexture(long struct,
NkHandle value)
Unsafe version of
texture. |
static NkHandle |
nuserdata(long struct)
Unsafe version of
userdata(). |
static void |
nuserdata(long struct,
NkHandle value)
Unsafe version of
userdata. |
static NkTextWidthCallback |
nwidth(long struct)
Unsafe version of
width(). |
static void |
nwidth(long struct,
NkTextWidthCallbackI value)
Unsafe version of
width. |
NkQueryFontGlyphCallback |
query()
Returns the value of the
query field. |
NkUserFont |
query(NkQueryFontGlyphCallbackI value)
Sets the specified value to the
query field. |
NkUserFont |
set(NkHandle userdata,
float height,
NkTextWidthCallbackI width,
NkQueryFontGlyphCallbackI query,
NkHandle texture)
Initializes this struct with the specified values.
|
NkUserFont |
set(NkUserFont src)
Copies the specified struct data to this struct.
|
int |
sizeof() |
NkHandle |
texture()
Returns a
NkHandle view of the texture field. |
NkUserFont |
texture(java.util.function.Consumer<NkHandle> consumer)
Passes the
texture field to the specified Consumer. |
NkUserFont |
texture(NkHandle value)
Copies the specified
NkHandle to the texture field. |
NkHandle |
userdata()
Returns a
NkHandle view of the userdata field. |
NkUserFont |
userdata(java.util.function.Consumer<NkHandle> consumer)
Passes the
userdata field to the specified Consumer. |
NkUserFont |
userdata(NkHandle value)
Copies the specified
NkHandle to the userdata field. |
NkTextWidthCallback |
width()
Returns the value of the
width field. |
NkUserFont |
width(NkTextWidthCallbackI value)
Sets the specified value to the
width field. |
public static final int SIZEOF
public static final int ALIGNOF
public static final int USERDATA
public static final int HEIGHT
public static final int WIDTH
public static final int QUERY
public static final int TEXTURE
public NkUserFont(java.nio.ByteBuffer container)
NkUserFont 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.
public int sizeof()
sizeof in class org.lwjgl.system.Structpublic float height()
height field.@Nullable public NkTextWidthCallback width()
width field.@Nullable public NkQueryFontGlyphCallback query()
query field.public NkUserFont userdata(NkHandle value)
NkHandle to the userdata field.public NkUserFont userdata(java.util.function.Consumer<NkHandle> consumer)
userdata field to the specified Consumer.public NkUserFont height(float value)
height field.public NkUserFont width(@Nullable NkTextWidthCallbackI value)
width field.public NkUserFont query(@Nullable NkQueryFontGlyphCallbackI value)
query field.public NkUserFont texture(NkHandle value)
NkHandle to the texture field.public NkUserFont texture(java.util.function.Consumer<NkHandle> consumer)
texture field to the specified Consumer.public NkUserFont set(NkHandle userdata, float height, NkTextWidthCallbackI width, NkQueryFontGlyphCallbackI query, NkHandle texture)
public NkUserFont set(NkUserFont src)
src - the source structpublic static NkUserFont malloc()
NkUserFont instance allocated with memAlloc. The instance must be explicitly freed.public static NkUserFont calloc()
NkUserFont instance allocated with memCalloc. The instance must be explicitly freed.public static NkUserFont create()
NkUserFont instance allocated with BufferUtils.public static NkUserFont create(long address)
NkUserFont instance for the specified memory address.@Nullable public static NkUserFont createSafe(long address)
public static NkUserFont.Buffer malloc(int capacity)
NkUserFont.Buffer instance allocated with memAlloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static NkUserFont.Buffer calloc(int capacity)
NkUserFont.Buffer instance allocated with memCalloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static NkUserFont.Buffer create(int capacity)
NkUserFont.Buffer instance allocated with BufferUtils.capacity - the buffer capacitypublic static NkUserFont.Buffer create(long address, int capacity)
NkUserFont.Buffer instance at the specified memory.address - the memory addresscapacity - the buffer capacity@Nullable public static NkUserFont.Buffer createSafe(long address, int capacity)
public static NkUserFont mallocStack()
NkUserFont instance allocated on the thread-local MemoryStack.public static NkUserFont callocStack()
NkUserFont instance allocated on the thread-local MemoryStack and initializes all its bits to zero.public static NkUserFont mallocStack(org.lwjgl.system.MemoryStack stack)
NkUserFont instance allocated on the specified MemoryStack.stack - the stack from which to allocatepublic static NkUserFont callocStack(org.lwjgl.system.MemoryStack stack)
NkUserFont instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatepublic static NkUserFont.Buffer mallocStack(int capacity)
NkUserFont.Buffer instance allocated on the thread-local MemoryStack.capacity - the buffer capacitypublic static NkUserFont.Buffer callocStack(int capacity)
NkUserFont.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.capacity - the buffer capacitypublic static NkUserFont.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
NkUserFont.Buffer instance allocated on the specified MemoryStack.stack - the stack from which to allocatecapacity - the buffer capacitypublic static NkUserFont.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
NkUserFont.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatecapacity - the buffer capacitypublic static NkHandle nuserdata(long struct)
userdata().public static float nheight(long struct)
height().@Nullable public static NkTextWidthCallback nwidth(long struct)
width().@Nullable public static NkQueryFontGlyphCallback nquery(long struct)
query().public static void nheight(long struct,
float value)
height.public static void nwidth(long struct,
@Nullable
NkTextWidthCallbackI value)
width.public static void nquery(long struct,
@Nullable
NkQueryFontGlyphCallbackI value)
query.Copyright LWJGL. All Rights Reserved. License terms.