Top Description Inners Fields Constructors Methods
org.lwjgl.nuklear

public Class NkFont

extends Struct<NkFont>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable
Annotations
@NativeType:struct nk_font
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Layout


struct nk_font {
    struct nk_font * next;
    struct nk_user_font handle;
    struct nk_baked_font info;
    float scale;
    struct nk_font_glyph * glyphs;
    struct nk_font_glyph const * fallback;
    nk_rune fallback_codepoint;
    nk_handle texture;
    struct nk_font_config * config;
}

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
NkFont.Buffer

An array of NkFont structs.

Field Summary

Modifier and TypeField and Description
public static final int
ALIGNOF

The struct alignment in bytes.

public static final int
CONFIG

The struct member offsets.

public static final int
FALLBACK

The struct member offsets.

public static final int
FALLBACK_CODEPOINT

The struct member offsets.

public static final int
GLYPHS

The struct member offsets.

public static final int
HANDLE

The struct member offsets.

public static final int
INFO

The struct member offsets.

public static final int
NEXT

The struct member offsets.

public static final int
SCALE

The struct member offsets.

public static final int
SIZEOF

The struct size in bytes.

public static final int
TEXTURE

The struct member offsets.

Inherited from org.lwjgl.system.Struct:
containerDEFAULT_ALIGN_ASDEFAULT_PACK_ALIGNMENT

Constructor Summary

AccessConstructor and Description
protected
NkFont(long address, ByteBuffer container)

public
NkFont(ByteBuffer container)

Creates a NkFont instance at the current position of the specified ByteBuffer container.

Method Summary

Modifier and TypeMethod and Description
public static NkFont
calloc()

Returns a new NkFont instance allocated with memCalloc.

public static NkFont.Buffer
calloc(int
the buffer capacity
capacity
)

Returns a new NkFont.Buffer instance allocated with memCalloc.

public static NkFont
calloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new NkFont instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static NkFont.Buffer
calloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new NkFont.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

public NkFontConfig

Returns:

a NkFontConfig view of the struct pointed to by the config field.
config
()

public NkFont
config(NkFontConfig value)

Sets the address of the specified NkFontConfig to the config field.

protected NkFont
create(long
the struct memory address
address
,
ByteBuffer
an optional container buffer, to be referenced strongly by the struct instance.
container
)

Implements abstract org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.
public static NkFont
create()

Returns a new NkFont instance allocated with BufferUtils.

public static NkFont
create(long address)

Returns a new NkFont instance for the specified memory address.

public static NkFont.Buffer
create(int
the buffer capacity
capacity
)

Returns a new NkFont.Buffer instance allocated with BufferUtils.

public static NkFont.Buffer
create(long
the memory address
address
,
int
the buffer capacity
capacity
)

Create a NkFont.Buffer instance at the specified memory.

public static NkFont
createSafe(long address)

Like create, but returns null if address is NULL.

public static NkFont.Buffer
createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

public NkFontGlyph

Returns:

a NkFontGlyph view of the struct pointed to by the fallback field.
fallback
()

public NkFont
fallback(NkFontGlyph value)

Sets the address of the specified NkFontGlyph to the fallback field.

public int

Returns:

the value of the fallback_codepoint field.
fallback_codepoint
()

public NkFont
fallback_codepoint(int value)

Sets the specified value to the fallback_codepoint field.

public NkFontGlyph

Returns:

a NkFontGlyph view of the struct pointed to by the glyphs field.
glyphs
()

public NkFont
glyphs(NkFontGlyph value)

Sets the address of the specified NkFontGlyph to the glyphs field.

public NkUserFont

Returns:

a NkUserFont view of the handle field.
handle
()

public NkFont
handle(NkUserFont value)

Copies the specified NkUserFont to the handle field.

public NkFont
handle(Consumer<NkUserFont> consumer)

Passes the handle field to the specified Consumer.

public NkBakedFont

Returns:

a NkBakedFont view of the info field.
info
()

public NkFont
info(NkBakedFont value)

Copies the specified NkBakedFont to the info field.

public NkFont
info(Consumer<NkBakedFont> consumer)

Passes the info field to the specified Consumer.

public static NkFont
malloc()

Returns a new NkFont instance allocated with memAlloc.

public static NkFont.Buffer
malloc(int
the buffer capacity
capacity
)

Returns a new NkFont.Buffer instance allocated with memAlloc.

public static NkFont
malloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new NkFont instance allocated on the specified MemoryStack.

public static NkFont.Buffer
malloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new NkFont.Buffer instance allocated on the specified MemoryStack.

public static NkFontConfig
nconfig(long struct)

