Package org.lwjgl.stb

Class STBTTPackRange

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

    public class STBTTPackRange
    extends Struct
    implements 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
    • h_oversample – used internally
    • v_oversample – used internally


     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

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.

        The struct member offsets.
    • 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: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class 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.
      • h_oversample

        public byte h_oversample()
        Returns the value of the h_oversample field.
      • v_oversample

        public byte v_oversample()
        Returns the value of the v_oversample 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​(@Nullable
                                                          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.
      • h_oversample

        public STBTTPackRange h_oversample​(byte value)
        Sets the specified value to the h_oversample field.
      • v_oversample

        public STBTTPackRange v_oversample​(byte value)
        Sets the specified value to the v_oversample 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,
                                  byte h_oversample,
                                  byte v_oversample)
        Initializes this struct with the specified values.
      • set

        public STBTTPackRange set​(STBTTPackRange src)
        Copies the specified struct data to this struct.
        src - the source struct
        this struct
      • createSafe

        public static STBTTPackRange createSafe​(long address)
        Like create, but returns null if address is NULL.
      • create

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

        public static STBTTPackRange.Buffer createSafe​(long address,
                                                       int capacity)
        Like create, but returns null if address is NULL.
      • nfont_size

        public static float nfont_size​(long struct)
        Unsafe version of font_size().
      • narray_of_unicode_codepoints

        public static java.nio.IntBuffer narray_of_unicode_codepoints​(long struct)
        Unsafe version of array_of_unicode_codepoints.
      • nnum_chars

        public static int nnum_chars​(long struct)
        Unsafe version of num_chars().
      • nh_oversample

        public static byte nh_oversample​(long struct)
        Unsafe version of h_oversample().
      • nv_oversample

        public static byte nv_oversample​(long struct)
        Unsafe version of v_oversample().
      • nfont_size

        public static void nfont_size​(long struct,
                                      float value)
        Unsafe version of font_size.
      • nfirst_unicode_codepoint_in_range

        public static void nfirst_unicode_codepoint_in_range​(long struct,
                                                             int value)
      • narray_of_unicode_codepoints

        public static void narray_of_unicode_codepoints​(long struct,
                                                        java.nio.IntBuffer value)
        Unsafe version of array_of_unicode_codepoints.
      • nnum_chars

        public static void nnum_chars​(long struct,
                                      int value)
        Sets the specified value to the num_chars field of the specified struct.
      • nh_oversample

        public static void nh_oversample​(long struct,
                                         byte value)
        Unsafe version of h_oversample.
      • nv_oversample

        public static void nv_oversample​(long struct,
                                         byte value)
        Unsafe version of v_oversample.
      • validate

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

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