Package org.lwjgl.stb

Class STBTTPackRange

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer


    public class STBTTPackRange
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    A range of packed character data, used by PackFontRanges

    Member documentation

    • font_size – the font size
    • first_unicode_codepoint_in_range – if non-zero, then the chars are continuous, and this is the first codepoint
    • array_of_unicode_codepoints – if non-zero, then this is an array of unicode codepoints
    • num_chars – the number of codepoints in the range
    • chardata_for_range – output

    Layout

    struct stbtt_pack_range {
        float font_size;
        int first_unicode_codepoint_in_range;
        int * array_of_unicode_codepoints;
        int num_chars;
        stbtt_packedchar * chardata_for_range;
        unsigned char h_oversample;
        unsigned char v_oversample;
    }
    • Field Detail

      • SIZEOF

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

      • STBTTPackRange

        public STBTTPackRange(java.nio.ByteBuffer container)
        Creates a STBTTPackRange 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

      • sizeof

        public int sizeof()
        Description copied from class: org.lwjgl.system.Struct
        Returns the sizeof(struct).
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • font_size

        public float font_size()
        Returns the value of the font_size field.
      • first_unicode_codepoint_in_range

        public int first_unicode_codepoint_in_range()
        Returns the value of the first_unicode_codepoint_in_range field.
      • array_of_unicode_codepoints

        public java.nio.IntBuffer array_of_unicode_codepoints()
        Returns a IntBuffer view of the data pointed to by the array_of_unicode_codepoints field.
      • num_chars

        public int num_chars()
        Returns the value of the num_chars field.
      • font_size

        public STBTTPackRange font_size(float value)
        Sets the specified value to the font_size field.
      • first_unicode_codepoint_in_range

        public STBTTPackRange first_unicode_codepoint_in_range(int value)
        Sets the specified value to the first_unicode_codepoint_in_range field.
      • array_of_unicode_codepoints

        public STBTTPackRange array_of_unicode_codepoints(java.nio.IntBuffer value)
        Sets the address of the specified IntBuffer to the array_of_unicode_codepoints field.
      • num_chars

        public STBTTPackRange num_chars(int value)
        Sets the specified value to the num_chars field.
      • set

        public STBTTPackRange set(float font_size,
                                  int first_unicode_codepoint_in_range,
                                  java.nio.IntBuffer array_of_unicode_codepoints,
                                  int num_chars,
                                  STBTTPackedchar.Buffer chardata_for_range)
        Initializes this struct with the specified values.
      • set

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

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

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

        public static STBTTPackRange create(long address)
        Returns a new STBTTPackRange instance for the specified memory address or null if the address is NULL.
      • malloc

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

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

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

        public static STBTTPackRange callocStack()
        Returns a new STBTTPackRange instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static STBTTPackRange mallocStack(org.lwjgl.system.MemoryStack stack)
        Returns a new STBTTPackRange instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static STBTTPackRange callocStack(org.lwjgl.system.MemoryStack stack)
        Returns a new STBTTPackRange instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static STBTTPackRange.Buffer callocStack(int capacity)
        Returns a new STBTTPackRange.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • mallocStack

        public static STBTTPackRange.Buffer mallocStack(int capacity,
                                                        org.lwjgl.system.MemoryStack stack)
        Returns a new STBTTPackRange.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • callocStack

        public static STBTTPackRange.Buffer callocStack(int capacity,
                                                        org.lwjgl.system.MemoryStack stack)
        Returns a new STBTTPackRange.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nh_oversample

        public static byte nh_oversample(long struct)
      • nv_oversample

        public static byte nv_oversample(long struct)
      • nh_oversample

        public static void nh_oversample(long struct,
                                         byte value)
      • nv_oversample

        public static void nv_oversample(long struct,
                                         byte value)
      • validate

        public static void validate(long struct)
        Validates pointer members that should not be NULL.
        Parameters:
        struct - the struct to validate
      • validate

        public static void validate(long array,
                                    int count)
        Calls STBTTPackRange.validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array