Unsafe version of config.

public static void
nconfig(long struct, NkFontConfig value)

Unsafe version of config.

public NkFont

Returns:

a NkFont view of the struct pointed to by the next field.
next
()

public NkFont
next(NkFont value)

Sets the address of the specified NkFont to the next field.

public static NkFontGlyph
nfallback(long struct)

Unsafe version of fallback.

public static void
nfallback(long struct, NkFontGlyph value)

Unsafe version of fallback.

public static int
nfallback_codepoint(long struct)

Unsafe version of fallback_codepoint.

public static void
nfallback_codepoint(long struct, int value)

Unsafe version of fallback_codepoint.

public static NkFontGlyph
nglyphs(long struct)

Unsafe version of glyphs.

public static void
nglyphs(long struct, NkFontGlyph value)

Unsafe version of glyphs.

public static NkUserFont
nhandle(long struct)

Unsafe version of handle.

public static void
nhandle(long struct, NkUserFont value)

Unsafe version of handle.

public static NkBakedFont
ninfo(long struct)

Unsafe version of info.

public static void
ninfo(long struct, NkBakedFont value)

Unsafe version of info.

public static NkFont
nnext(long struct)

Unsafe version of next.

public static void
nnext(long struct, NkFont value)

Unsafe version of next.

public static float
nscale(long struct)

Unsafe version of scale.

public static void
nscale(long struct, float value)

Unsafe version of scale.

public static NkHandle
ntexture(long struct)

Unsafe version of texture.

public static void
ntexture(long struct, NkHandle value)

Unsafe version of texture.

public float

Returns:

the value of the scale field.
scale
()

public NkFont
scale(float value)

Sets the specified value to the scale field.

public NkFont
set(NkFont next, NkUserFont handle, NkBakedFont info, float scale, NkFontGlyph glyphs, NkFontGlyph fallback, int fallback_codepoint, NkHandle texture, NkFontConfig config)

Initializes this struct with the specified values.

public NkFont

Returns:

this struct
set
(NkFont
the source struct
src
)

Copies the specified struct data to this struct.

public int
sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).
public NkHandle

Returns:

a NkHandle view of the texture field.
texture
()

public NkFont
texture(NkHandle value)

Copies the specified NkHandle to the texture field.

public NkFont
texture(Consumer<NkHandle> consumer)

Passes the texture field to the specified Consumer.

Inherited from org.lwjgl.system.Struct:
__array__array__array__checkContainer__checkMalloc__create__getContainer__getContainer__member__member__member__padding__padding__struct__struct__union__unionclearfreeisNullvalidate

Field Detail

ALIGNOFback to summary
public static final int ALIGNOF

The struct alignment in bytes.

CONFIGback to summary
public static final int CONFIG

The struct member offsets.

FALLBACKback to summary
public static final int FALLBACK

The struct member offsets.

FALLBACK_CODEPOINTback to summary
public static final int FALLBACK_CODEPOINT

The struct member offsets.

GLYPHSback to summary
public static final int GLYPHS

The struct member offsets.

HANDLEback to summary
public static final int HANDLE

The struct member offsets.

INFOback to summary
public static final int INFO

The struct member offsets.

NEXTback to summary
public static final int NEXT

The struct member offsets.

SCALEback to summary
public static final int SCALE

The struct member offsets.

SIZEOFback to summary
public static final int SIZEOF

The struct size in bytes.

TEXTUREback to summary
public static final int TEXTURE

The struct member offsets.

Constructor Detail

NkFontback to summary
protected NkFont(long address, ByteBuffer container)
NkFontback to summary
public NkFont(ByteBuffer container)

Creates a NkFont 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 Detail

callocback to summary
public static NkFont calloc()

Returns a new NkFont instance allocated with memCalloc. The instance must be explicitly freed.

callocback to summary
public static NkFont.Buffer calloc(int capacity)

Returns a new NkFont.Buffer instance allocated with memCalloc. The instance must be explicitly freed.

Parameters
capacity:int

the buffer capacity

callocback to summary
public static NkFont calloc(MemoryStack stack)

Returns a new NkFont instance allocated on the specified MemoryStack and initializes all its bits to zero.

Parameters
stack:MemoryStack

the stack from which to allocate

callocback to summary
public static NkFont.Buffer calloc(int capacity, MemoryStack stack)

Returns a new NkFont.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

Parameters
capacity:int

the buffer capacity

stack:MemoryStack

the stack from which to allocate

configback to summary
public NkFontConfig config()
Returns:NkFontConfig

a NkFontConfig view of the struct pointed to by the config field.

Annotations
@Nullable
@NativeType:struct nk_font_config *
configback to summary
public NkFont config(NkFontConfig value)

Sets the address of the specified NkFontConfig to the config field.

createback to summary
protected NkFont create(long address, ByteBuffer container)

Implements abstract org.lwjgl.system.Struct.create.

Doc from org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.

Effectively, every Struct instance is a factory for more instances of the same type. This is used by StructBuffer.

Parameters
address:long

the struct memory address

container:ByteBuffer

an optional container buffer, to be referenced strongly by the struct instance.

Annotations
@Override
createback to summary
public static NkFont create()

Returns a new NkFont instance allocated with BufferUtils.

createback to summary
public static NkFont create(long address)

Returns a new NkFont instance for the specified memory address.

createback to summary
public static NkFont.Buffer create(int capacity)

Returns a new NkFont.Buffer instance allocated with BufferUtils.

Parameters
capacity:int

the buffer capacity

createback to summary
public static NkFont.Buffer create(long address, int capacity)

Create a NkFont.Buffer instance at the specified memory.

Parameters
address:long

the memory address

capacity:int

the buffer capacity

createSafeback to summary
public static NkFont createSafe(long address)

Like create, but returns null if address is NULL.

Annotations
@Nullable
createSafeback to summary
public static NkFont.Buffer createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

Annotations
@Nullable
fallbackback to summary
public NkFontGlyph fallback()
Returns:NkFontGlyph

a NkFontGlyph view of the struct pointed to by the fallback field.

Annotations
@Nullable
@NativeType:struct nk_font_glyph const *
fallbackback to summary
public NkFont fallback(NkFontGlyph value)

Sets the address of the specified NkFontGlyph to the fallback field.

fallback_codepointback to summary
public int fallback_codepoint()
Returns:int

the value of the fallback_codepoint field.

Annotations
@NativeType:nk_rune
fallback_codepointback to summary
public NkFont fallback_codepoint(int value)

Sets the specified value to the fallback_codepoint field.

glyphsback to summary
public NkFontGlyph glyphs()
Returns:NkFontGlyph

a NkFontGlyph view of the struct pointed to by the glyphs field.

Annotations
@Nullable
@NativeType:struct nk_font_glyph *
glyphsback to summary
public NkFont glyphs(NkFontGlyph value)

Sets the address of the specified NkFontGlyph to the glyphs field.

handleback to summary
public NkUserFont handle()
Returns:NkUserFont

a NkUserFont view of the handle field.

Annotations
@NativeType:struct nk_user_font
handleback to summary
public NkFont handle(NkUserFont value)

Copies the specified NkUserFont to the handle field.

handleback to summary
public NkFont handle(Consumer<NkUserFont> consumer)

Passes the handle field to the specified Consumer.

infoback to summary
public NkBakedFont info()
Returns:NkBakedFont

a NkBakedFont view of the info field.

Annotations
@NativeType:struct nk_baked_font
infoback to summary
public NkFont info(NkBakedFont value)

Copies the specified NkBakedFont to the info field.

infoback to summary
public NkFont info(Consumer<NkBakedFont> consumer)

Passes the info field to the specified Consumer.

mallocback to summary
public static NkFont malloc()

Returns a new NkFont instance allocated with memAlloc. The instance must be explicitly freed.

mallocback to summary
public static NkFont.Buffer malloc(int capacity)

Returns a new NkFont.Buffer instance allocated with memAlloc. The instance must be explicitly freed.

Parameters
capacity:int

the buffer capacity

mallocback to summary
public static NkFont malloc(MemoryStack stack)

Returns a new NkFont instance allocated on the specified MemoryStack.

Parameters
stack:MemoryStack

the stack from which to allocate

mallocback to summary
public static NkFont.Buffer malloc(int capacity, MemoryStack stack)

Returns a new NkFont.Buffer instance allocated on the specified MemoryStack.

Parameters
capacity:int

the buffer capacity

stack:MemoryStack

the stack from which to allocate

nconfigback to summary
public static NkFontConfig nconfig(long struct)

Unsafe version of config.

Annotations
@Nullable
nconfigback to summary
public static void nconfig(long struct, NkFontConfig value)

Unsafe version of config.

nextback to summary
public NkFont next()
Returns:NkFont

a NkFont view of the struct pointed to by the next field.

Annotations
@Nullable
@NativeType:struct nk_font *
nextback to summary
public NkFont next(NkFont value)

Sets the address of the specified NkFont to the next field.

nfallbackback to summary
public static NkFontGlyph nfallback(long struct)

Unsafe version of fallback.

Annotations
@Nullable
nfallbackback to summary
public static void nfallback(long struct, NkFontGlyph value)

Unsafe version of fallback.

nfallback_codepointback to summary
public static int nfallback_codepoint(long struct)

Unsafe version of fallback_codepoint.

nfallback_codepointback to summary
public static void nfallback_codepoint(long struct, int value)

Unsafe version of fallback_codepoint.

nglyphsback to summary
public static NkFontGlyph nglyphs(long struct)

Unsafe version of glyphs.

Annotations
@Nullable
nglyphsback to summary
public static void nglyphs(long struct, NkFontGlyph value)

Unsafe version of glyphs.

nhandleback to summary
public static NkUserFont nhandle(long struct)

Unsafe version of handle.

nhandleback to summary
public static void nhandle(long struct, NkUserFont value)

Unsafe version of handle.

ninfoback to summary
public static NkBakedFont ninfo(long struct)

Unsafe version of info.

ninfoback to summary
public static void ninfo(long struct, NkBakedFont value)

Unsafe version of info.

nnextback to summary
public static NkFont nnext(long struct)

Unsafe version of next.

Annotations
@Nullable
nnextback to summary
public static void nnext(long struct, NkFont value)

Unsafe version of next.

nscaleback to summary
public static float nscale(long struct)

Unsafe version of scale.

nscaleback to summary
public static void nscale(long struct, float value)

Unsafe version of scale.

ntextureback to summary
public static NkHandle ntexture(long struct)

Unsafe version of texture.

ntextureback to summary
public static void ntexture(long struct, NkHandle value)

Unsafe version of texture.

scaleback to summary
public float scale()
Returns:float

the value of the scale field.

scaleback to summary
public NkFont scale(float value)

Sets the specified value to the scale field.

setback to summary
public NkFont set(NkFont next, NkUserFont handle, NkBakedFont info, float scale, NkFontGlyph glyphs, NkFontGlyph fallback, int fallback_codepoint, NkHandle texture, NkFontConfig config)

Initializes this struct with the specified values.

setback to summary
public NkFont set(NkFont src)

Copies the specified struct data to this struct.

Parameters
src:NkFont

the source struct

Returns:NkFont

this struct

sizeofback to summary
public int sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Doc from org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).

Annotations
@Override
textureback to summary
public NkHandle texture()
Returns:NkHandle

a NkHandle view of the texture field.

Annotations
@NativeType:nk_handle
textureback to summary
public NkFont texture(NkHandle value)

Copies the specified NkHandle to the texture field.

textureback to summary
public NkFont texture(Consumer<NkHandle> consumer)

Passes the texture field to the specified Consumer.

org.lwjgl.nuklear back to summary

public Class NkFont.Buffer

extends StructBuffer<NkFont, NkFont.Buffer>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable

An array of NkFont structs.

Field Summary

Modifier and TypeField and Description
private static final NkFont

Constructor Summary

AccessConstructor and Description
public
Buffer(ByteBuffer container)

Creates a new NkFont.Buffer instance backed by the specified container.

public
Buffer(long address, int cap)

pack-priv
Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap)

Method Summary

Modifier and TypeMethod and Description
public NkFontConfig

Returns:

a NkFontConfig view of the struct pointed to by the config field.
config
()

public NkFont.Buffer
config(NkFontConfig value)

Sets the address of the specified NkFontConfig to the config field.

public NkFontGlyph

Returns:

a NkFontGlyph view of the struct pointed to by the fallback field.
fallback
()

public NkFont.Buffer
fallback(NkFontGlyph value)

Sets the address of the specified NkFontGlyph to the fallback field.

public int

Returns:

the value of the fallback_codepoint field.
fallback_codepoint
()

public NkFont.Buffer
fallback_codepoint(int value)

Sets the specified value to the fallback_codepoint field.

protected NkFont
public NkFontGlyph

Returns:

a NkFontGlyph view of the struct pointed to by the glyphs field.
glyphs
()

public NkFont.Buffer
glyphs(NkFontGlyph value)

Sets the address of the specified NkFontGlyph to the glyphs field.

public NkUserFont

Returns:

a NkUserFont view of the handle field.
handle
()

public NkFont.Buffer
handle(NkUserFont value)

Copies the specified NkUserFont to the handle field.

public NkFont.Buffer
handle(Consumer<NkUserFont> consumer)

Passes the handle field to the specified Consumer.

public NkBakedFont

Returns:

a NkBakedFont view of the info field.
info
()

public NkFont.Buffer
info(NkBakedFont value)

Copies the specified NkBakedFont to the info field.

public NkFont.Buffer
info(Consumer<NkBakedFont> consumer)

Passes the info field to the specified Consumer.

public NkFont

Returns:

a NkFont view of the struct pointed to by the next field.
next
()

public NkFont.Buffer
next(NkFont value)

Sets the address of the specified NkFont to the next field.

public float

Returns:

the value of the scale field.
scale
()

public NkFont.Buffer
scale(float value)

Sets the specified value to the scale field.

protected NkFont.Buffer
public NkHandle

Returns:

a NkHandle view of the texture field.
texture
()

public NkFont.Buffer
texture(NkHandle value)

Copies the specified NkHandle to the texture field.

public NkFont.Buffer
texture(Consumer<NkHandle> consumer)

Passes the texture field to the specified Consumer.

Inherited from org.lwjgl.system.StructBuffer:
applyapplyforEachgetgetgetgetiteratorparallelStreamputputsizeofspliteratorstream

Field Detail

ELEMENT_FACTORYback to summary
private static final NkFont ELEMENT_FACTORY

Constructor Detail

Bufferback to summary
public Buffer(ByteBuffer container)

Creates a new NkFont.Buffer instance backed by the specified container.

Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by NkFont#SIZEOF, and its mark will be undefined.

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

Bufferback to summary
public Buffer(long address, int cap)
Bufferback to summary
pack-priv Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap)

Method Detail

configback to summary
public NkFontConfig config()
Returns:NkFontConfig

a NkFontConfig view of the struct pointed to by the config field.

Annotations
@Nullable
@NativeType:struct nk_font_config *
configback to summary
public NkFont.Buffer config(NkFontConfig value)

Sets the address of the specified NkFontConfig to the config field.

fallbackback to summary
public NkFontGlyph fallback()
Returns:NkFontGlyph

a NkFontGlyph view of the struct pointed to by the fallback field.

Annotations
@Nullable
@NativeType:struct nk_font_glyph const *
fallbackback to summary
public NkFont.Buffer fallback(NkFontGlyph value)

Sets the address of the specified NkFontGlyph to the fallback field.

fallback_codepointback to summary
public int fallback_codepoint()
Returns:int

the value of the fallback_codepoint field.

Annotations
@NativeType:nk_rune
fallback_codepointback to summary
public NkFont.Buffer fallback_codepoint(int value)

Sets the specified value to the fallback_codepoint field.

getElementFactoryback to summary
protected NkFont getElementFactory()

Implements abstract org.lwjgl.system.StructBuffer.getElementFactory.

Annotations
@Override
glyphsback to summary
public NkFontGlyph glyphs()
Returns:NkFontGlyph

a NkFontGlyph view of the struct pointed to by the glyphs field.

Annotations
@Nullable
@NativeType:struct nk_font_glyph *
glyphsback to summary
public NkFont.Buffer glyphs(NkFontGlyph value)

Sets the address of the specified NkFontGlyph to the glyphs field.

handleback to summary
public NkUserFont handle()
Returns:NkUserFont

a NkUserFont view of the handle field.

Annotations
@NativeType:struct nk_user_font
handleback to summary
public NkFont.Buffer handle(NkUserFont value)

Copies the specified NkUserFont to the handle field.

handleback to summary
public NkFont.Buffer handle(Consumer<NkUserFont> consumer)

Passes the handle field to the specified Consumer.

infoback to summary
public NkBakedFont info()
Returns:NkBakedFont

a NkBakedFont view of the info field.

Annotations
@NativeType:struct nk_baked_font
infoback to summary
public NkFont.Buffer info(NkBakedFont value)

Copies the specified NkBakedFont to the info field.

infoback to summary
public NkFont.Buffer info(Consumer<NkBakedFont> consumer)

Passes the info field to the specified Consumer.

nextback to summary
public NkFont next()
Returns:NkFont

a NkFont view of the struct pointed to by the next field.

Annotations
@Nullable
@NativeType:struct nk_font *
nextback to summary
public NkFont.Buffer next(NkFont value)

Sets the address of the specified NkFont to the next field.

scaleback to summary
public float scale()
Returns:float

the value of the scale field.

scaleback to summary
public NkFont.Buffer scale(float value)

Sets the specified value to the scale field.

selfback to summary
protected NkFont.Buffer self()

Implements abstract org.lwjgl.system.CustomBuffer.self.

Annotations
@Override
textureback to summary
public NkHandle texture()
Returns:NkHandle

a NkHandle view of the texture field.

Annotations
@NativeType:nk_handle
textureback to summary
public NkFont.Buffer texture(NkHandle value)

Copies the specified NkHandle to the texture field.

textureback to summary
public NkFont.Buffer texture(Consumer<NkHandle> consumer)

Passes the texture field to the specified Consumer.