diff --git a/FCL/src/main/assets/app_runtime/lwjgl/lwjgl.jar b/FCL/src/main/assets/app_runtime/lwjgl/lwjgl.jar index 29352f90..0d1ff678 100644 Binary files a/FCL/src/main/assets/app_runtime/lwjgl/lwjgl.jar and b/FCL/src/main/assets/app_runtime/lwjgl/lwjgl.jar differ diff --git a/FCL/src/main/assets/app_runtime/lwjgl/version b/FCL/src/main/assets/app_runtime/lwjgl/version index 73512805..60418407 100644 --- a/FCL/src/main/assets/app_runtime/lwjgl/version +++ b/FCL/src/main/assets/app_runtime/lwjgl/version @@ -1 +1 @@ -1709635789759 \ No newline at end of file +1712051464002 \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/BDF_Property.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/BDF_Property.java new file mode 100644 index 00000000..4ff56604 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/BDF_Property.java @@ -0,0 +1,292 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * This structure models a given BDF/PCF property. + * + *

Layout

+ * + *

+ * struct BDF_PropertyRec {
+ *     BDF_PropertyType type;
+ *     union {
+ *         char const * atom;
+ *         FT_Int32 integer;
+ *         FT_UInt32 cardinal;
+ *     } u;
+ * }
+ */ +@NativeType("struct BDF_PropertyRec") +public class BDF_Property extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + U, + U_ATOM, + U_INTEGER, + U_CARDINAL; + + static { + Layout layout = __struct( + __member(4), + __union( + __member(POINTER_SIZE), + __member(4), + __member(4) + ) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + U = layout.offsetof(1); + U_ATOM = layout.offsetof(2); + U_INTEGER = layout.offsetof(3); + U_CARDINAL = layout.offsetof(4); + } + + protected BDF_Property(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected BDF_Property create(long address, @Nullable ByteBuffer container) { + return new BDF_Property(address, container); + } + + /** + * Creates a {@code BDF_Property} instance at the current position of the specified {@link 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 BDF_Property(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code type} field. */ + @NativeType("BDF_PropertyType") + public int type() { return ntype(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code u.atom} field. */ + @Nullable + @NativeType("char const *") + public ByteBuffer u_atom() { return nu_atom(address()); } + /** @return the null-terminated string pointed to by the {@code u.atom} field. */ + @Nullable + @NativeType("char const *") + public String u_atomString() { return nu_atomString(address()); } + /** @return the value of the {@code u.integer} field. */ + @NativeType("FT_Int32") + public int u_integer() { return nu_integer(address()); } + /** @return the value of the {@code u.cardinal} field. */ + @NativeType("FT_UInt32") + public int u_cardinal() { return nu_cardinal(address()); } + + // ----------------------------------- + + /** Returns a new {@code BDF_Property} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static BDF_Property malloc() { + return new BDF_Property(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code BDF_Property} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static BDF_Property calloc() { + return new BDF_Property(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code BDF_Property} instance allocated with {@link BufferUtils}. */ + public static BDF_Property create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new BDF_Property(memAddress(container), container); + } + + /** Returns a new {@code BDF_Property} instance for the specified memory address. */ + public static BDF_Property create(long address) { + return new BDF_Property(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static BDF_Property createSafe(long address) { + return address == NULL ? null : new BDF_Property(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code BDF_Property} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static BDF_Property malloc(MemoryStack stack) { + return new BDF_Property(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code BDF_Property} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static BDF_Property calloc(MemoryStack stack) { + return new BDF_Property(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + BDF_Property.TYPE); } + /** Unsafe version of {@link #u_atom}. */ + @Nullable public static ByteBuffer nu_atom(long struct) { return memByteBufferNT1Safe(memGetAddress(struct + BDF_Property.U_ATOM)); } + /** Unsafe version of {@link #u_atomString}. */ + @Nullable public static String nu_atomString(long struct) { return memASCIISafe(memGetAddress(struct + BDF_Property.U_ATOM)); } + /** Unsafe version of {@link #u_integer}. */ + public static int nu_integer(long struct) { return UNSAFE.getInt(null, struct + BDF_Property.U_INTEGER); } + /** Unsafe version of {@link #u_cardinal}. */ + public static int nu_cardinal(long struct) { return UNSAFE.getInt(null, struct + BDF_Property.U_CARDINAL); } + + // ----------------------------------- + + /** An array of {@link BDF_Property} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final BDF_Property ELEMENT_FACTORY = BDF_Property.create(-1L); + + /** + * Creates a new {@code BDF_Property.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 {@link BDF_Property#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected BDF_Property getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code type} field. */ + @NativeType("BDF_PropertyType") + public int type() { return BDF_Property.ntype(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code u.atom} field. */ + @Nullable + @NativeType("char const *") + public ByteBuffer u_atom() { return BDF_Property.nu_atom(address()); } + /** @return the null-terminated string pointed to by the {@code u.atom} field. */ + @Nullable + @NativeType("char const *") + public String u_atomString() { return BDF_Property.nu_atomString(address()); } + /** @return the value of the {@code u.integer} field. */ + @NativeType("FT_Int32") + public int u_integer() { return BDF_Property.nu_integer(address()); } + /** @return the value of the {@code u.cardinal} field. */ + @NativeType("FT_UInt32") + public int u_cardinal() { return BDF_Property.nu_cardinal(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/CID_FaceDict.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/CID_FaceDict.java new file mode 100644 index 00000000..97280f40 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/CID_FaceDict.java @@ -0,0 +1,282 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure used to represent data in a CID top-level dictionary. + * + *

Layout

+ * + *

+ * struct CID_FaceDictRec {
+ *     {@link PS_Private PS_PrivateRec} private_dict;
+ *     FT_UInt len_buildchar;
+ *     FT_Fixed forcebold_threshold;
+ *     FT_Pos stroke_width;
+ *     FT_Fixed expansion_factor;
+ *     FT_Byte paint_type;
+ *     FT_Byte font_type;
+ *     {@link FT_Matrix FT_Matrix} font_matrix;
+ *     {@link FT_Vector FT_Vector} font_offset;
+ *     FT_UInt num_subrs;
+ *     FT_ULong subrmap_offset;
+ *     FT_UInt sd_bytes;
+ * }
+ */ +@NativeType("struct CID_FaceDictRec") +public class CID_FaceDict extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + PRIVATE_DICT, + LEN_BUILDCHAR, + FORCEBOLD_THRESHOLD, + STROKE_WIDTH, + EXPANSION_FACTOR, + PAINT_TYPE, + FONT_TYPE, + FONT_MATRIX, + FONT_OFFSET, + NUM_SUBRS, + SUBRMAP_OFFSET, + SD_BYTES; + + static { + Layout layout = __struct( + __member(PS_Private.SIZEOF, PS_Private.ALIGNOF), + __member(4), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(1), + __member(1), + __member(FT_Matrix.SIZEOF, FT_Matrix.ALIGNOF), + __member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF), + __member(4), + __member(CLONG_SIZE), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + PRIVATE_DICT = layout.offsetof(0); + LEN_BUILDCHAR = layout.offsetof(1); + FORCEBOLD_THRESHOLD = layout.offsetof(2); + STROKE_WIDTH = layout.offsetof(3); + EXPANSION_FACTOR = layout.offsetof(4); + PAINT_TYPE = layout.offsetof(5); + FONT_TYPE = layout.offsetof(6); + FONT_MATRIX = layout.offsetof(7); + FONT_OFFSET = layout.offsetof(8); + NUM_SUBRS = layout.offsetof(9); + SUBRMAP_OFFSET = layout.offsetof(10); + SD_BYTES = layout.offsetof(11); + } + + protected CID_FaceDict(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected CID_FaceDict create(long address, @Nullable ByteBuffer container) { + return new CID_FaceDict(address, container); + } + + /** + * Creates a {@code CID_FaceDict} instance at the current position of the specified {@link 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 CID_FaceDict(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link PS_Private} view of the {@code private_dict} field. */ + @NativeType("PS_PrivateRec") + public PS_Private private_dict() { return nprivate_dict(address()); } + /** @return the value of the {@code len_buildchar} field. */ + @NativeType("FT_UInt") + public int len_buildchar() { return nlen_buildchar(address()); } + /** @return the value of the {@code forcebold_threshold} field. */ + @NativeType("FT_Fixed") + public long forcebold_threshold() { return nforcebold_threshold(address()); } + /** @return the value of the {@code stroke_width} field. */ + @NativeType("FT_Pos") + public long stroke_width() { return nstroke_width(address()); } + /** @return the value of the {@code expansion_factor} field. */ + @NativeType("FT_Fixed") + public long expansion_factor() { return nexpansion_factor(address()); } + /** @return the value of the {@code paint_type} field. */ + @NativeType("FT_Byte") + public byte paint_type() { return npaint_type(address()); } + /** @return the value of the {@code font_type} field. */ + @NativeType("FT_Byte") + public byte font_type() { return nfont_type(address()); } + /** @return a {@link FT_Matrix} view of the {@code font_matrix} field. */ + public FT_Matrix font_matrix() { return nfont_matrix(address()); } + /** @return a {@link FT_Vector} view of the {@code font_offset} field. */ + public FT_Vector font_offset() { return nfont_offset(address()); } + /** @return the value of the {@code num_subrs} field. */ + @NativeType("FT_UInt") + public int num_subrs() { return nnum_subrs(address()); } + /** @return the value of the {@code subrmap_offset} field. */ + @NativeType("FT_ULong") + public long subrmap_offset() { return nsubrmap_offset(address()); } + /** @return the value of the {@code sd_bytes} field. */ + @NativeType("FT_UInt") + public int sd_bytes() { return nsd_bytes(address()); } + + // ----------------------------------- + + /** Returns a new {@code CID_FaceDict} instance for the specified memory address. */ + public static CID_FaceDict create(long address) { + return new CID_FaceDict(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static CID_FaceDict createSafe(long address) { + return address == NULL ? null : new CID_FaceDict(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #private_dict}. */ + public static PS_Private nprivate_dict(long struct) { return PS_Private.create(struct + CID_FaceDict.PRIVATE_DICT); } + /** Unsafe version of {@link #len_buildchar}. */ + public static int nlen_buildchar(long struct) { return UNSAFE.getInt(null, struct + CID_FaceDict.LEN_BUILDCHAR); } + /** Unsafe version of {@link #forcebold_threshold}. */ + public static long nforcebold_threshold(long struct) { return memGetCLong(struct + CID_FaceDict.FORCEBOLD_THRESHOLD); } + /** Unsafe version of {@link #stroke_width}. */ + public static long nstroke_width(long struct) { return memGetCLong(struct + CID_FaceDict.STROKE_WIDTH); } + /** Unsafe version of {@link #expansion_factor}. */ + public static long nexpansion_factor(long struct) { return memGetCLong(struct + CID_FaceDict.EXPANSION_FACTOR); } + /** Unsafe version of {@link #paint_type}. */ + public static byte npaint_type(long struct) { return UNSAFE.getByte(null, struct + CID_FaceDict.PAINT_TYPE); } + /** Unsafe version of {@link #font_type}. */ + public static byte nfont_type(long struct) { return UNSAFE.getByte(null, struct + CID_FaceDict.FONT_TYPE); } + /** Unsafe version of {@link #font_matrix}. */ + public static FT_Matrix nfont_matrix(long struct) { return FT_Matrix.create(struct + CID_FaceDict.FONT_MATRIX); } + /** Unsafe version of {@link #font_offset}. */ + public static FT_Vector nfont_offset(long struct) { return FT_Vector.create(struct + CID_FaceDict.FONT_OFFSET); } + /** Unsafe version of {@link #num_subrs}. */ + public static int nnum_subrs(long struct) { return UNSAFE.getInt(null, struct + CID_FaceDict.NUM_SUBRS); } + /** Unsafe version of {@link #subrmap_offset}. */ + public static long nsubrmap_offset(long struct) { return memGetCLong(struct + CID_FaceDict.SUBRMAP_OFFSET); } + /** Unsafe version of {@link #sd_bytes}. */ + public static int nsd_bytes(long struct) { return UNSAFE.getInt(null, struct + CID_FaceDict.SD_BYTES); } + + // ----------------------------------- + + /** An array of {@link CID_FaceDict} structs. */ + public static class Buffer extends StructBuffer { + + private static final CID_FaceDict ELEMENT_FACTORY = CID_FaceDict.create(-1L); + + /** + * Creates a new {@code CID_FaceDict.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 {@link CID_FaceDict#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected CID_FaceDict getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link PS_Private} view of the {@code private_dict} field. */ + @NativeType("PS_PrivateRec") + public PS_Private private_dict() { return CID_FaceDict.nprivate_dict(address()); } + /** @return the value of the {@code len_buildchar} field. */ + @NativeType("FT_UInt") + public int len_buildchar() { return CID_FaceDict.nlen_buildchar(address()); } + /** @return the value of the {@code forcebold_threshold} field. */ + @NativeType("FT_Fixed") + public long forcebold_threshold() { return CID_FaceDict.nforcebold_threshold(address()); } + /** @return the value of the {@code stroke_width} field. */ + @NativeType("FT_Pos") + public long stroke_width() { return CID_FaceDict.nstroke_width(address()); } + /** @return the value of the {@code expansion_factor} field. */ + @NativeType("FT_Fixed") + public long expansion_factor() { return CID_FaceDict.nexpansion_factor(address()); } + /** @return the value of the {@code paint_type} field. */ + @NativeType("FT_Byte") + public byte paint_type() { return CID_FaceDict.npaint_type(address()); } + /** @return the value of the {@code font_type} field. */ + @NativeType("FT_Byte") + public byte font_type() { return CID_FaceDict.nfont_type(address()); } + /** @return a {@link FT_Matrix} view of the {@code font_matrix} field. */ + public FT_Matrix font_matrix() { return CID_FaceDict.nfont_matrix(address()); } + /** @return a {@link FT_Vector} view of the {@code font_offset} field. */ + public FT_Vector font_offset() { return CID_FaceDict.nfont_offset(address()); } + /** @return the value of the {@code num_subrs} field. */ + @NativeType("FT_UInt") + public int num_subrs() { return CID_FaceDict.nnum_subrs(address()); } + /** @return the value of the {@code subrmap_offset} field. */ + @NativeType("FT_ULong") + public long subrmap_offset() { return CID_FaceDict.nsubrmap_offset(address()); } + /** @return the value of the {@code sd_bytes} field. */ + @NativeType("FT_UInt") + public int sd_bytes() { return CID_FaceDict.nsd_bytes(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/CID_FaceInfo.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/CID_FaceInfo.java new file mode 100644 index 00000000..98703847 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/CID_FaceInfo.java @@ -0,0 +1,390 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure used to represent CID Face information. + * + *

Layout

+ * + *

+ * struct CID_FaceInfoRec {
+ *     FT_String * cid_font_name;
+ *     FT_Fixed cid_version;
+ *     FT_Int cid_font_type;
+ *     FT_String * registry;
+ *     FT_String * ordering;
+ *     FT_Int supplement;
+ *     {@link PS_FontInfo PS_FontInfoRec} font_info;
+ *     {@link FT_BBox FT_BBox} font_bbox;
+ *     FT_ULong uid_base;
+ *     FT_Int num_xuid;
+ *     FT_ULong xuid[16];
+ *     FT_ULong cidmap_offset;
+ *     FT_UInt fd_bytes;
+ *     FT_UInt gd_bytes;
+ *     FT_ULong cid_count;
+ *     FT_UInt num_dicts;
+ *     {@link CID_FaceDict CID_FaceDict} font_dicts;
+ *     FT_ULong data_offset;
+ * }
+ */ +@NativeType("struct CID_FaceInfoRec") +public class CID_FaceInfo extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + CID_FONT_NAME, + CID_VERSION, + CID_FONT_TYPE, + REGISTRY, + ORDERING, + SUPPLEMENT, + FONT_INFO, + FONT_BBOX, + UID_BASE, + NUM_XUID, + XUID, + CIDMAP_OFFSET, + FD_BYTES, + GD_BYTES, + CID_COUNT, + NUM_DICTS, + FONT_DICTS, + DATA_OFFSET; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(4), + __member(PS_FontInfo.SIZEOF, PS_FontInfo.ALIGNOF), + __member(FT_BBox.SIZEOF, FT_BBox.ALIGNOF), + __member(CLONG_SIZE), + __member(4), + __array(CLONG_SIZE, 16), + __member(CLONG_SIZE), + __member(4), + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + CID_FONT_NAME = layout.offsetof(0); + CID_VERSION = layout.offsetof(1); + CID_FONT_TYPE = layout.offsetof(2); + REGISTRY = layout.offsetof(3); + ORDERING = layout.offsetof(4); + SUPPLEMENT = layout.offsetof(5); + FONT_INFO = layout.offsetof(6); + FONT_BBOX = layout.offsetof(7); + UID_BASE = layout.offsetof(8); + NUM_XUID = layout.offsetof(9); + XUID = layout.offsetof(10); + CIDMAP_OFFSET = layout.offsetof(11); + FD_BYTES = layout.offsetof(12); + GD_BYTES = layout.offsetof(13); + CID_COUNT = layout.offsetof(14); + NUM_DICTS = layout.offsetof(15); + FONT_DICTS = layout.offsetof(16); + DATA_OFFSET = layout.offsetof(17); + } + + protected CID_FaceInfo(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected CID_FaceInfo create(long address, @Nullable ByteBuffer container) { + return new CID_FaceInfo(address, container); + } + + /** + * Creates a {@code CID_FaceInfo} instance at the current position of the specified {@link 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 CID_FaceInfo(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code cid_font_name} field. */ + @NativeType("FT_String *") + public ByteBuffer cid_font_name() { return ncid_font_name(address()); } + /** @return the null-terminated string pointed to by the {@code cid_font_name} field. */ + @NativeType("FT_String *") + public String cid_font_nameString() { return ncid_font_nameString(address()); } + /** @return the value of the {@code cid_version} field. */ + @NativeType("FT_Fixed") + public long cid_version() { return ncid_version(address()); } + /** @return the value of the {@code cid_font_type} field. */ + @NativeType("FT_Int") + public int cid_font_type() { return ncid_font_type(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code registry} field. */ + @NativeType("FT_String *") + public ByteBuffer registry() { return nregistry(address()); } + /** @return the null-terminated string pointed to by the {@code registry} field. */ + @NativeType("FT_String *") + public String registryString() { return nregistryString(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code ordering} field. */ + @NativeType("FT_String *") + public ByteBuffer ordering() { return nordering(address()); } + /** @return the null-terminated string pointed to by the {@code ordering} field. */ + @NativeType("FT_String *") + public String orderingString() { return norderingString(address()); } + /** @return the value of the {@code supplement} field. */ + @NativeType("FT_Int") + public int supplement() { return nsupplement(address()); } + /** @return a {@link PS_FontInfo} view of the {@code font_info} field. */ + @NativeType("PS_FontInfoRec") + public PS_FontInfo font_info() { return nfont_info(address()); } + /** @return a {@link FT_BBox} view of the {@code font_bbox} field. */ + public FT_BBox font_bbox() { return nfont_bbox(address()); } + /** @return the value of the {@code uid_base} field. */ + @NativeType("FT_ULong") + public long uid_base() { return nuid_base(address()); } + /** @return the value of the {@code num_xuid} field. */ + @NativeType("FT_Int") + public int num_xuid() { return nnum_xuid(address()); } + /** @return a {@link CLongBuffer} view of the {@code xuid} field. */ + @NativeType("FT_ULong[16]") + public CLongBuffer xuid() { return nxuid(address()); } + /** @return the value at the specified index of the {@code xuid} field. */ + @NativeType("FT_ULong") + public long xuid(int index) { return nxuid(address(), index); } + /** @return the value of the {@code cidmap_offset} field. */ + @NativeType("FT_ULong") + public long cidmap_offset() { return ncidmap_offset(address()); } + /** @return the value of the {@code fd_bytes} field. */ + @NativeType("FT_UInt") + public int fd_bytes() { return nfd_bytes(address()); } + /** @return the value of the {@code gd_bytes} field. */ + @NativeType("FT_UInt") + public int gd_bytes() { return ngd_bytes(address()); } + /** @return the value of the {@code cid_count} field. */ + @NativeType("FT_ULong") + public long cid_count() { return ncid_count(address()); } + /** @return the value of the {@code num_dicts} field. */ + @NativeType("FT_UInt") + public int num_dicts() { return nnum_dicts(address()); } + /** @return a {@link CID_FaceDict} view of the struct pointed to by the {@code font_dicts} field. */ + public CID_FaceDict font_dicts() { return nfont_dicts(address()); } + /** @return the value of the {@code data_offset} field. */ + @NativeType("FT_ULong") + public long data_offset() { return ndata_offset(address()); } + + // ----------------------------------- + + /** Returns a new {@code CID_FaceInfo} instance for the specified memory address. */ + public static CID_FaceInfo create(long address) { + return new CID_FaceInfo(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static CID_FaceInfo createSafe(long address) { + return address == NULL ? null : new CID_FaceInfo(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #cid_font_name}. */ + public static ByteBuffer ncid_font_name(long struct) { return memByteBufferNT1(memGetAddress(struct + CID_FaceInfo.CID_FONT_NAME)); } + /** Unsafe version of {@link #cid_font_nameString}. */ + public static String ncid_font_nameString(long struct) { return memUTF8(memGetAddress(struct + CID_FaceInfo.CID_FONT_NAME)); } + /** Unsafe version of {@link #cid_version}. */ + public static long ncid_version(long struct) { return memGetCLong(struct + CID_FaceInfo.CID_VERSION); } + /** Unsafe version of {@link #cid_font_type}. */ + public static int ncid_font_type(long struct) { return UNSAFE.getInt(null, struct + CID_FaceInfo.CID_FONT_TYPE); } + /** Unsafe version of {@link #registry}. */ + public static ByteBuffer nregistry(long struct) { return memByteBufferNT1(memGetAddress(struct + CID_FaceInfo.REGISTRY)); } + /** Unsafe version of {@link #registryString}. */ + public static String nregistryString(long struct) { return memUTF8(memGetAddress(struct + CID_FaceInfo.REGISTRY)); } + /** Unsafe version of {@link #ordering}. */ + public static ByteBuffer nordering(long struct) { return memByteBufferNT1(memGetAddress(struct + CID_FaceInfo.ORDERING)); } + /** Unsafe version of {@link #orderingString}. */ + public static String norderingString(long struct) { return memUTF8(memGetAddress(struct + CID_FaceInfo.ORDERING)); } + /** Unsafe version of {@link #supplement}. */ + public static int nsupplement(long struct) { return UNSAFE.getInt(null, struct + CID_FaceInfo.SUPPLEMENT); } + /** Unsafe version of {@link #font_info}. */ + public static PS_FontInfo nfont_info(long struct) { return PS_FontInfo.create(struct + CID_FaceInfo.FONT_INFO); } + /** Unsafe version of {@link #font_bbox}. */ + public static FT_BBox nfont_bbox(long struct) { return FT_BBox.create(struct + CID_FaceInfo.FONT_BBOX); } + /** Unsafe version of {@link #uid_base}. */ + public static long nuid_base(long struct) { return memGetCLong(struct + CID_FaceInfo.UID_BASE); } + /** Unsafe version of {@link #num_xuid}. */ + public static int nnum_xuid(long struct) { return UNSAFE.getInt(null, struct + CID_FaceInfo.NUM_XUID); } + /** Unsafe version of {@link #xuid}. */ + public static CLongBuffer nxuid(long struct) { return memCLongBuffer(struct + CID_FaceInfo.XUID, 16); } + /** Unsafe version of {@link #xuid(int) xuid}. */ + public static long nxuid(long struct, int index) { + return memGetCLong(struct + CID_FaceInfo.XUID + check(index, 16) * CLONG_SIZE); + } + /** Unsafe version of {@link #cidmap_offset}. */ + public static long ncidmap_offset(long struct) { return memGetCLong(struct + CID_FaceInfo.CIDMAP_OFFSET); } + /** Unsafe version of {@link #fd_bytes}. */ + public static int nfd_bytes(long struct) { return UNSAFE.getInt(null, struct + CID_FaceInfo.FD_BYTES); } + /** Unsafe version of {@link #gd_bytes}. */ + public static int ngd_bytes(long struct) { return UNSAFE.getInt(null, struct + CID_FaceInfo.GD_BYTES); } + /** Unsafe version of {@link #cid_count}. */ + public static long ncid_count(long struct) { return memGetCLong(struct + CID_FaceInfo.CID_COUNT); } + /** Unsafe version of {@link #num_dicts}. */ + public static int nnum_dicts(long struct) { return UNSAFE.getInt(null, struct + CID_FaceInfo.NUM_DICTS); } + /** Unsafe version of {@link #font_dicts}. */ + public static CID_FaceDict nfont_dicts(long struct) { return CID_FaceDict.create(memGetAddress(struct + CID_FaceInfo.FONT_DICTS)); } + /** Unsafe version of {@link #data_offset}. */ + public static long ndata_offset(long struct) { return memGetCLong(struct + CID_FaceInfo.DATA_OFFSET); } + + // ----------------------------------- + + /** An array of {@link CID_FaceInfo} structs. */ + public static class Buffer extends StructBuffer { + + private static final CID_FaceInfo ELEMENT_FACTORY = CID_FaceInfo.create(-1L); + + /** + * Creates a new {@code CID_FaceInfo.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 {@link CID_FaceInfo#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected CID_FaceInfo getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code cid_font_name} field. */ + @NativeType("FT_String *") + public ByteBuffer cid_font_name() { return CID_FaceInfo.ncid_font_name(address()); } + /** @return the null-terminated string pointed to by the {@code cid_font_name} field. */ + @NativeType("FT_String *") + public String cid_font_nameString() { return CID_FaceInfo.ncid_font_nameString(address()); } + /** @return the value of the {@code cid_version} field. */ + @NativeType("FT_Fixed") + public long cid_version() { return CID_FaceInfo.ncid_version(address()); } + /** @return the value of the {@code cid_font_type} field. */ + @NativeType("FT_Int") + public int cid_font_type() { return CID_FaceInfo.ncid_font_type(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code registry} field. */ + @NativeType("FT_String *") + public ByteBuffer registry() { return CID_FaceInfo.nregistry(address()); } + /** @return the null-terminated string pointed to by the {@code registry} field. */ + @NativeType("FT_String *") + public String registryString() { return CID_FaceInfo.nregistryString(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code ordering} field. */ + @NativeType("FT_String *") + public ByteBuffer ordering() { return CID_FaceInfo.nordering(address()); } + /** @return the null-terminated string pointed to by the {@code ordering} field. */ + @NativeType("FT_String *") + public String orderingString() { return CID_FaceInfo.norderingString(address()); } + /** @return the value of the {@code supplement} field. */ + @NativeType("FT_Int") + public int supplement() { return CID_FaceInfo.nsupplement(address()); } + /** @return a {@link PS_FontInfo} view of the {@code font_info} field. */ + @NativeType("PS_FontInfoRec") + public PS_FontInfo font_info() { return CID_FaceInfo.nfont_info(address()); } + /** @return a {@link FT_BBox} view of the {@code font_bbox} field. */ + public FT_BBox font_bbox() { return CID_FaceInfo.nfont_bbox(address()); } + /** @return the value of the {@code uid_base} field. */ + @NativeType("FT_ULong") + public long uid_base() { return CID_FaceInfo.nuid_base(address()); } + /** @return the value of the {@code num_xuid} field. */ + @NativeType("FT_Int") + public int num_xuid() { return CID_FaceInfo.nnum_xuid(address()); } + /** @return a {@link CLongBuffer} view of the {@code xuid} field. */ + @NativeType("FT_ULong[16]") + public CLongBuffer xuid() { return CID_FaceInfo.nxuid(address()); } + /** @return the value at the specified index of the {@code xuid} field. */ + @NativeType("FT_ULong") + public long xuid(int index) { return CID_FaceInfo.nxuid(address(), index); } + /** @return the value of the {@code cidmap_offset} field. */ + @NativeType("FT_ULong") + public long cidmap_offset() { return CID_FaceInfo.ncidmap_offset(address()); } + /** @return the value of the {@code fd_bytes} field. */ + @NativeType("FT_UInt") + public int fd_bytes() { return CID_FaceInfo.nfd_bytes(address()); } + /** @return the value of the {@code gd_bytes} field. */ + @NativeType("FT_UInt") + public int gd_bytes() { return CID_FaceInfo.ngd_bytes(address()); } + /** @return the value of the {@code cid_count} field. */ + @NativeType("FT_ULong") + public long cid_count() { return CID_FaceInfo.ncid_count(address()); } + /** @return the value of the {@code num_dicts} field. */ + @NativeType("FT_UInt") + public int num_dicts() { return CID_FaceInfo.nnum_dicts(address()); } + /** @return a {@link CID_FaceDict} view of the struct pointed to by the {@code font_dicts} field. */ + public CID_FaceDict font_dicts() { return CID_FaceInfo.nfont_dicts(address()); } + /** @return the value of the {@code data_offset} field. */ + @NativeType("FT_ULong") + public long data_offset() { return CID_FaceInfo.ndata_offset(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_Face_Requester.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_Face_Requester.java new file mode 100644 index 00000000..4c0c968f --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_Face_Requester.java @@ -0,0 +1,76 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * FT_Error (*{@link #invoke}) (
+ *     FTC_FaceID face_id,
+ *     FT_Library library,
+ *     FT_Pointer req_data,
+ *     FT_Face *aface
+ * )
+ */ +public abstract class FTC_Face_Requester extends Callback implements FTC_Face_RequesterI { + + /** + * Creates a {@code FTC_Face_Requester} instance from the specified function pointer. + * + * @return the new {@code FTC_Face_Requester} + */ + public static FTC_Face_Requester create(long functionPointer) { + FTC_Face_RequesterI instance = Callback.get(functionPointer); + return instance instanceof FTC_Face_Requester + ? (FTC_Face_Requester)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FTC_Face_Requester createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FTC_Face_Requester} instance that delegates to the specified {@code FTC_Face_RequesterI} instance. */ + public static FTC_Face_Requester create(FTC_Face_RequesterI instance) { + return instance instanceof FTC_Face_Requester + ? (FTC_Face_Requester)instance + : new Container(instance.address(), instance); + } + + protected FTC_Face_Requester() { + super(CIF); + } + + FTC_Face_Requester(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FTC_Face_Requester { + + private final FTC_Face_RequesterI delegate; + + Container(long functionPointer, FTC_Face_RequesterI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public int invoke(long face_id, long library, long req_data, long aface) { + return delegate.invoke(face_id, library, req_data, aface); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_Face_RequesterI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_Face_RequesterI.java new file mode 100644 index 00000000..2176716c --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_Face_RequesterI.java @@ -0,0 +1,56 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * FT_Error (*{@link #invoke}) (
+ *     FTC_FaceID face_id,
+ *     FT_Library library,
+ *     FT_Pointer req_data,
+ *     FT_Face *aface
+ * )
+ */ +@FunctionalInterface +@NativeType("FTC_Face_Requester") +public interface FTC_Face_RequesterI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_sint32, + ffi_type_pointer, ffi_type_pointer, ffi_type_pointer, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + int __result = invoke( + memGetAddress(memGetAddress(args)), + memGetAddress(memGetAddress(args + POINTER_SIZE)), + memGetAddress(memGetAddress(args + 2 * POINTER_SIZE)), + memGetAddress(memGetAddress(args + 3 * POINTER_SIZE)) + ); + apiClosureRet(ret, __result); + } + + /** + * A callback function provided by client applications. It is used by the cache manager to translate a given FTC _FaceID into a new valid {@code FT_Face} + * object, on demand. + */ + @NativeType("FT_Error") int invoke(@NativeType("FTC_FaceID") long face_id, @NativeType("FT_Library") long library, @NativeType("FT_Pointer") long req_data, @NativeType("FT_Face *") long aface); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_ImageType.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_ImageType.java new file mode 100644 index 00000000..64156f10 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_ImageType.java @@ -0,0 +1,190 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure used to model the type of images in a glyph cache. + * + *

Layout

+ * + *

+ * struct FTC_ImageTypeRec {
+ *     FTC_FaceID face_id;
+ *     FT_UInt width;
+ *     FT_UInt height;
+ *     FT_Int32 flags;
+ * }
+ */ +@NativeType("struct FTC_ImageTypeRec") +public class FTC_ImageType extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + FACE_ID, + WIDTH, + HEIGHT, + FLAGS; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + FACE_ID = layout.offsetof(0); + WIDTH = layout.offsetof(1); + HEIGHT = layout.offsetof(2); + FLAGS = layout.offsetof(3); + } + + protected FTC_ImageType(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FTC_ImageType create(long address, @Nullable ByteBuffer container) { + return new FTC_ImageType(address, container); + } + + /** + * Creates a {@code FTC_ImageType} instance at the current position of the specified {@link 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 FTC_ImageType(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code face_id} field. */ + @NativeType("FTC_FaceID") + public long face_id() { return nface_id(address()); } + /** @return the value of the {@code width} field. */ + @NativeType("FT_UInt") + public int width() { return nwidth(address()); } + /** @return the value of the {@code height} field. */ + @NativeType("FT_UInt") + public int height() { return nheight(address()); } + /** @return the value of the {@code flags} field. */ + @NativeType("FT_Int32") + public int flags() { return nflags(address()); } + + // ----------------------------------- + + /** Returns a new {@code FTC_ImageType} instance for the specified memory address. */ + public static FTC_ImageType create(long address) { + return new FTC_ImageType(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FTC_ImageType createSafe(long address) { + return address == NULL ? null : new FTC_ImageType(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #face_id}. */ + public static long nface_id(long struct) { return memGetAddress(struct + FTC_ImageType.FACE_ID); } + /** Unsafe version of {@link #width}. */ + public static int nwidth(long struct) { return UNSAFE.getInt(null, struct + FTC_ImageType.WIDTH); } + /** Unsafe version of {@link #height}. */ + public static int nheight(long struct) { return UNSAFE.getInt(null, struct + FTC_ImageType.HEIGHT); } + /** Unsafe version of {@link #flags}. */ + public static int nflags(long struct) { return UNSAFE.getInt(null, struct + FTC_ImageType.FLAGS); } + + // ----------------------------------- + + /** An array of {@link FTC_ImageType} structs. */ + public static class Buffer extends StructBuffer { + + private static final FTC_ImageType ELEMENT_FACTORY = FTC_ImageType.create(-1L); + + /** + * Creates a new {@code FTC_ImageType.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 {@link FTC_ImageType#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FTC_ImageType getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code face_id} field. */ + @NativeType("FTC_FaceID") + public long face_id() { return FTC_ImageType.nface_id(address()); } + /** @return the value of the {@code width} field. */ + @NativeType("FT_UInt") + public int width() { return FTC_ImageType.nwidth(address()); } + /** @return the value of the {@code height} field. */ + @NativeType("FT_UInt") + public int height() { return FTC_ImageType.nheight(address()); } + /** @return the value of the {@code flags} field. */ + @NativeType("FT_Int32") + public int flags() { return FTC_ImageType.nflags(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_SBit.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_SBit.java new file mode 100644 index 00000000..d8b32a49 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_SBit.java @@ -0,0 +1,270 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A very compact structure used to describe a small glyph bitmap. + * + *

Layout

+ * + *

+ * struct FTC_SBitRec {
+ *     FT_Byte width;
+ *     FT_Byte height;
+ *     FT_Char left;
+ *     FT_Char top;
+ *     FT_Byte format;
+ *     FT_Byte max_grays;
+ *     FT_Short pitch;
+ *     FT_Char xadvance;
+ *     FT_Char yadvance;
+ *     FT_Byte * buffer;
+ * }
+ */ +@NativeType("struct FTC_SBitRec") +public class FTC_SBit extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + WIDTH, + HEIGHT, + LEFT, + TOP, + FORMAT, + MAX_GRAYS, + PITCH, + XADVANCE, + YADVANCE, + BUFFER; + + static { + Layout layout = __struct( + __member(1), + __member(1), + __member(1), + __member(1), + __member(1), + __member(1), + __member(2), + __member(1), + __member(1), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + WIDTH = layout.offsetof(0); + HEIGHT = layout.offsetof(1); + LEFT = layout.offsetof(2); + TOP = layout.offsetof(3); + FORMAT = layout.offsetof(4); + MAX_GRAYS = layout.offsetof(5); + PITCH = layout.offsetof(6); + XADVANCE = layout.offsetof(7); + YADVANCE = layout.offsetof(8); + BUFFER = layout.offsetof(9); + } + + protected FTC_SBit(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FTC_SBit create(long address, @Nullable ByteBuffer container) { + return new FTC_SBit(address, container); + } + + /** + * Creates a {@code FTC_SBit} instance at the current position of the specified {@link 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 FTC_SBit(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code width} field. */ + @NativeType("FT_Byte") + public byte width() { return nwidth(address()); } + /** @return the value of the {@code height} field. */ + @NativeType("FT_Byte") + public byte height() { return nheight(address()); } + /** @return the value of the {@code left} field. */ + @NativeType("FT_Char") + public byte left() { return nleft(address()); } + /** @return the value of the {@code top} field. */ + @NativeType("FT_Char") + public byte top() { return ntop(address()); } + /** @return the value of the {@code format} field. */ + @NativeType("FT_Byte") + public byte format() { return nformat(address()); } + /** @return the value of the {@code max_grays} field. */ + @NativeType("FT_Byte") + public byte max_grays() { return nmax_grays(address()); } + /** @return the value of the {@code pitch} field. */ + @NativeType("FT_Short") + public short pitch() { return npitch(address()); } + /** @return the value of the {@code xadvance} field. */ + @NativeType("FT_Char") + public byte xadvance() { return nxadvance(address()); } + /** @return the value of the {@code yadvance} field. */ + @NativeType("FT_Char") + public byte yadvance() { return nyadvance(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code buffer} field. + * + * @param capacity the number of elements in the returned buffer + */ + @NativeType("FT_Byte *") + public ByteBuffer buffer(int capacity) { return nbuffer(address(), capacity); } + + // ----------------------------------- + + /** Returns a new {@code FTC_SBit} instance for the specified memory address. */ + public static FTC_SBit create(long address) { + return new FTC_SBit(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FTC_SBit createSafe(long address) { + return address == NULL ? null : new FTC_SBit(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #width}. */ + public static byte nwidth(long struct) { return UNSAFE.getByte(null, struct + FTC_SBit.WIDTH); } + /** Unsafe version of {@link #height}. */ + public static byte nheight(long struct) { return UNSAFE.getByte(null, struct + FTC_SBit.HEIGHT); } + /** Unsafe version of {@link #left}. */ + public static byte nleft(long struct) { return UNSAFE.getByte(null, struct + FTC_SBit.LEFT); } + /** Unsafe version of {@link #top}. */ + public static byte ntop(long struct) { return UNSAFE.getByte(null, struct + FTC_SBit.TOP); } + /** Unsafe version of {@link #format}. */ + public static byte nformat(long struct) { return UNSAFE.getByte(null, struct + FTC_SBit.FORMAT); } + /** Unsafe version of {@link #max_grays}. */ + public static byte nmax_grays(long struct) { return UNSAFE.getByte(null, struct + FTC_SBit.MAX_GRAYS); } + /** Unsafe version of {@link #pitch}. */ + public static short npitch(long struct) { return UNSAFE.getShort(null, struct + FTC_SBit.PITCH); } + /** Unsafe version of {@link #xadvance}. */ + public static byte nxadvance(long struct) { return UNSAFE.getByte(null, struct + FTC_SBit.XADVANCE); } + /** Unsafe version of {@link #yadvance}. */ + public static byte nyadvance(long struct) { return UNSAFE.getByte(null, struct + FTC_SBit.YADVANCE); } + /** Unsafe version of {@link #buffer(int) buffer}. */ + public static ByteBuffer nbuffer(long struct, int capacity) { return memByteBuffer(memGetAddress(struct + FTC_SBit.BUFFER), capacity); } + + // ----------------------------------- + + /** An array of {@link FTC_SBit} structs. */ + public static class Buffer extends StructBuffer { + + private static final FTC_SBit ELEMENT_FACTORY = FTC_SBit.create(-1L); + + /** + * Creates a new {@code FTC_SBit.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 {@link FTC_SBit#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FTC_SBit getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code width} field. */ + @NativeType("FT_Byte") + public byte width() { return FTC_SBit.nwidth(address()); } + /** @return the value of the {@code height} field. */ + @NativeType("FT_Byte") + public byte height() { return FTC_SBit.nheight(address()); } + /** @return the value of the {@code left} field. */ + @NativeType("FT_Char") + public byte left() { return FTC_SBit.nleft(address()); } + /** @return the value of the {@code top} field. */ + @NativeType("FT_Char") + public byte top() { return FTC_SBit.ntop(address()); } + /** @return the value of the {@code format} field. */ + @NativeType("FT_Byte") + public byte format() { return FTC_SBit.nformat(address()); } + /** @return the value of the {@code max_grays} field. */ + @NativeType("FT_Byte") + public byte max_grays() { return FTC_SBit.nmax_grays(address()); } + /** @return the value of the {@code pitch} field. */ + @NativeType("FT_Short") + public short pitch() { return FTC_SBit.npitch(address()); } + /** @return the value of the {@code xadvance} field. */ + @NativeType("FT_Char") + public byte xadvance() { return FTC_SBit.nxadvance(address()); } + /** @return the value of the {@code yadvance} field. */ + @NativeType("FT_Char") + public byte yadvance() { return FTC_SBit.nyadvance(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code buffer} field. + * + * @param capacity the number of elements in the returned buffer + */ + @NativeType("FT_Byte *") + public ByteBuffer buffer(int capacity) { return FTC_SBit.nbuffer(address(), capacity); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_Scaler.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_Scaler.java new file mode 100644 index 00000000..563f5dd3 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_Scaler.java @@ -0,0 +1,214 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure used to describe a given character size in either pixels or points to the cache manager. See {@link FreeType#FTC_Manager_LookupSize}. + * + *

Layout

+ * + *

+ * struct FTC_ScalerRec {
+ *     FTC_FaceID face_id;
+ *     FT_UInt width;
+ *     FT_UInt height;
+ *     FT_Int pixel;
+ *     FT_UInt x_res;
+ *     FT_UInt y_res;
+ * }
+ */ +@NativeType("struct FTC_ScalerRec") +public class FTC_Scaler extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + FACE_ID, + WIDTH, + HEIGHT, + PIXEL, + X_RES, + Y_RES; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + FACE_ID = layout.offsetof(0); + WIDTH = layout.offsetof(1); + HEIGHT = layout.offsetof(2); + PIXEL = layout.offsetof(3); + X_RES = layout.offsetof(4); + Y_RES = layout.offsetof(5); + } + + protected FTC_Scaler(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FTC_Scaler create(long address, @Nullable ByteBuffer container) { + return new FTC_Scaler(address, container); + } + + /** + * Creates a {@code FTC_Scaler} instance at the current position of the specified {@link 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 FTC_Scaler(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code face_id} field. */ + @NativeType("FTC_FaceID") + public long face_id() { return nface_id(address()); } + /** @return the value of the {@code width} field. */ + @NativeType("FT_UInt") + public int width() { return nwidth(address()); } + /** @return the value of the {@code height} field. */ + @NativeType("FT_UInt") + public int height() { return nheight(address()); } + /** @return the value of the {@code pixel} field. */ + @NativeType("FT_Int") + public int pixel() { return npixel(address()); } + /** @return the value of the {@code x_res} field. */ + @NativeType("FT_UInt") + public int x_res() { return nx_res(address()); } + /** @return the value of the {@code y_res} field. */ + @NativeType("FT_UInt") + public int y_res() { return ny_res(address()); } + + // ----------------------------------- + + /** Returns a new {@code FTC_Scaler} instance for the specified memory address. */ + public static FTC_Scaler create(long address) { + return new FTC_Scaler(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FTC_Scaler createSafe(long address) { + return address == NULL ? null : new FTC_Scaler(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #face_id}. */ + public static long nface_id(long struct) { return memGetAddress(struct + FTC_Scaler.FACE_ID); } + /** Unsafe version of {@link #width}. */ + public static int nwidth(long struct) { return UNSAFE.getInt(null, struct + FTC_Scaler.WIDTH); } + /** Unsafe version of {@link #height}. */ + public static int nheight(long struct) { return UNSAFE.getInt(null, struct + FTC_Scaler.HEIGHT); } + /** Unsafe version of {@link #pixel}. */ + public static int npixel(long struct) { return UNSAFE.getInt(null, struct + FTC_Scaler.PIXEL); } + /** Unsafe version of {@link #x_res}. */ + public static int nx_res(long struct) { return UNSAFE.getInt(null, struct + FTC_Scaler.X_RES); } + /** Unsafe version of {@link #y_res}. */ + public static int ny_res(long struct) { return UNSAFE.getInt(null, struct + FTC_Scaler.Y_RES); } + + // ----------------------------------- + + /** An array of {@link FTC_Scaler} structs. */ + public static class Buffer extends StructBuffer { + + private static final FTC_Scaler ELEMENT_FACTORY = FTC_Scaler.create(-1L); + + /** + * Creates a new {@code FTC_Scaler.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 {@link FTC_Scaler#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FTC_Scaler getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code face_id} field. */ + @NativeType("FTC_FaceID") + public long face_id() { return FTC_Scaler.nface_id(address()); } + /** @return the value of the {@code width} field. */ + @NativeType("FT_UInt") + public int width() { return FTC_Scaler.nwidth(address()); } + /** @return the value of the {@code height} field. */ + @NativeType("FT_UInt") + public int height() { return FTC_Scaler.nheight(address()); } + /** @return the value of the {@code pixel} field. */ + @NativeType("FT_Int") + public int pixel() { return FTC_Scaler.npixel(address()); } + /** @return the value of the {@code x_res} field. */ + @NativeType("FT_UInt") + public int x_res() { return FTC_Scaler.nx_res(address()); } + /** @return the value of the {@code y_res} field. */ + @NativeType("FT_UInt") + public int y_res() { return FTC_Scaler.ny_res(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Affine23.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Affine23.java new file mode 100644 index 00000000..fdf9fdd4 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Affine23.java @@ -0,0 +1,213 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure used to store a 2x3 matrix. Coefficients are in 16.16 fixed-point format. + * + *

Layout

+ * + *

+ * struct FT_Affine23 {
+ *     FT_Fixed xx;
+ *     FT_Fixed xy;
+ *     FT_Fixed dx;
+ *     FT_Fixed yx;
+ *     FT_Fixed yy;
+ *     FT_Fixed dy;
+ * }
+ */ +public class FT_Affine23 extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + XX, + XY, + DX, + YX, + YY, + DY; + + static { + Layout layout = __struct( + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + XX = layout.offsetof(0); + XY = layout.offsetof(1); + DX = layout.offsetof(2); + YX = layout.offsetof(3); + YY = layout.offsetof(4); + DY = layout.offsetof(5); + } + + protected FT_Affine23(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Affine23 create(long address, @Nullable ByteBuffer container) { + return new FT_Affine23(address, container); + } + + /** + * Creates a {@code FT_Affine23} instance at the current position of the specified {@link 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 FT_Affine23(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code xx} field. */ + @NativeType("FT_Fixed") + public long xx() { return nxx(address()); } + /** @return the value of the {@code xy} field. */ + @NativeType("FT_Fixed") + public long xy() { return nxy(address()); } + /** @return the value of the {@code dx} field. */ + @NativeType("FT_Fixed") + public long dx() { return ndx(address()); } + /** @return the value of the {@code yx} field. */ + @NativeType("FT_Fixed") + public long yx() { return nyx(address()); } + /** @return the value of the {@code yy} field. */ + @NativeType("FT_Fixed") + public long yy() { return nyy(address()); } + /** @return the value of the {@code dy} field. */ + @NativeType("FT_Fixed") + public long dy() { return ndy(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Affine23} instance for the specified memory address. */ + public static FT_Affine23 create(long address) { + return new FT_Affine23(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Affine23 createSafe(long address) { + return address == NULL ? null : new FT_Affine23(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #xx}. */ + public static long nxx(long struct) { return memGetCLong(struct + FT_Affine23.XX); } + /** Unsafe version of {@link #xy}. */ + public static long nxy(long struct) { return memGetCLong(struct + FT_Affine23.XY); } + /** Unsafe version of {@link #dx}. */ + public static long ndx(long struct) { return memGetCLong(struct + FT_Affine23.DX); } + /** Unsafe version of {@link #yx}. */ + public static long nyx(long struct) { return memGetCLong(struct + FT_Affine23.YX); } + /** Unsafe version of {@link #yy}. */ + public static long nyy(long struct) { return memGetCLong(struct + FT_Affine23.YY); } + /** Unsafe version of {@link #dy}. */ + public static long ndy(long struct) { return memGetCLong(struct + FT_Affine23.DY); } + + // ----------------------------------- + + /** An array of {@link FT_Affine23} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_Affine23 ELEMENT_FACTORY = FT_Affine23.create(-1L); + + /** + * Creates a new {@code FT_Affine23.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 {@link FT_Affine23#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Affine23 getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code xx} field. */ + @NativeType("FT_Fixed") + public long xx() { return FT_Affine23.nxx(address()); } + /** @return the value of the {@code xy} field. */ + @NativeType("FT_Fixed") + public long xy() { return FT_Affine23.nxy(address()); } + /** @return the value of the {@code dx} field. */ + @NativeType("FT_Fixed") + public long dx() { return FT_Affine23.ndx(address()); } + /** @return the value of the {@code yx} field. */ + @NativeType("FT_Fixed") + public long yx() { return FT_Affine23.nyx(address()); } + /** @return the value of the {@code yy} field. */ + @NativeType("FT_Fixed") + public long yy() { return FT_Affine23.nyy(address()); } + /** @return the value of the {@code dy} field. */ + @NativeType("FT_Fixed") + public long dy() { return FT_Affine23.ndy(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Alloc_Func.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Alloc_Func.java new file mode 100644 index 00000000..c712461b --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Alloc_Func.java @@ -0,0 +1,74 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * void * (*{@link #invoke}) (
+ *     FT_Memory memory,
+ *     long size
+ * )
+ */ +public abstract class FT_Alloc_Func extends Callback implements FT_Alloc_FuncI { + + /** + * Creates a {@code FT_Alloc_Func} instance from the specified function pointer. + * + * @return the new {@code FT_Alloc_Func} + */ + public static FT_Alloc_Func create(long functionPointer) { + FT_Alloc_FuncI instance = Callback.get(functionPointer); + return instance instanceof FT_Alloc_Func + ? (FT_Alloc_Func)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Alloc_Func createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Alloc_Func} instance that delegates to the specified {@code FT_Alloc_FuncI} instance. */ + public static FT_Alloc_Func create(FT_Alloc_FuncI instance) { + return instance instanceof FT_Alloc_Func + ? (FT_Alloc_Func)instance + : new Container(instance.address(), instance); + } + + protected FT_Alloc_Func() { + super(CIF); + } + + FT_Alloc_Func(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Alloc_Func { + + private final FT_Alloc_FuncI delegate; + + Container(long functionPointer, FT_Alloc_FuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public long invoke(long memory, long size) { + return delegate.invoke(memory, size); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Alloc_FuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Alloc_FuncI.java new file mode 100644 index 00000000..e5dea4c4 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Alloc_FuncI.java @@ -0,0 +1,49 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * void * (*{@link #invoke}) (
+ *     FT_Memory memory,
+ *     long size
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Alloc_Func") +public interface FT_Alloc_FuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_pointer, + ffi_type_pointer, ffi_type_slong + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + long __result = invoke( + memGetAddress(memGetAddress(args)), + memGetCLong(memGetAddress(args + POINTER_SIZE)) + ); + apiClosureRetP(ret, __result); + } + + /** A function used to allocate {@code size} bytes from {@code memory}. */ + @NativeType("void *") long invoke(@NativeType("FT_Memory") long memory, long size); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_BBox.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_BBox.java new file mode 100644 index 00000000..138ccff7 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_BBox.java @@ -0,0 +1,327 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A structure used to hold an outline's bounding box, i.e., the coordinates of its extrema in the horizontal and vertical directions. + * + *

Layout

+ * + *

+ * struct FT_BBox {
+ *     FT_Pos xMin;
+ *     FT_Pos yMin;
+ *     FT_Pos xMax;
+ *     FT_Pos yMax;
+ * }
+ */ +public class FT_BBox extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + XMIN, + YMIN, + XMAX, + YMAX; + + static { + Layout layout = __struct( + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + XMIN = layout.offsetof(0); + YMIN = layout.offsetof(1); + XMAX = layout.offsetof(2); + YMAX = layout.offsetof(3); + } + + protected FT_BBox(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_BBox create(long address, @Nullable ByteBuffer container) { + return new FT_BBox(address, container); + } + + /** + * Creates a {@code FT_BBox} instance at the current position of the specified {@link 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 FT_BBox(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code xMin} field. */ + @NativeType("FT_Pos") + public long xMin() { return nxMin(address()); } + /** @return the value of the {@code yMin} field. */ + @NativeType("FT_Pos") + public long yMin() { return nyMin(address()); } + /** @return the value of the {@code xMax} field. */ + @NativeType("FT_Pos") + public long xMax() { return nxMax(address()); } + /** @return the value of the {@code yMax} field. */ + @NativeType("FT_Pos") + public long yMax() { return nyMax(address()); } + + /** Sets the specified value to the {@code xMin} field. */ + public FT_BBox xMin(@NativeType("FT_Pos") long value) { nxMin(address(), value); return this; } + /** Sets the specified value to the {@code yMin} field. */ + public FT_BBox yMin(@NativeType("FT_Pos") long value) { nyMin(address(), value); return this; } + /** Sets the specified value to the {@code xMax} field. */ + public FT_BBox xMax(@NativeType("FT_Pos") long value) { nxMax(address(), value); return this; } + /** Sets the specified value to the {@code yMax} field. */ + public FT_BBox yMax(@NativeType("FT_Pos") long value) { nyMax(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_BBox set( + long xMin, + long yMin, + long xMax, + long yMax + ) { + xMin(xMin); + yMin(yMin); + xMax(xMax); + yMax(yMax); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_BBox set(FT_BBox src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_BBox} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_BBox malloc() { + return new FT_BBox(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_BBox} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_BBox calloc() { + return new FT_BBox(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_BBox} instance allocated with {@link BufferUtils}. */ + public static FT_BBox create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_BBox(memAddress(container), container); + } + + /** Returns a new {@code FT_BBox} instance for the specified memory address. */ + public static FT_BBox create(long address) { + return new FT_BBox(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_BBox createSafe(long address) { + return address == NULL ? null : new FT_BBox(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_BBox} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_BBox malloc(MemoryStack stack) { + return new FT_BBox(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_BBox} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_BBox calloc(MemoryStack stack) { + return new FT_BBox(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #xMin}. */ + public static long nxMin(long struct) { return memGetCLong(struct + FT_BBox.XMIN); } + /** Unsafe version of {@link #yMin}. */ + public static long nyMin(long struct) { return memGetCLong(struct + FT_BBox.YMIN); } + /** Unsafe version of {@link #xMax}. */ + public static long nxMax(long struct) { return memGetCLong(struct + FT_BBox.XMAX); } + /** Unsafe version of {@link #yMax}. */ + public static long nyMax(long struct) { return memGetCLong(struct + FT_BBox.YMAX); } + + /** Unsafe version of {@link #xMin(long) xMin}. */ + public static void nxMin(long struct, long value) { memPutCLong(struct + FT_BBox.XMIN, value); } + /** Unsafe version of {@link #yMin(long) yMin}. */ + public static void nyMin(long struct, long value) { memPutCLong(struct + FT_BBox.YMIN, value); } + /** Unsafe version of {@link #xMax(long) xMax}. */ + public static void nxMax(long struct, long value) { memPutCLong(struct + FT_BBox.XMAX, value); } + /** Unsafe version of {@link #yMax(long) yMax}. */ + public static void nyMax(long struct, long value) { memPutCLong(struct + FT_BBox.YMAX, value); } + + // ----------------------------------- + + /** An array of {@link FT_BBox} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_BBox ELEMENT_FACTORY = FT_BBox.create(-1L); + + /** + * Creates a new {@code FT_BBox.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 {@link FT_BBox#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_BBox getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code xMin} field. */ + @NativeType("FT_Pos") + public long xMin() { return FT_BBox.nxMin(address()); } + /** @return the value of the {@code yMin} field. */ + @NativeType("FT_Pos") + public long yMin() { return FT_BBox.nyMin(address()); } + /** @return the value of the {@code xMax} field. */ + @NativeType("FT_Pos") + public long xMax() { return FT_BBox.nxMax(address()); } + /** @return the value of the {@code yMax} field. */ + @NativeType("FT_Pos") + public long yMax() { return FT_BBox.nyMax(address()); } + + /** Sets the specified value to the {@code xMin} field. */ + public Buffer xMin(@NativeType("FT_Pos") long value) { FT_BBox.nxMin(address(), value); return this; } + /** Sets the specified value to the {@code yMin} field. */ + public Buffer yMin(@NativeType("FT_Pos") long value) { FT_BBox.nyMin(address(), value); return this; } + /** Sets the specified value to the {@code xMax} field. */ + public Buffer xMax(@NativeType("FT_Pos") long value) { FT_BBox.nxMax(address(), value); return this; } + /** Sets the specified value to the {@code yMax} field. */ + public Buffer yMax(@NativeType("FT_Pos") long value) { FT_BBox.nyMax(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Bitmap.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Bitmap.java new file mode 100644 index 00000000..0f0c365c --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Bitmap.java @@ -0,0 +1,329 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A structure used to describe a bitmap or pixmap to the raster. Note that we now manage pixmaps of various depths through the {@code pixel_mode} field. + * + *

Layout

+ * + *

+ * struct FT_Bitmap {
+ *     unsigned int rows;
+ *     unsigned int width;
+ *     int pitch;
+ *     unsigned char * buffer;
+ *     unsigned short num_grays;
+ *     unsigned char pixel_mode;
+ *     unsigned char palette_mode;
+ *     void * palette;
+ * }
+ */ +public class FT_Bitmap extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + ROWS, + WIDTH, + PITCH, + BUFFER, + NUM_GRAYS, + PIXEL_MODE, + PALETTE_MODE, + PALETTE; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __member(4), + __member(POINTER_SIZE), + __member(2), + __member(1), + __member(1), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + ROWS = layout.offsetof(0); + WIDTH = layout.offsetof(1); + PITCH = layout.offsetof(2); + BUFFER = layout.offsetof(3); + NUM_GRAYS = layout.offsetof(4); + PIXEL_MODE = layout.offsetof(5); + PALETTE_MODE = layout.offsetof(6); + PALETTE = layout.offsetof(7); + } + + protected FT_Bitmap(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Bitmap create(long address, @Nullable ByteBuffer container) { + return new FT_Bitmap(address, container); + } + + /** + * Creates a {@code FT_Bitmap} instance at the current position of the specified {@link 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 FT_Bitmap(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code rows} field. */ + @NativeType("unsigned int") + public int rows() { return nrows(address()); } + /** @return the value of the {@code width} field. */ + @NativeType("unsigned int") + public int width() { return nwidth(address()); } + /** @return the value of the {@code pitch} field. */ + public int pitch() { return npitch(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code buffer} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("unsigned char *") + public ByteBuffer buffer(int capacity) { return nbuffer(address(), capacity); } + /** @return the value of the {@code num_grays} field. */ + @NativeType("unsigned short") + public short num_grays() { return nnum_grays(address()); } + /** @return the value of the {@code pixel_mode} field. */ + @NativeType("unsigned char") + public byte pixel_mode() { return npixel_mode(address()); } + /** @return the value of the {@code palette_mode} field. */ + @NativeType("unsigned char") + public byte palette_mode() { return npalette_mode(address()); } + /** @return the value of the {@code palette} field. */ + @NativeType("void *") + public long palette() { return npalette(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Bitmap} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Bitmap malloc() { + return new FT_Bitmap(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Bitmap} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Bitmap calloc() { + return new FT_Bitmap(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Bitmap} instance allocated with {@link BufferUtils}. */ + public static FT_Bitmap create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Bitmap(memAddress(container), container); + } + + /** Returns a new {@code FT_Bitmap} instance for the specified memory address. */ + public static FT_Bitmap create(long address) { + return new FT_Bitmap(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Bitmap createSafe(long address) { + return address == NULL ? null : new FT_Bitmap(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Bitmap} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Bitmap malloc(MemoryStack stack) { + return new FT_Bitmap(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Bitmap} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Bitmap calloc(MemoryStack stack) { + return new FT_Bitmap(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #rows}. */ + public static int nrows(long struct) { return UNSAFE.getInt(null, struct + FT_Bitmap.ROWS); } + /** Unsafe version of {@link #width}. */ + public static int nwidth(long struct) { return UNSAFE.getInt(null, struct + FT_Bitmap.WIDTH); } + /** Unsafe version of {@link #pitch}. */ + public static int npitch(long struct) { return UNSAFE.getInt(null, struct + FT_Bitmap.PITCH); } + /** Unsafe version of {@link #buffer(int) buffer}. */ + @Nullable public static ByteBuffer nbuffer(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + FT_Bitmap.BUFFER), capacity); } + /** Unsafe version of {@link #num_grays}. */ + public static short nnum_grays(long struct) { return UNSAFE.getShort(null, struct + FT_Bitmap.NUM_GRAYS); } + /** Unsafe version of {@link #pixel_mode}. */ + public static byte npixel_mode(long struct) { return UNSAFE.getByte(null, struct + FT_Bitmap.PIXEL_MODE); } + /** Unsafe version of {@link #palette_mode}. */ + public static byte npalette_mode(long struct) { return UNSAFE.getByte(null, struct + FT_Bitmap.PALETTE_MODE); } + /** Unsafe version of {@link #palette}. */ + public static long npalette(long struct) { return memGetAddress(struct + FT_Bitmap.PALETTE); } + + // ----------------------------------- + + /** An array of {@link FT_Bitmap} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Bitmap ELEMENT_FACTORY = FT_Bitmap.create(-1L); + + /** + * Creates a new {@code FT_Bitmap.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 {@link FT_Bitmap#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Bitmap getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code rows} field. */ + @NativeType("unsigned int") + public int rows() { return FT_Bitmap.nrows(address()); } + /** @return the value of the {@code width} field. */ + @NativeType("unsigned int") + public int width() { return FT_Bitmap.nwidth(address()); } + /** @return the value of the {@code pitch} field. */ + public int pitch() { return FT_Bitmap.npitch(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code buffer} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("unsigned char *") + public ByteBuffer buffer(int capacity) { return FT_Bitmap.nbuffer(address(), capacity); } + /** @return the value of the {@code num_grays} field. */ + @NativeType("unsigned short") + public short num_grays() { return FT_Bitmap.nnum_grays(address()); } + /** @return the value of the {@code pixel_mode} field. */ + @NativeType("unsigned char") + public byte pixel_mode() { return FT_Bitmap.npixel_mode(address()); } + /** @return the value of the {@code palette_mode} field. */ + @NativeType("unsigned char") + public byte palette_mode() { return FT_Bitmap.npalette_mode(address()); } + /** @return the value of the {@code palette} field. */ + @NativeType("void *") + public long palette() { return FT_Bitmap.npalette(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_BitmapGlyph.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_BitmapGlyph.java new file mode 100644 index 00000000..0fc8efe5 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_BitmapGlyph.java @@ -0,0 +1,188 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure used for bitmap glyph images. This really is a 'sub-class' of {@link FT_Glyph}. + * + *

Layout

+ * + *

+ * struct FT_BitmapGlyphRec {
+ *     {@link FT_Glyph FT_GlyphRec} root;
+ *     FT_Int left;
+ *     FT_Int top;
+ *     {@link FT_Bitmap FT_Bitmap} bitmap;
+ * }
+ */ +@NativeType("struct FT_BitmapGlyphRec") +public class FT_BitmapGlyph extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + ROOT, + LEFT, + TOP, + BITMAP; + + static { + Layout layout = __struct( + __member(FT_Glyph.SIZEOF, FT_Glyph.ALIGNOF), + __member(4), + __member(4), + __member(FT_Bitmap.SIZEOF, FT_Bitmap.ALIGNOF) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + ROOT = layout.offsetof(0); + LEFT = layout.offsetof(1); + TOP = layout.offsetof(2); + BITMAP = layout.offsetof(3); + } + + protected FT_BitmapGlyph(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_BitmapGlyph create(long address, @Nullable ByteBuffer container) { + return new FT_BitmapGlyph(address, container); + } + + /** + * Creates a {@code FT_BitmapGlyph} instance at the current position of the specified {@link 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 FT_BitmapGlyph(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_Glyph} view of the {@code root} field. */ + @NativeType("FT_GlyphRec") + public FT_Glyph root() { return nroot(address()); } + /** @return the value of the {@code left} field. */ + @NativeType("FT_Int") + public int left() { return nleft(address()); } + /** @return the value of the {@code top} field. */ + @NativeType("FT_Int") + public int top() { return ntop(address()); } + /** @return a {@link FT_Bitmap} view of the {@code bitmap} field. */ + public FT_Bitmap bitmap() { return nbitmap(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_BitmapGlyph} instance for the specified memory address. */ + public static FT_BitmapGlyph create(long address) { + return new FT_BitmapGlyph(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_BitmapGlyph createSafe(long address) { + return address == NULL ? null : new FT_BitmapGlyph(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #root}. */ + public static FT_Glyph nroot(long struct) { return FT_Glyph.create(struct + FT_BitmapGlyph.ROOT); } + /** Unsafe version of {@link #left}. */ + public static int nleft(long struct) { return UNSAFE.getInt(null, struct + FT_BitmapGlyph.LEFT); } + /** Unsafe version of {@link #top}. */ + public static int ntop(long struct) { return UNSAFE.getInt(null, struct + FT_BitmapGlyph.TOP); } + /** Unsafe version of {@link #bitmap}. */ + public static FT_Bitmap nbitmap(long struct) { return FT_Bitmap.create(struct + FT_BitmapGlyph.BITMAP); } + + // ----------------------------------- + + /** An array of {@link FT_BitmapGlyph} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_BitmapGlyph ELEMENT_FACTORY = FT_BitmapGlyph.create(-1L); + + /** + * Creates a new {@code FT_BitmapGlyph.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 {@link FT_BitmapGlyph#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_BitmapGlyph getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_Glyph} view of the {@code root} field. */ + @NativeType("FT_GlyphRec") + public FT_Glyph root() { return FT_BitmapGlyph.nroot(address()); } + /** @return the value of the {@code left} field. */ + @NativeType("FT_Int") + public int left() { return FT_BitmapGlyph.nleft(address()); } + /** @return the value of the {@code top} field. */ + @NativeType("FT_Int") + public int top() { return FT_BitmapGlyph.ntop(address()); } + /** @return a {@link FT_Bitmap} view of the {@code bitmap} field. */ + public FT_Bitmap bitmap() { return FT_BitmapGlyph.nbitmap(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Bitmap_Size.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Bitmap_Size.java new file mode 100644 index 00000000..ca0a5f08 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Bitmap_Size.java @@ -0,0 +1,212 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * This structure models the metrics of a bitmap strike (i.e., a set of glyphs for a given point size and resolution) in a bitmap font. It + * is used for the {@code available_sizes} field of {@code FT_Face}. + * + *
Note
+ * + *

Windows FNT: The nominal size given in a FNT font is not reliable. If the driver finds it incorrect, it sets {@code size} to some calculated + * values, and {@code x_ppem} and {@code y_ppem} to the pixel width and height given in the font, respectively.

+ * + *
Note
+ * + *

TrueType embedded bitmaps: {@code size}, {@code width}, and {@code height} values are not contained in the bitmap strike itself. They are + * computed from the global font parameters.

+ * + *

Layout

+ * + *

+ * struct FT_Bitmap_Size {
+ *     FT_Short {@link #height};
+ *     FT_Short {@link #width};
+ *     FT_Pos {@link #size};
+ *     FT_Pos {@link #x_ppem};
+ *     FT_Pos {@link #y_ppem};
+ * }
+ */ +public class FT_Bitmap_Size extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + HEIGHT, + WIDTH, + SIZE, + X_PPEM, + Y_PPEM; + + static { + Layout layout = __struct( + __member(2), + __member(2), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + HEIGHT = layout.offsetof(0); + WIDTH = layout.offsetof(1); + SIZE = layout.offsetof(2); + X_PPEM = layout.offsetof(3); + Y_PPEM = layout.offsetof(4); + } + + protected FT_Bitmap_Size(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Bitmap_Size create(long address, @Nullable ByteBuffer container) { + return new FT_Bitmap_Size(address, container); + } + + /** + * Creates a {@code FT_Bitmap_Size} instance at the current position of the specified {@link 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 FT_Bitmap_Size(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** the vertical distance, in pixels, between two consecutive baselines. It is always positive. */ + @NativeType("FT_Short") + public short height() { return nheight(address()); } + /** the average width, in pixels, of all glyphs in the strike */ + @NativeType("FT_Short") + public short width() { return nwidth(address()); } + /** the nominal size of the strike in 26.6 fractional points. This field is not very useful. */ + @NativeType("FT_Pos") + public long size() { return nsize(address()); } + /** the horizontal ppem (nominal width) in 26.6 fractional pixels */ + @NativeType("FT_Pos") + public long x_ppem() { return nx_ppem(address()); } + /** the vertical ppem (nominal height) in 26.6 fractional pixels */ + @NativeType("FT_Pos") + public long y_ppem() { return ny_ppem(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Bitmap_Size} instance for the specified memory address. */ + public static FT_Bitmap_Size create(long address) { + return new FT_Bitmap_Size(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Bitmap_Size createSafe(long address) { + return address == NULL ? null : new FT_Bitmap_Size(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #height}. */ + public static short nheight(long struct) { return UNSAFE.getShort(null, struct + FT_Bitmap_Size.HEIGHT); } + /** Unsafe version of {@link #width}. */ + public static short nwidth(long struct) { return UNSAFE.getShort(null, struct + FT_Bitmap_Size.WIDTH); } + /** Unsafe version of {@link #size}. */ + public static long nsize(long struct) { return memGetCLong(struct + FT_Bitmap_Size.SIZE); } + /** Unsafe version of {@link #x_ppem}. */ + public static long nx_ppem(long struct) { return memGetCLong(struct + FT_Bitmap_Size.X_PPEM); } + /** Unsafe version of {@link #y_ppem}. */ + public static long ny_ppem(long struct) { return memGetCLong(struct + FT_Bitmap_Size.Y_PPEM); } + + // ----------------------------------- + + /** An array of {@link FT_Bitmap_Size} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_Bitmap_Size ELEMENT_FACTORY = FT_Bitmap_Size.create(-1L); + + /** + * Creates a new {@code FT_Bitmap_Size.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 {@link FT_Bitmap_Size#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Bitmap_Size getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@link FT_Bitmap_Size#height} field. */ + @NativeType("FT_Short") + public short height() { return FT_Bitmap_Size.nheight(address()); } + /** @return the value of the {@link FT_Bitmap_Size#width} field. */ + @NativeType("FT_Short") + public short width() { return FT_Bitmap_Size.nwidth(address()); } + /** @return the value of the {@link FT_Bitmap_Size#size} field. */ + @NativeType("FT_Pos") + public long size() { return FT_Bitmap_Size.nsize(address()); } + /** @return the value of the {@link FT_Bitmap_Size#x_ppem} field. */ + @NativeType("FT_Pos") + public long x_ppem() { return FT_Bitmap_Size.nx_ppem(address()); } + /** @return the value of the {@link FT_Bitmap_Size#y_ppem} field. */ + @NativeType("FT_Pos") + public long y_ppem() { return FT_Bitmap_Size.ny_ppem(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_COLR_Paint.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_COLR_Paint.java new file mode 100644 index 00000000..97fca11b --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_COLR_Paint.java @@ -0,0 +1,373 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A union object representing format and details of a paint table of a {@code COLR} v1 font. + * + *

Layout

+ * + *

+ * struct FT_COLR_Paint {
+ *     FT_PaintFormat format;
+ *     union {
+ *         {@link FT_PaintColrLayers FT_PaintColrLayers} colr_layers;
+ *         {@link FT_PaintGlyph FT_PaintGlyph} glyph;
+ *         {@link FT_PaintSolid FT_PaintSolid} solid;
+ *         {@link FT_PaintLinearGradient FT_PaintLinearGradient} linear_gradient;
+ *         {@link FT_PaintRadialGradient FT_PaintRadialGradient} radial_gradient;
+ *         {@link FT_PaintSweepGradient FT_PaintSweepGradient} sweep_gradient;
+ *         {@link FT_PaintTransform FT_PaintTransform} transform;
+ *         {@link FT_PaintTranslate FT_PaintTranslate} translate;
+ *         {@link FT_PaintScale FT_PaintScale} scale;
+ *         {@link FT_PaintRotate FT_PaintRotate} rotate;
+ *         {@link FT_PaintSkew FT_PaintSkew} skew;
+ *         {@link FT_PaintComposite FT_PaintComposite} composite;
+ *         {@link FT_PaintColrGlyph FT_PaintColrGlyph} colr_glyph;
+ *     } u;
+ * }
+ */ +public class FT_COLR_Paint extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + FORMAT, + U, + U_COLR_LAYERS, + U_GLYPH, + U_SOLID, + U_LINEAR_GRADIENT, + U_RADIAL_GRADIENT, + U_SWEEP_GRADIENT, + U_TRANSFORM, + U_TRANSLATE, + U_SCALE, + U_ROTATE, + U_SKEW, + U_COMPOSITE, + U_COLR_GLYPH; + + static { + Layout layout = __struct( + __member(4), + __union( + __member(FT_PaintColrLayers.SIZEOF, FT_PaintColrLayers.ALIGNOF), + __member(FT_PaintGlyph.SIZEOF, FT_PaintGlyph.ALIGNOF), + __member(FT_PaintSolid.SIZEOF, FT_PaintSolid.ALIGNOF), + __member(FT_PaintLinearGradient.SIZEOF, FT_PaintLinearGradient.ALIGNOF), + __member(FT_PaintRadialGradient.SIZEOF, FT_PaintRadialGradient.ALIGNOF), + __member(FT_PaintSweepGradient.SIZEOF, FT_PaintSweepGradient.ALIGNOF), + __member(FT_PaintTransform.SIZEOF, FT_PaintTransform.ALIGNOF), + __member(FT_PaintTranslate.SIZEOF, FT_PaintTranslate.ALIGNOF), + __member(FT_PaintScale.SIZEOF, FT_PaintScale.ALIGNOF), + __member(FT_PaintRotate.SIZEOF, FT_PaintRotate.ALIGNOF), + __member(FT_PaintSkew.SIZEOF, FT_PaintSkew.ALIGNOF), + __member(FT_PaintComposite.SIZEOF, FT_PaintComposite.ALIGNOF), + __member(FT_PaintColrGlyph.SIZEOF, FT_PaintColrGlyph.ALIGNOF) + ) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + FORMAT = layout.offsetof(0); + U = layout.offsetof(1); + U_COLR_LAYERS = layout.offsetof(2); + U_GLYPH = layout.offsetof(3); + U_SOLID = layout.offsetof(4); + U_LINEAR_GRADIENT = layout.offsetof(5); + U_RADIAL_GRADIENT = layout.offsetof(6); + U_SWEEP_GRADIENT = layout.offsetof(7); + U_TRANSFORM = layout.offsetof(8); + U_TRANSLATE = layout.offsetof(9); + U_SCALE = layout.offsetof(10); + U_ROTATE = layout.offsetof(11); + U_SKEW = layout.offsetof(12); + U_COMPOSITE = layout.offsetof(13); + U_COLR_GLYPH = layout.offsetof(14); + } + + protected FT_COLR_Paint(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_COLR_Paint create(long address, @Nullable ByteBuffer container) { + return new FT_COLR_Paint(address, container); + } + + /** + * Creates a {@code FT_COLR_Paint} instance at the current position of the specified {@link 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 FT_COLR_Paint(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code format} field. */ + @NativeType("FT_PaintFormat") + public int format() { return nformat(address()); } + /** @return a {@link FT_PaintColrLayers} view of the {@code u.colr_layers} field. */ + public FT_PaintColrLayers u_colr_layers() { return nu_colr_layers(address()); } + /** @return a {@link FT_PaintGlyph} view of the {@code u.glyph} field. */ + public FT_PaintGlyph u_glyph() { return nu_glyph(address()); } + /** @return a {@link FT_PaintSolid} view of the {@code u.solid} field. */ + public FT_PaintSolid u_solid() { return nu_solid(address()); } + /** @return a {@link FT_PaintLinearGradient} view of the {@code u.linear_gradient} field. */ + public FT_PaintLinearGradient u_linear_gradient() { return nu_linear_gradient(address()); } + /** @return a {@link FT_PaintRadialGradient} view of the {@code u.radial_gradient} field. */ + public FT_PaintRadialGradient u_radial_gradient() { return nu_radial_gradient(address()); } + /** @return a {@link FT_PaintSweepGradient} view of the {@code u.sweep_gradient} field. */ + public FT_PaintSweepGradient u_sweep_gradient() { return nu_sweep_gradient(address()); } + /** @return a {@link FT_PaintTransform} view of the {@code u.transform} field. */ + public FT_PaintTransform u_transform() { return nu_transform(address()); } + /** @return a {@link FT_PaintTranslate} view of the {@code u.translate} field. */ + public FT_PaintTranslate u_translate() { return nu_translate(address()); } + /** @return a {@link FT_PaintScale} view of the {@code u.scale} field. */ + public FT_PaintScale u_scale() { return nu_scale(address()); } + /** @return a {@link FT_PaintRotate} view of the {@code u.rotate} field. */ + public FT_PaintRotate u_rotate() { return nu_rotate(address()); } + /** @return a {@link FT_PaintSkew} view of the {@code u.skew} field. */ + public FT_PaintSkew u_skew() { return nu_skew(address()); } + /** @return a {@link FT_PaintComposite} view of the {@code u.composite} field. */ + public FT_PaintComposite u_composite() { return nu_composite(address()); } + /** @return a {@link FT_PaintColrGlyph} view of the {@code u.colr_glyph} field. */ + public FT_PaintColrGlyph u_colr_glyph() { return nu_colr_glyph(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_COLR_Paint} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_COLR_Paint malloc() { + return new FT_COLR_Paint(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_COLR_Paint} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_COLR_Paint calloc() { + return new FT_COLR_Paint(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_COLR_Paint} instance allocated with {@link BufferUtils}. */ + public static FT_COLR_Paint create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_COLR_Paint(memAddress(container), container); + } + + /** Returns a new {@code FT_COLR_Paint} instance for the specified memory address. */ + public static FT_COLR_Paint create(long address) { + return new FT_COLR_Paint(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_COLR_Paint createSafe(long address) { + return address == NULL ? null : new FT_COLR_Paint(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_COLR_Paint} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_COLR_Paint malloc(MemoryStack stack) { + return new FT_COLR_Paint(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_COLR_Paint} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_COLR_Paint calloc(MemoryStack stack) { + return new FT_COLR_Paint(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #format}. */ + public static int nformat(long struct) { return UNSAFE.getInt(null, struct + FT_COLR_Paint.FORMAT); } + /** Unsafe version of {@link #u_colr_layers}. */ + public static FT_PaintColrLayers nu_colr_layers(long struct) { return FT_PaintColrLayers.create(struct + FT_COLR_Paint.U_COLR_LAYERS); } + /** Unsafe version of {@link #u_glyph}. */ + public static FT_PaintGlyph nu_glyph(long struct) { return FT_PaintGlyph.create(struct + FT_COLR_Paint.U_GLYPH); } + /** Unsafe version of {@link #u_solid}. */ + public static FT_PaintSolid nu_solid(long struct) { return FT_PaintSolid.create(struct + FT_COLR_Paint.U_SOLID); } + /** Unsafe version of {@link #u_linear_gradient}. */ + public static FT_PaintLinearGradient nu_linear_gradient(long struct) { return FT_PaintLinearGradient.create(struct + FT_COLR_Paint.U_LINEAR_GRADIENT); } + /** Unsafe version of {@link #u_radial_gradient}. */ + public static FT_PaintRadialGradient nu_radial_gradient(long struct) { return FT_PaintRadialGradient.create(struct + FT_COLR_Paint.U_RADIAL_GRADIENT); } + /** Unsafe version of {@link #u_sweep_gradient}. */ + public static FT_PaintSweepGradient nu_sweep_gradient(long struct) { return FT_PaintSweepGradient.create(struct + FT_COLR_Paint.U_SWEEP_GRADIENT); } + /** Unsafe version of {@link #u_transform}. */ + public static FT_PaintTransform nu_transform(long struct) { return FT_PaintTransform.create(struct + FT_COLR_Paint.U_TRANSFORM); } + /** Unsafe version of {@link #u_translate}. */ + public static FT_PaintTranslate nu_translate(long struct) { return FT_PaintTranslate.create(struct + FT_COLR_Paint.U_TRANSLATE); } + /** Unsafe version of {@link #u_scale}. */ + public static FT_PaintScale nu_scale(long struct) { return FT_PaintScale.create(struct + FT_COLR_Paint.U_SCALE); } + /** Unsafe version of {@link #u_rotate}. */ + public static FT_PaintRotate nu_rotate(long struct) { return FT_PaintRotate.create(struct + FT_COLR_Paint.U_ROTATE); } + /** Unsafe version of {@link #u_skew}. */ + public static FT_PaintSkew nu_skew(long struct) { return FT_PaintSkew.create(struct + FT_COLR_Paint.U_SKEW); } + /** Unsafe version of {@link #u_composite}. */ + public static FT_PaintComposite nu_composite(long struct) { return FT_PaintComposite.create(struct + FT_COLR_Paint.U_COMPOSITE); } + /** Unsafe version of {@link #u_colr_glyph}. */ + public static FT_PaintColrGlyph nu_colr_glyph(long struct) { return FT_PaintColrGlyph.create(struct + FT_COLR_Paint.U_COLR_GLYPH); } + + // ----------------------------------- + + /** An array of {@link FT_COLR_Paint} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_COLR_Paint ELEMENT_FACTORY = FT_COLR_Paint.create(-1L); + + /** + * Creates a new {@code FT_COLR_Paint.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 {@link FT_COLR_Paint#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_COLR_Paint getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code format} field. */ + @NativeType("FT_PaintFormat") + public int format() { return FT_COLR_Paint.nformat(address()); } + /** @return a {@link FT_PaintColrLayers} view of the {@code u.colr_layers} field. */ + public FT_PaintColrLayers u_colr_layers() { return FT_COLR_Paint.nu_colr_layers(address()); } + /** @return a {@link FT_PaintGlyph} view of the {@code u.glyph} field. */ + public FT_PaintGlyph u_glyph() { return FT_COLR_Paint.nu_glyph(address()); } + /** @return a {@link FT_PaintSolid} view of the {@code u.solid} field. */ + public FT_PaintSolid u_solid() { return FT_COLR_Paint.nu_solid(address()); } + /** @return a {@link FT_PaintLinearGradient} view of the {@code u.linear_gradient} field. */ + public FT_PaintLinearGradient u_linear_gradient() { return FT_COLR_Paint.nu_linear_gradient(address()); } + /** @return a {@link FT_PaintRadialGradient} view of the {@code u.radial_gradient} field. */ + public FT_PaintRadialGradient u_radial_gradient() { return FT_COLR_Paint.nu_radial_gradient(address()); } + /** @return a {@link FT_PaintSweepGradient} view of the {@code u.sweep_gradient} field. */ + public FT_PaintSweepGradient u_sweep_gradient() { return FT_COLR_Paint.nu_sweep_gradient(address()); } + /** @return a {@link FT_PaintTransform} view of the {@code u.transform} field. */ + public FT_PaintTransform u_transform() { return FT_COLR_Paint.nu_transform(address()); } + /** @return a {@link FT_PaintTranslate} view of the {@code u.translate} field. */ + public FT_PaintTranslate u_translate() { return FT_COLR_Paint.nu_translate(address()); } + /** @return a {@link FT_PaintScale} view of the {@code u.scale} field. */ + public FT_PaintScale u_scale() { return FT_COLR_Paint.nu_scale(address()); } + /** @return a {@link FT_PaintRotate} view of the {@code u.rotate} field. */ + public FT_PaintRotate u_rotate() { return FT_COLR_Paint.nu_rotate(address()); } + /** @return a {@link FT_PaintSkew} view of the {@code u.skew} field. */ + public FT_PaintSkew u_skew() { return FT_COLR_Paint.nu_skew(address()); } + /** @return a {@link FT_PaintComposite} view of the {@code u.composite} field. */ + public FT_PaintComposite u_composite() { return FT_COLR_Paint.nu_composite(address()); } + /** @return a {@link FT_PaintColrGlyph} view of the {@code u.colr_glyph} field. */ + public FT_PaintColrGlyph u_colr_glyph() { return FT_COLR_Paint.nu_colr_glyph(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_CharMap.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_CharMap.java new file mode 100644 index 00000000..f6d543a3 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_CharMap.java @@ -0,0 +1,191 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The base charmap structure. + * + *

Layout

+ * + *

+ * struct FT_CharMapRec {
+ *     {@link FT_Face FT_Face} {@link #face};
+ *     FT_Encoding {@link #encoding};
+ *     FT_UShort {@link #platform_id};
+ *     FT_UShort {@link #encoding_id};
+ * }
+ */ +@NativeType("struct FT_CharMapRec") +public class FT_CharMap extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + FACE, + ENCODING, + PLATFORM_ID, + ENCODING_ID; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(4), + __member(2), + __member(2) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + FACE = layout.offsetof(0); + ENCODING = layout.offsetof(1); + PLATFORM_ID = layout.offsetof(2); + ENCODING_ID = layout.offsetof(3); + } + + protected FT_CharMap(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_CharMap create(long address, @Nullable ByteBuffer container) { + return new FT_CharMap(address, container); + } + + /** + * Creates a {@code FT_CharMap} instance at the current position of the specified {@link 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 FT_CharMap(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** a handle to the parent face object */ + public FT_Face face() { return nface(address()); } + /** an {@code FT_Encoding} tag identifying the charmap. Use this with {@link FreeType#FT_Select_Charmap Select_Charmap}. */ + @NativeType("FT_Encoding") + public int encoding() { return nencoding(address()); } + /** + * an ID number describing the platform for the following encoding ID. This comes directly from the TrueType specification and gets emulated for other + * formats. + */ + @NativeType("FT_UShort") + public short platform_id() { return nplatform_id(address()); } + /** a platform-specific encoding number. This also comes from the TrueType specification and gets emulated similarly. */ + @NativeType("FT_UShort") + public short encoding_id() { return nencoding_id(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_CharMap} instance for the specified memory address. */ + public static FT_CharMap create(long address) { + return new FT_CharMap(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_CharMap createSafe(long address) { + return address == NULL ? null : new FT_CharMap(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #face}. */ + public static FT_Face nface(long struct) { return FT_Face.create(memGetAddress(struct + FT_CharMap.FACE)); } + /** Unsafe version of {@link #encoding}. */ + public static int nencoding(long struct) { return UNSAFE.getInt(null, struct + FT_CharMap.ENCODING); } + /** Unsafe version of {@link #platform_id}. */ + public static short nplatform_id(long struct) { return UNSAFE.getShort(null, struct + FT_CharMap.PLATFORM_ID); } + /** Unsafe version of {@link #encoding_id}. */ + public static short nencoding_id(long struct) { return UNSAFE.getShort(null, struct + FT_CharMap.ENCODING_ID); } + + // ----------------------------------- + + /** An array of {@link FT_CharMap} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_CharMap ELEMENT_FACTORY = FT_CharMap.create(-1L); + + /** + * Creates a new {@code FT_CharMap.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 {@link FT_CharMap#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_CharMap getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_Face} view of the struct pointed to by the {@link FT_CharMap#face} field. */ + public FT_Face face() { return FT_CharMap.nface(address()); } + /** @return the value of the {@link FT_CharMap#encoding} field. */ + @NativeType("FT_Encoding") + public int encoding() { return FT_CharMap.nencoding(address()); } + /** @return the value of the {@link FT_CharMap#platform_id} field. */ + @NativeType("FT_UShort") + public short platform_id() { return FT_CharMap.nplatform_id(address()); } + /** @return the value of the {@link FT_CharMap#encoding_id} field. */ + @NativeType("FT_UShort") + public short encoding_id() { return FT_CharMap.nencoding_id(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ClipBox.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ClipBox.java new file mode 100644 index 00000000..c1411a9a --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ClipBox.java @@ -0,0 +1,265 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A structure representing a {@code COLR} v1 {@code ClipBox} table. + * + *

Layout

+ * + *

+ * struct FT_ClipBox {
+ *     {@link FT_Vector FT_Vector} bottom_left;
+ *     {@link FT_Vector FT_Vector} top_left;
+ *     {@link FT_Vector FT_Vector} top_right;
+ *     {@link FT_Vector FT_Vector} bottom_right;
+ * }
+ */ +public class FT_ClipBox extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + BOTTOM_LEFT, + TOP_LEFT, + TOP_RIGHT, + BOTTOM_RIGHT; + + static { + Layout layout = __struct( + __member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF), + __member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF), + __member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF), + __member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + BOTTOM_LEFT = layout.offsetof(0); + TOP_LEFT = layout.offsetof(1); + TOP_RIGHT = layout.offsetof(2); + BOTTOM_RIGHT = layout.offsetof(3); + } + + protected FT_ClipBox(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_ClipBox create(long address, @Nullable ByteBuffer container) { + return new FT_ClipBox(address, container); + } + + /** + * Creates a {@code FT_ClipBox} instance at the current position of the specified {@link 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 FT_ClipBox(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_Vector} view of the {@code bottom_left} field. */ + public FT_Vector bottom_left() { return nbottom_left(address()); } + /** @return a {@link FT_Vector} view of the {@code top_left} field. */ + public FT_Vector top_left() { return ntop_left(address()); } + /** @return a {@link FT_Vector} view of the {@code top_right} field. */ + public FT_Vector top_right() { return ntop_right(address()); } + /** @return a {@link FT_Vector} view of the {@code bottom_right} field. */ + public FT_Vector bottom_right() { return nbottom_right(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_ClipBox} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_ClipBox malloc() { + return new FT_ClipBox(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_ClipBox} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_ClipBox calloc() { + return new FT_ClipBox(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_ClipBox} instance allocated with {@link BufferUtils}. */ + public static FT_ClipBox create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_ClipBox(memAddress(container), container); + } + + /** Returns a new {@code FT_ClipBox} instance for the specified memory address. */ + public static FT_ClipBox create(long address) { + return new FT_ClipBox(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_ClipBox createSafe(long address) { + return address == NULL ? null : new FT_ClipBox(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_ClipBox} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_ClipBox malloc(MemoryStack stack) { + return new FT_ClipBox(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_ClipBox} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_ClipBox calloc(MemoryStack stack) { + return new FT_ClipBox(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #bottom_left}. */ + public static FT_Vector nbottom_left(long struct) { return FT_Vector.create(struct + FT_ClipBox.BOTTOM_LEFT); } + /** Unsafe version of {@link #top_left}. */ + public static FT_Vector ntop_left(long struct) { return FT_Vector.create(struct + FT_ClipBox.TOP_LEFT); } + /** Unsafe version of {@link #top_right}. */ + public static FT_Vector ntop_right(long struct) { return FT_Vector.create(struct + FT_ClipBox.TOP_RIGHT); } + /** Unsafe version of {@link #bottom_right}. */ + public static FT_Vector nbottom_right(long struct) { return FT_Vector.create(struct + FT_ClipBox.BOTTOM_RIGHT); } + + // ----------------------------------- + + /** An array of {@link FT_ClipBox} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_ClipBox ELEMENT_FACTORY = FT_ClipBox.create(-1L); + + /** + * Creates a new {@code FT_ClipBox.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 {@link FT_ClipBox#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_ClipBox getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_Vector} view of the {@code bottom_left} field. */ + public FT_Vector bottom_left() { return FT_ClipBox.nbottom_left(address()); } + /** @return a {@link FT_Vector} view of the {@code top_left} field. */ + public FT_Vector top_left() { return FT_ClipBox.ntop_left(address()); } + /** @return a {@link FT_Vector} view of the {@code top_right} field. */ + public FT_Vector top_right() { return FT_ClipBox.ntop_right(address()); } + /** @return a {@link FT_Vector} view of the {@code bottom_right} field. */ + public FT_Vector bottom_right() { return FT_ClipBox.nbottom_right(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Color.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Color.java new file mode 100644 index 00000000..50a33d60 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Color.java @@ -0,0 +1,327 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * This structure models a BGRA color value of a {@code CPAL} palette entry. + * + *

Layout

+ * + *

+ * struct FT_Color {
+ *     FT_Byte blue;
+ *     FT_Byte green;
+ *     FT_Byte red;
+ *     FT_Byte alpha;
+ * }
+ */ +public class FT_Color extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + BLUE, + GREEN, + RED, + ALPHA; + + static { + Layout layout = __struct( + __member(1), + __member(1), + __member(1), + __member(1) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + BLUE = layout.offsetof(0); + GREEN = layout.offsetof(1); + RED = layout.offsetof(2); + ALPHA = layout.offsetof(3); + } + + protected FT_Color(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Color create(long address, @Nullable ByteBuffer container) { + return new FT_Color(address, container); + } + + /** + * Creates a {@code FT_Color} instance at the current position of the specified {@link 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 FT_Color(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code blue} field. */ + @NativeType("FT_Byte") + public byte blue() { return nblue(address()); } + /** @return the value of the {@code green} field. */ + @NativeType("FT_Byte") + public byte green() { return ngreen(address()); } + /** @return the value of the {@code red} field. */ + @NativeType("FT_Byte") + public byte red() { return nred(address()); } + /** @return the value of the {@code alpha} field. */ + @NativeType("FT_Byte") + public byte alpha() { return nalpha(address()); } + + /** Sets the specified value to the {@code blue} field. */ + public FT_Color blue(@NativeType("FT_Byte") byte value) { nblue(address(), value); return this; } + /** Sets the specified value to the {@code green} field. */ + public FT_Color green(@NativeType("FT_Byte") byte value) { ngreen(address(), value); return this; } + /** Sets the specified value to the {@code red} field. */ + public FT_Color red(@NativeType("FT_Byte") byte value) { nred(address(), value); return this; } + /** Sets the specified value to the {@code alpha} field. */ + public FT_Color alpha(@NativeType("FT_Byte") byte value) { nalpha(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_Color set( + byte blue, + byte green, + byte red, + byte alpha + ) { + blue(blue); + green(green); + red(red); + alpha(alpha); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Color set(FT_Color src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Color} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Color malloc() { + return new FT_Color(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Color} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Color calloc() { + return new FT_Color(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Color} instance allocated with {@link BufferUtils}. */ + public static FT_Color create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Color(memAddress(container), container); + } + + /** Returns a new {@code FT_Color} instance for the specified memory address. */ + public static FT_Color create(long address) { + return new FT_Color(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Color createSafe(long address) { + return address == NULL ? null : new FT_Color(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Color} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Color malloc(MemoryStack stack) { + return new FT_Color(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Color} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Color calloc(MemoryStack stack) { + return new FT_Color(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #blue}. */ + public static byte nblue(long struct) { return UNSAFE.getByte(null, struct + FT_Color.BLUE); } + /** Unsafe version of {@link #green}. */ + public static byte ngreen(long struct) { return UNSAFE.getByte(null, struct + FT_Color.GREEN); } + /** Unsafe version of {@link #red}. */ + public static byte nred(long struct) { return UNSAFE.getByte(null, struct + FT_Color.RED); } + /** Unsafe version of {@link #alpha}. */ + public static byte nalpha(long struct) { return UNSAFE.getByte(null, struct + FT_Color.ALPHA); } + + /** Unsafe version of {@link #blue(byte) blue}. */ + public static void nblue(long struct, byte value) { UNSAFE.putByte(null, struct + FT_Color.BLUE, value); } + /** Unsafe version of {@link #green(byte) green}. */ + public static void ngreen(long struct, byte value) { UNSAFE.putByte(null, struct + FT_Color.GREEN, value); } + /** Unsafe version of {@link #red(byte) red}. */ + public static void nred(long struct, byte value) { UNSAFE.putByte(null, struct + FT_Color.RED, value); } + /** Unsafe version of {@link #alpha(byte) alpha}. */ + public static void nalpha(long struct, byte value) { UNSAFE.putByte(null, struct + FT_Color.ALPHA, value); } + + // ----------------------------------- + + /** An array of {@link FT_Color} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Color ELEMENT_FACTORY = FT_Color.create(-1L); + + /** + * Creates a new {@code FT_Color.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 {@link FT_Color#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Color getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code blue} field. */ + @NativeType("FT_Byte") + public byte blue() { return FT_Color.nblue(address()); } + /** @return the value of the {@code green} field. */ + @NativeType("FT_Byte") + public byte green() { return FT_Color.ngreen(address()); } + /** @return the value of the {@code red} field. */ + @NativeType("FT_Byte") + public byte red() { return FT_Color.nred(address()); } + /** @return the value of the {@code alpha} field. */ + @NativeType("FT_Byte") + public byte alpha() { return FT_Color.nalpha(address()); } + + /** Sets the specified value to the {@code blue} field. */ + public Buffer blue(@NativeType("FT_Byte") byte value) { FT_Color.nblue(address(), value); return this; } + /** Sets the specified value to the {@code green} field. */ + public Buffer green(@NativeType("FT_Byte") byte value) { FT_Color.ngreen(address(), value); return this; } + /** Sets the specified value to the {@code red} field. */ + public Buffer red(@NativeType("FT_Byte") byte value) { FT_Color.nred(address(), value); return this; } + /** Sets the specified value to the {@code alpha} field. */ + public Buffer alpha(@NativeType("FT_Byte") byte value) { FT_Color.nalpha(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorIndex.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorIndex.java new file mode 100644 index 00000000..48c23923 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorIndex.java @@ -0,0 +1,165 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure representing a {@code ColorIndex} value of the {@code COLR} v1 extensions. + * + *

Layout

+ * + *

+ * struct FT_ColorIndex {
+ *     FT_UInt16 palette_index;
+ *     FT_F2Dot14 alpha;
+ * }
+ */ +public class FT_ColorIndex extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + PALETTE_INDEX, + ALPHA; + + static { + Layout layout = __struct( + __member(2), + __member(2) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + PALETTE_INDEX = layout.offsetof(0); + ALPHA = layout.offsetof(1); + } + + protected FT_ColorIndex(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_ColorIndex create(long address, @Nullable ByteBuffer container) { + return new FT_ColorIndex(address, container); + } + + /** + * Creates a {@code FT_ColorIndex} instance at the current position of the specified {@link 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 FT_ColorIndex(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code palette_index} field. */ + @NativeType("FT_UInt16") + public short palette_index() { return npalette_index(address()); } + /** @return the value of the {@code alpha} field. */ + @NativeType("FT_F2Dot14") + public short alpha() { return nalpha(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_ColorIndex} instance for the specified memory address. */ + public static FT_ColorIndex create(long address) { + return new FT_ColorIndex(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_ColorIndex createSafe(long address) { + return address == NULL ? null : new FT_ColorIndex(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #palette_index}. */ + public static short npalette_index(long struct) { return UNSAFE.getShort(null, struct + FT_ColorIndex.PALETTE_INDEX); } + /** Unsafe version of {@link #alpha}. */ + public static short nalpha(long struct) { return UNSAFE.getShort(null, struct + FT_ColorIndex.ALPHA); } + + // ----------------------------------- + + /** An array of {@link FT_ColorIndex} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_ColorIndex ELEMENT_FACTORY = FT_ColorIndex.create(-1L); + + /** + * Creates a new {@code FT_ColorIndex.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 {@link FT_ColorIndex#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_ColorIndex getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code palette_index} field. */ + @NativeType("FT_UInt16") + public short palette_index() { return FT_ColorIndex.npalette_index(address()); } + /** @return the value of the {@code alpha} field. */ + @NativeType("FT_F2Dot14") + public short alpha() { return FT_ColorIndex.nalpha(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorLine.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorLine.java new file mode 100644 index 00000000..c0b3712a --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorLine.java @@ -0,0 +1,163 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure representing a {@code ColorLine} value of the {@code COLR} v1 extensions. + * + *

Layout

+ * + *

+ * struct FT_ColorLine {
+ *     FT_PaintExtend extend;
+ *     {@link FT_ColorStopIterator FT_ColorStopIterator} color_stop_iterator;
+ * }
+ */ +public class FT_ColorLine extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + EXTEND, + COLOR_STOP_ITERATOR; + + static { + Layout layout = __struct( + __member(4), + __member(FT_ColorStopIterator.SIZEOF, FT_ColorStopIterator.ALIGNOF) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + EXTEND = layout.offsetof(0); + COLOR_STOP_ITERATOR = layout.offsetof(1); + } + + protected FT_ColorLine(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_ColorLine create(long address, @Nullable ByteBuffer container) { + return new FT_ColorLine(address, container); + } + + /** + * Creates a {@code FT_ColorLine} instance at the current position of the specified {@link 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 FT_ColorLine(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code extend} field. */ + @NativeType("FT_PaintExtend") + public int extend() { return nextend(address()); } + /** @return a {@link FT_ColorStopIterator} view of the {@code color_stop_iterator} field. */ + public FT_ColorStopIterator color_stop_iterator() { return ncolor_stop_iterator(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_ColorLine} instance for the specified memory address. */ + public static FT_ColorLine create(long address) { + return new FT_ColorLine(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_ColorLine createSafe(long address) { + return address == NULL ? null : new FT_ColorLine(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #extend}. */ + public static int nextend(long struct) { return UNSAFE.getInt(null, struct + FT_ColorLine.EXTEND); } + /** Unsafe version of {@link #color_stop_iterator}. */ + public static FT_ColorStopIterator ncolor_stop_iterator(long struct) { return FT_ColorStopIterator.create(struct + FT_ColorLine.COLOR_STOP_ITERATOR); } + + // ----------------------------------- + + /** An array of {@link FT_ColorLine} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_ColorLine ELEMENT_FACTORY = FT_ColorLine.create(-1L); + + /** + * Creates a new {@code FT_ColorLine.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 {@link FT_ColorLine#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_ColorLine getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code extend} field. */ + @NativeType("FT_PaintExtend") + public int extend() { return FT_ColorLine.nextend(address()); } + /** @return a {@link FT_ColorStopIterator} view of the {@code color_stop_iterator} field. */ + public FT_ColorStopIterator color_stop_iterator() { return FT_ColorLine.ncolor_stop_iterator(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorStop.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorStop.java new file mode 100644 index 00000000..3b3b8399 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorStop.java @@ -0,0 +1,247 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A structure representing a {@code ColorStop} value of the 'COLR' v1 extensions. + * + *

Layout

+ * + *

+ * struct FT_ColorStop {
+ *     FT_Fixed stop_offset;
+ *     {@link FT_ColorIndex FT_ColorIndex} color;
+ * }
+ */ +public class FT_ColorStop extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + STOP_OFFSET, + COLOR; + + static { + Layout layout = __struct( + __member(CLONG_SIZE), + __member(FT_ColorIndex.SIZEOF, FT_ColorIndex.ALIGNOF) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + STOP_OFFSET = layout.offsetof(0); + COLOR = layout.offsetof(1); + } + + protected FT_ColorStop(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_ColorStop create(long address, @Nullable ByteBuffer container) { + return new FT_ColorStop(address, container); + } + + /** + * Creates a {@code FT_ColorStop} instance at the current position of the specified {@link 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 FT_ColorStop(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code stop_offset} field. */ + @NativeType("FT_Fixed") + public long stop_offset() { return nstop_offset(address()); } + /** @return a {@link FT_ColorIndex} view of the {@code color} field. */ + public FT_ColorIndex color() { return ncolor(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_ColorStop} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_ColorStop malloc() { + return new FT_ColorStop(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_ColorStop} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_ColorStop calloc() { + return new FT_ColorStop(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_ColorStop} instance allocated with {@link BufferUtils}. */ + public static FT_ColorStop create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_ColorStop(memAddress(container), container); + } + + /** Returns a new {@code FT_ColorStop} instance for the specified memory address. */ + public static FT_ColorStop create(long address) { + return new FT_ColorStop(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_ColorStop createSafe(long address) { + return address == NULL ? null : new FT_ColorStop(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_ColorStop} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_ColorStop malloc(MemoryStack stack) { + return new FT_ColorStop(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_ColorStop} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_ColorStop calloc(MemoryStack stack) { + return new FT_ColorStop(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #stop_offset}. */ + public static long nstop_offset(long struct) { return memGetCLong(struct + FT_ColorStop.STOP_OFFSET); } + /** Unsafe version of {@link #color}. */ + public static FT_ColorIndex ncolor(long struct) { return FT_ColorIndex.create(struct + FT_ColorStop.COLOR); } + + // ----------------------------------- + + /** An array of {@link FT_ColorStop} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_ColorStop ELEMENT_FACTORY = FT_ColorStop.create(-1L); + + /** + * Creates a new {@code FT_ColorStop.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 {@link FT_ColorStop#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_ColorStop getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code stop_offset} field. */ + @NativeType("FT_Fixed") + public long stop_offset() { return FT_ColorStop.nstop_offset(address()); } + /** @return a {@link FT_ColorIndex} view of the {@code color} field. */ + public FT_ColorIndex color() { return FT_ColorStop.ncolor(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorStopIterator.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorStopIterator.java new file mode 100644 index 00000000..b6a852b2 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorStopIterator.java @@ -0,0 +1,283 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * This iterator object is needed for {@link FreeType#FT_Get_Colorline_Stops Get_Colorline_Stops}. + * + *

Layout

+ * + *

+ * struct FT_ColorStopIterator {
+ *     FT_UInt num_color_stops;
+ *     FT_UInt current_color_stop;
+ *     FT_Byte * p;
+ *     FT_Bool read_variable;
+ * }
+ */ +public class FT_ColorStopIterator extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + NUM_COLOR_STOPS, + CURRENT_COLOR_STOP, + P, + READ_VARIABLE; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __member(POINTER_SIZE), + __member(1) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + NUM_COLOR_STOPS = layout.offsetof(0); + CURRENT_COLOR_STOP = layout.offsetof(1); + P = layout.offsetof(2); + READ_VARIABLE = layout.offsetof(3); + } + + protected FT_ColorStopIterator(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_ColorStopIterator create(long address, @Nullable ByteBuffer container) { + return new FT_ColorStopIterator(address, container); + } + + /** + * Creates a {@code FT_ColorStopIterator} instance at the current position of the specified {@link 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 FT_ColorStopIterator(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code num_color_stops} field. */ + @NativeType("FT_UInt") + public int num_color_stops() { return nnum_color_stops(address()); } + /** @return the value of the {@code current_color_stop} field. */ + @NativeType("FT_UInt") + public int current_color_stop() { return ncurrent_color_stop(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code p} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("FT_Byte *") + public ByteBuffer p(int capacity) { return np(address(), capacity); } + /** @return the value of the {@code read_variable} field. */ + @NativeType("FT_Bool") + public boolean read_variable() { return nread_variable(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_ColorStopIterator} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_ColorStopIterator malloc() { + return new FT_ColorStopIterator(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_ColorStopIterator} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_ColorStopIterator calloc() { + return new FT_ColorStopIterator(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_ColorStopIterator} instance allocated with {@link BufferUtils}. */ + public static FT_ColorStopIterator create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_ColorStopIterator(memAddress(container), container); + } + + /** Returns a new {@code FT_ColorStopIterator} instance for the specified memory address. */ + public static FT_ColorStopIterator create(long address) { + return new FT_ColorStopIterator(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_ColorStopIterator createSafe(long address) { + return address == NULL ? null : new FT_ColorStopIterator(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_ColorStopIterator} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_ColorStopIterator malloc(MemoryStack stack) { + return new FT_ColorStopIterator(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_ColorStopIterator} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_ColorStopIterator calloc(MemoryStack stack) { + return new FT_ColorStopIterator(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #num_color_stops}. */ + public static int nnum_color_stops(long struct) { return UNSAFE.getInt(null, struct + FT_ColorStopIterator.NUM_COLOR_STOPS); } + /** Unsafe version of {@link #current_color_stop}. */ + public static int ncurrent_color_stop(long struct) { return UNSAFE.getInt(null, struct + FT_ColorStopIterator.CURRENT_COLOR_STOP); } + /** Unsafe version of {@link #p(int) p}. */ + @Nullable public static ByteBuffer np(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + FT_ColorStopIterator.P), capacity); } + /** Unsafe version of {@link #read_variable}. */ + public static boolean nread_variable(long struct) { return UNSAFE.getByte(null, struct + FT_ColorStopIterator.READ_VARIABLE) != 0; } + + // ----------------------------------- + + /** An array of {@link FT_ColorStopIterator} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_ColorStopIterator ELEMENT_FACTORY = FT_ColorStopIterator.create(-1L); + + /** + * Creates a new {@code FT_ColorStopIterator.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 {@link FT_ColorStopIterator#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_ColorStopIterator getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code num_color_stops} field. */ + @NativeType("FT_UInt") + public int num_color_stops() { return FT_ColorStopIterator.nnum_color_stops(address()); } + /** @return the value of the {@code current_color_stop} field. */ + @NativeType("FT_UInt") + public int current_color_stop() { return FT_ColorStopIterator.ncurrent_color_stop(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code p} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("FT_Byte *") + public ByteBuffer p(int capacity) { return FT_ColorStopIterator.np(address(), capacity); } + /** @return the value of the {@code read_variable} field. */ + @NativeType("FT_Bool") + public boolean read_variable() { return FT_ColorStopIterator.nread_variable(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Data.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Data.java new file mode 100644 index 00000000..3484e6a6 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Data.java @@ -0,0 +1,282 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Read-only binary data represented as a pointer and a length. + * + *

Layout

+ * + *

+ * struct FT_Data {
+ *     FT_Byte const * pointer;
+ *     FT_UInt length;
+ * }
+ */ +public class FT_Data extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + POINTER, + LENGTH; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + POINTER = layout.offsetof(0); + LENGTH = layout.offsetof(1); + } + + protected FT_Data(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Data create(long address, @Nullable ByteBuffer container) { + return new FT_Data(address, container); + } + + /** + * Creates a {@code FT_Data} instance at the current position of the specified {@link 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 FT_Data(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code pointer} field. */ + @NativeType("FT_Byte const *") + public ByteBuffer pointer() { return npointer(address()); } + /** @return the value of the {@code length} field. */ + @NativeType("FT_UInt") + public int length() { return nlength(address()); } + + /** Sets the address of the specified {@link ByteBuffer} to the {@code pointer} field. */ + public FT_Data pointer(@NativeType("FT_Byte const *") ByteBuffer value) { npointer(address(), value); return this; } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Data set(FT_Data src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Data} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Data malloc() { + return new FT_Data(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Data} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Data calloc() { + return new FT_Data(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Data} instance allocated with {@link BufferUtils}. */ + public static FT_Data create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Data(memAddress(container), container); + } + + /** Returns a new {@code FT_Data} instance for the specified memory address. */ + public static FT_Data create(long address) { + return new FT_Data(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Data createSafe(long address) { + return address == NULL ? null : new FT_Data(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Data} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Data malloc(MemoryStack stack) { + return new FT_Data(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Data} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Data calloc(MemoryStack stack) { + return new FT_Data(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #pointer() pointer}. */ + public static ByteBuffer npointer(long struct) { return memByteBuffer(memGetAddress(struct + FT_Data.POINTER), nlength(struct)); } + /** Unsafe version of {@link #length}. */ + public static int nlength(long struct) { return UNSAFE.getInt(null, struct + FT_Data.LENGTH); } + + /** Unsafe version of {@link #pointer(ByteBuffer) pointer}. */ + public static void npointer(long struct, ByteBuffer value) { memPutAddress(struct + FT_Data.POINTER, memAddress(value)); nlength(struct, value.remaining()); } + /** Sets the specified value to the {@code length} field of the specified {@code struct}. */ + public static void nlength(long struct, int value) { UNSAFE.putInt(null, struct + FT_Data.LENGTH, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + FT_Data.POINTER)); + } + + // ----------------------------------- + + /** An array of {@link FT_Data} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Data ELEMENT_FACTORY = FT_Data.create(-1L); + + /** + * Creates a new {@code FT_Data.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 {@link FT_Data#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Data getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code pointer} field. */ + @NativeType("FT_Byte const *") + public ByteBuffer pointer() { return FT_Data.npointer(address()); } + /** @return the value of the {@code length} field. */ + @NativeType("FT_UInt") + public int length() { return FT_Data.nlength(address()); } + + /** Sets the address of the specified {@link ByteBuffer} to the {@code pointer} field. */ + public Buffer pointer(@NativeType("FT_Byte const *") ByteBuffer value) { FT_Data.npointer(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_DebugHook_Func.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_DebugHook_Func.java new file mode 100644 index 00000000..4e755a4d --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_DebugHook_Func.java @@ -0,0 +1,73 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * FT_Error (*{@link #invoke}) (
+ *     void *arg
+ * )
+ */ +public abstract class FT_DebugHook_Func extends Callback implements FT_DebugHook_FuncI { + + /** + * Creates a {@code FT_DebugHook_Func} instance from the specified function pointer. + * + * @return the new {@code FT_DebugHook_Func} + */ + public static FT_DebugHook_Func create(long functionPointer) { + FT_DebugHook_FuncI instance = Callback.get(functionPointer); + return instance instanceof FT_DebugHook_Func + ? (FT_DebugHook_Func)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_DebugHook_Func createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_DebugHook_Func} instance that delegates to the specified {@code FT_DebugHook_FuncI} instance. */ + public static FT_DebugHook_Func create(FT_DebugHook_FuncI instance) { + return instance instanceof FT_DebugHook_Func + ? (FT_DebugHook_Func)instance + : new Container(instance.address(), instance); + } + + protected FT_DebugHook_Func() { + super(CIF); + } + + FT_DebugHook_Func(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_DebugHook_Func { + + private final FT_DebugHook_FuncI delegate; + + Container(long functionPointer, FT_DebugHook_FuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public int invoke(long arg) { + return delegate.invoke(arg); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_DebugHook_FuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_DebugHook_FuncI.java new file mode 100644 index 00000000..c4518d08 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_DebugHook_FuncI.java @@ -0,0 +1,47 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * FT_Error (*{@link #invoke}) (
+ *     void *arg
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_DebugHook_Func") +public interface FT_DebugHook_FuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_sint32, + ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + int __result = invoke( + memGetAddress(memGetAddress(args)) + ); + apiClosureRet(ret, __result); + } + + /** A drop-in replacement (or rather a wrapper) for the bytecode or charstring interpreter's main loop function. */ + @NativeType("FT_Error") int invoke(@NativeType("void *") long arg); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Face.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Face.java new file mode 100644 index 00000000..23c30bf9 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Face.java @@ -0,0 +1,480 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * FreeType root face class structure. A face object models a typeface in a font file. + * + *

Layout

+ * + *

+ * struct FT_FaceRec {
+ *     FT_Long num_faces;
+ *     FT_Long face_index;
+ *     FT_Long face_flags;
+ *     FT_Long style_flags;
+ *     FT_Long num_glyphs;
+ *     FT_String * family_name;
+ *     FT_String * style_name;
+ *     FT_Int num_fixed_sizes;
+ *     {@link FT_Bitmap_Size FT_Bitmap_Size} * available_sizes;
+ *     FT_Int num_charmaps;
+ *     {@link FT_CharMap FT_CharMap} * charmaps;
+ *     {@link FT_Generic FT_Generic} generic;
+ *     {@link FT_BBox FT_BBox} bbox;
+ *     FT_UShort units_per_EM;
+ *     FT_Short ascender;
+ *     FT_Short descender;
+ *     FT_Short height;
+ *     FT_Short max_advance_width;
+ *     FT_Short max_advance_height;
+ *     FT_Short underline_position;
+ *     FT_Short underline_thickness;
+ *     {@link FT_GlyphSlot FT_GlyphSlot} glyph;
+ *     {@link FT_Size FT_Size} size;
+ *     {@link FT_CharMap FT_CharMap} charmap;
+ *     FT_Driver driver;
+ *     FT_Memory memory;
+ *     {@link FT_Stream FT_Stream} stream;
+ *     {@link FT_List FT_ListRec} sizes_list;
+ *     {@link FT_Generic FT_Generic} autohint;
+ *     void * extensions;
+ *     FT_Face_Internal internal;
+ * }
+ */ +@NativeType("struct FT_FaceRec") +public class FT_Face extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + NUM_FACES, + FACE_INDEX, + FACE_FLAGS, + STYLE_FLAGS, + NUM_GLYPHS, + FAMILY_NAME, + STYLE_NAME, + NUM_FIXED_SIZES, + AVAILABLE_SIZES, + NUM_CHARMAPS, + CHARMAPS, + GENERIC, + BBOX, + UNITS_PER_EM, + ASCENDER, + DESCENDER, + HEIGHT, + MAX_ADVANCE_WIDTH, + MAX_ADVANCE_HEIGHT, + UNDERLINE_POSITION, + UNDERLINE_THICKNESS, + GLYPH, + SIZE, + CHARMAP, + DRIVER, + MEMORY, + STREAM, + SIZES_LIST, + AUTOHINT, + EXTENSIONS, + INTERNAL; + + static { + Layout layout = __struct( + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(FT_Generic.SIZEOF, FT_Generic.ALIGNOF), + __member(FT_BBox.SIZEOF, FT_BBox.ALIGNOF), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(FT_List.SIZEOF, FT_List.ALIGNOF), + __member(FT_Generic.SIZEOF, FT_Generic.ALIGNOF), + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + NUM_FACES = layout.offsetof(0); + FACE_INDEX = layout.offsetof(1); + FACE_FLAGS = layout.offsetof(2); + STYLE_FLAGS = layout.offsetof(3); + NUM_GLYPHS = layout.offsetof(4); + FAMILY_NAME = layout.offsetof(5); + STYLE_NAME = layout.offsetof(6); + NUM_FIXED_SIZES = layout.offsetof(7); + AVAILABLE_SIZES = layout.offsetof(8); + NUM_CHARMAPS = layout.offsetof(9); + CHARMAPS = layout.offsetof(10); + GENERIC = layout.offsetof(11); + BBOX = layout.offsetof(12); + UNITS_PER_EM = layout.offsetof(13); + ASCENDER = layout.offsetof(14); + DESCENDER = layout.offsetof(15); + HEIGHT = layout.offsetof(16); + MAX_ADVANCE_WIDTH = layout.offsetof(17); + MAX_ADVANCE_HEIGHT = layout.offsetof(18); + UNDERLINE_POSITION = layout.offsetof(19); + UNDERLINE_THICKNESS = layout.offsetof(20); + GLYPH = layout.offsetof(21); + SIZE = layout.offsetof(22); + CHARMAP = layout.offsetof(23); + DRIVER = layout.offsetof(24); + MEMORY = layout.offsetof(25); + STREAM = layout.offsetof(26); + SIZES_LIST = layout.offsetof(27); + AUTOHINT = layout.offsetof(28); + EXTENSIONS = layout.offsetof(29); + INTERNAL = layout.offsetof(30); + } + + protected FT_Face(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Face create(long address, @Nullable ByteBuffer container) { + return new FT_Face(address, container); + } + + /** + * Creates a {@code FT_Face} instance at the current position of the specified {@link 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 FT_Face(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code num_faces} field. */ + @NativeType("FT_Long") + public long num_faces() { return nnum_faces(address()); } + /** @return the value of the {@code face_index} field. */ + @NativeType("FT_Long") + public long face_index() { return nface_index(address()); } + /** @return the value of the {@code face_flags} field. */ + @NativeType("FT_Long") + public long face_flags() { return nface_flags(address()); } + /** @return the value of the {@code style_flags} field. */ + @NativeType("FT_Long") + public long style_flags() { return nstyle_flags(address()); } + /** @return the value of the {@code num_glyphs} field. */ + @NativeType("FT_Long") + public long num_glyphs() { return nnum_glyphs(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code family_name} field. */ + @NativeType("FT_String *") + public ByteBuffer family_name() { return nfamily_name(address()); } + /** @return the null-terminated string pointed to by the {@code family_name} field. */ + @NativeType("FT_String *") + public String family_nameString() { return nfamily_nameString(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code style_name} field. */ + @NativeType("FT_String *") + public ByteBuffer style_name() { return nstyle_name(address()); } + /** @return the null-terminated string pointed to by the {@code style_name} field. */ + @NativeType("FT_String *") + public String style_nameString() { return nstyle_nameString(address()); } + /** @return the value of the {@code num_fixed_sizes} field. */ + @NativeType("FT_Int") + public int num_fixed_sizes() { return nnum_fixed_sizes(address()); } + /** @return a {@link FT_Bitmap_Size.Buffer} view of the struct array pointed to by the {@code available_sizes} field. */ + @Nullable + @NativeType("FT_Bitmap_Size *") + public FT_Bitmap_Size.Buffer available_sizes() { return navailable_sizes(address()); } + /** @return the value of the {@code num_charmaps} field. */ + @NativeType("FT_Int") + public int num_charmaps() { return nnum_charmaps(address()); } + /** @return a {@link PointerBuffer} view of the data pointed to by the {@code charmaps} field. */ + @NativeType("FT_CharMap *") + public PointerBuffer charmaps() { return ncharmaps(address()); } + /** @return a {@link FT_Generic} view of the {@code generic} field. */ + public FT_Generic generic() { return ngeneric(address()); } + /** @return a {@link FT_BBox} view of the {@code bbox} field. */ + public FT_BBox bbox() { return nbbox(address()); } + /** @return the value of the {@code units_per_EM} field. */ + @NativeType("FT_UShort") + public short units_per_EM() { return nunits_per_EM(address()); } + /** @return the value of the {@code ascender} field. */ + @NativeType("FT_Short") + public short ascender() { return nascender(address()); } + /** @return the value of the {@code descender} field. */ + @NativeType("FT_Short") + public short descender() { return ndescender(address()); } + /** @return the value of the {@code height} field. */ + @NativeType("FT_Short") + public short height() { return nheight(address()); } + /** @return the value of the {@code max_advance_width} field. */ + @NativeType("FT_Short") + public short max_advance_width() { return nmax_advance_width(address()); } + /** @return the value of the {@code max_advance_height} field. */ + @NativeType("FT_Short") + public short max_advance_height() { return nmax_advance_height(address()); } + /** @return the value of the {@code underline_position} field. */ + @NativeType("FT_Short") + public short underline_position() { return nunderline_position(address()); } + /** @return the value of the {@code underline_thickness} field. */ + @NativeType("FT_Short") + public short underline_thickness() { return nunderline_thickness(address()); } + /** @return a {@link FT_GlyphSlot} view of the struct pointed to by the {@code glyph} field. */ + @Nullable + public FT_GlyphSlot glyph() { return nglyph(address()); } + /** @return a {@link FT_Size} view of the struct pointed to by the {@code size} field. */ + @Nullable + public FT_Size size() { return nsize(address()); } + /** @return a {@link FT_CharMap} view of the struct pointed to by the {@code charmap} field. */ + @Nullable + public FT_CharMap charmap() { return ncharmap(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Face} instance for the specified memory address. */ + public static FT_Face create(long address) { + return new FT_Face(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Face createSafe(long address) { + return address == NULL ? null : new FT_Face(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #num_faces}. */ + public static long nnum_faces(long struct) { return memGetCLong(struct + FT_Face.NUM_FACES); } + /** Unsafe version of {@link #face_index}. */ + public static long nface_index(long struct) { return memGetCLong(struct + FT_Face.FACE_INDEX); } + /** Unsafe version of {@link #face_flags}. */ + public static long nface_flags(long struct) { return memGetCLong(struct + FT_Face.FACE_FLAGS); } + /** Unsafe version of {@link #style_flags}. */ + public static long nstyle_flags(long struct) { return memGetCLong(struct + FT_Face.STYLE_FLAGS); } + /** Unsafe version of {@link #num_glyphs}. */ + public static long nnum_glyphs(long struct) { return memGetCLong(struct + FT_Face.NUM_GLYPHS); } + /** Unsafe version of {@link #family_name}. */ + public static ByteBuffer nfamily_name(long struct) { return memByteBufferNT1(memGetAddress(struct + FT_Face.FAMILY_NAME)); } + /** Unsafe version of {@link #family_nameString}. */ + public static String nfamily_nameString(long struct) { return memUTF8(memGetAddress(struct + FT_Face.FAMILY_NAME)); } + /** Unsafe version of {@link #style_name}. */ + public static ByteBuffer nstyle_name(long struct) { return memByteBufferNT1(memGetAddress(struct + FT_Face.STYLE_NAME)); } + /** Unsafe version of {@link #style_nameString}. */ + public static String nstyle_nameString(long struct) { return memUTF8(memGetAddress(struct + FT_Face.STYLE_NAME)); } + /** Unsafe version of {@link #num_fixed_sizes}. */ + public static int nnum_fixed_sizes(long struct) { return UNSAFE.getInt(null, struct + FT_Face.NUM_FIXED_SIZES); } + /** Unsafe version of {@link #available_sizes}. */ + @Nullable public static FT_Bitmap_Size.Buffer navailable_sizes(long struct) { return FT_Bitmap_Size.createSafe(memGetAddress(struct + FT_Face.AVAILABLE_SIZES), nnum_fixed_sizes(struct)); } + /** Unsafe version of {@link #num_charmaps}. */ + public static int nnum_charmaps(long struct) { return UNSAFE.getInt(null, struct + FT_Face.NUM_CHARMAPS); } + /** Unsafe version of {@link #charmaps() charmaps}. */ + public static PointerBuffer ncharmaps(long struct) { return memPointerBuffer(memGetAddress(struct + FT_Face.CHARMAPS), nnum_charmaps(struct)); } + /** Unsafe version of {@link #generic}. */ + public static FT_Generic ngeneric(long struct) { return FT_Generic.create(struct + FT_Face.GENERIC); } + /** Unsafe version of {@link #bbox}. */ + public static FT_BBox nbbox(long struct) { return FT_BBox.create(struct + FT_Face.BBOX); } + /** Unsafe version of {@link #units_per_EM}. */ + public static short nunits_per_EM(long struct) { return UNSAFE.getShort(null, struct + FT_Face.UNITS_PER_EM); } + /** Unsafe version of {@link #ascender}. */ + public static short nascender(long struct) { return UNSAFE.getShort(null, struct + FT_Face.ASCENDER); } + /** Unsafe version of {@link #descender}. */ + public static short ndescender(long struct) { return UNSAFE.getShort(null, struct + FT_Face.DESCENDER); } + /** Unsafe version of {@link #height}. */ + public static short nheight(long struct) { return UNSAFE.getShort(null, struct + FT_Face.HEIGHT); } + /** Unsafe version of {@link #max_advance_width}. */ + public static short nmax_advance_width(long struct) { return UNSAFE.getShort(null, struct + FT_Face.MAX_ADVANCE_WIDTH); } + /** Unsafe version of {@link #max_advance_height}. */ + public static short nmax_advance_height(long struct) { return UNSAFE.getShort(null, struct + FT_Face.MAX_ADVANCE_HEIGHT); } + /** Unsafe version of {@link #underline_position}. */ + public static short nunderline_position(long struct) { return UNSAFE.getShort(null, struct + FT_Face.UNDERLINE_POSITION); } + /** Unsafe version of {@link #underline_thickness}. */ + public static short nunderline_thickness(long struct) { return UNSAFE.getShort(null, struct + FT_Face.UNDERLINE_THICKNESS); } + /** Unsafe version of {@link #glyph}. */ + @Nullable public static FT_GlyphSlot nglyph(long struct) { return FT_GlyphSlot.createSafe(memGetAddress(struct + FT_Face.GLYPH)); } + /** Unsafe version of {@link #size}. */ + @Nullable public static FT_Size nsize(long struct) { return FT_Size.createSafe(memGetAddress(struct + FT_Face.SIZE)); } + /** Unsafe version of {@link #charmap}. */ + @Nullable public static FT_CharMap ncharmap(long struct) { return FT_CharMap.createSafe(memGetAddress(struct + FT_Face.CHARMAP)); } + public static long ndriver(long struct) { return memGetAddress(struct + FT_Face.DRIVER); } + @Nullable public static FT_Memory nmemory(long struct) { return FT_Memory.createSafe(memGetAddress(struct + FT_Face.MEMORY)); } + @Nullable public static FT_Stream nstream$(long struct) { return FT_Stream.createSafe(memGetAddress(struct + FT_Face.STREAM)); } + public static FT_List nsizes_list(long struct) { return FT_List.create(struct + FT_Face.SIZES_LIST); } + public static FT_Generic nautohint(long struct) { return FT_Generic.create(struct + FT_Face.AUTOHINT); } + public static long nextensions(long struct) { return memGetAddress(struct + FT_Face.EXTENSIONS); } + public static long ninternal(long struct) { return memGetAddress(struct + FT_Face.INTERNAL); } + + // ----------------------------------- + + /** An array of {@link FT_Face} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_Face ELEMENT_FACTORY = FT_Face.create(-1L); + + /** + * Creates a new {@code FT_Face.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 {@link FT_Face#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Face getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code num_faces} field. */ + @NativeType("FT_Long") + public long num_faces() { return FT_Face.nnum_faces(address()); } + /** @return the value of the {@code face_index} field. */ + @NativeType("FT_Long") + public long face_index() { return FT_Face.nface_index(address()); } + /** @return the value of the {@code face_flags} field. */ + @NativeType("FT_Long") + public long face_flags() { return FT_Face.nface_flags(address()); } + /** @return the value of the {@code style_flags} field. */ + @NativeType("FT_Long") + public long style_flags() { return FT_Face.nstyle_flags(address()); } + /** @return the value of the {@code num_glyphs} field. */ + @NativeType("FT_Long") + public long num_glyphs() { return FT_Face.nnum_glyphs(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code family_name} field. */ + @NativeType("FT_String *") + public ByteBuffer family_name() { return FT_Face.nfamily_name(address()); } + /** @return the null-terminated string pointed to by the {@code family_name} field. */ + @NativeType("FT_String *") + public String family_nameString() { return FT_Face.nfamily_nameString(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code style_name} field. */ + @NativeType("FT_String *") + public ByteBuffer style_name() { return FT_Face.nstyle_name(address()); } + /** @return the null-terminated string pointed to by the {@code style_name} field. */ + @NativeType("FT_String *") + public String style_nameString() { return FT_Face.nstyle_nameString(address()); } + /** @return the value of the {@code num_fixed_sizes} field. */ + @NativeType("FT_Int") + public int num_fixed_sizes() { return FT_Face.nnum_fixed_sizes(address()); } + /** @return a {@link FT_Bitmap_Size.Buffer} view of the struct array pointed to by the {@code available_sizes} field. */ + @Nullable + @NativeType("FT_Bitmap_Size *") + public FT_Bitmap_Size.Buffer available_sizes() { return FT_Face.navailable_sizes(address()); } + /** @return the value of the {@code num_charmaps} field. */ + @NativeType("FT_Int") + public int num_charmaps() { return FT_Face.nnum_charmaps(address()); } + /** @return a {@link PointerBuffer} view of the data pointed to by the {@code charmaps} field. */ + @NativeType("FT_CharMap *") + public PointerBuffer charmaps() { return FT_Face.ncharmaps(address()); } + /** @return a {@link FT_Generic} view of the {@code generic} field. */ + public FT_Generic generic() { return FT_Face.ngeneric(address()); } + /** @return a {@link FT_BBox} view of the {@code bbox} field. */ + public FT_BBox bbox() { return FT_Face.nbbox(address()); } + /** @return the value of the {@code units_per_EM} field. */ + @NativeType("FT_UShort") + public short units_per_EM() { return FT_Face.nunits_per_EM(address()); } + /** @return the value of the {@code ascender} field. */ + @NativeType("FT_Short") + public short ascender() { return FT_Face.nascender(address()); } + /** @return the value of the {@code descender} field. */ + @NativeType("FT_Short") + public short descender() { return FT_Face.ndescender(address()); } + /** @return the value of the {@code height} field. */ + @NativeType("FT_Short") + public short height() { return FT_Face.nheight(address()); } + /** @return the value of the {@code max_advance_width} field. */ + @NativeType("FT_Short") + public short max_advance_width() { return FT_Face.nmax_advance_width(address()); } + /** @return the value of the {@code max_advance_height} field. */ + @NativeType("FT_Short") + public short max_advance_height() { return FT_Face.nmax_advance_height(address()); } + /** @return the value of the {@code underline_position} field. */ + @NativeType("FT_Short") + public short underline_position() { return FT_Face.nunderline_position(address()); } + /** @return the value of the {@code underline_thickness} field. */ + @NativeType("FT_Short") + public short underline_thickness() { return FT_Face.nunderline_thickness(address()); } + /** @return a {@link FT_GlyphSlot} view of the struct pointed to by the {@code glyph} field. */ + @Nullable + public FT_GlyphSlot glyph() { return FT_Face.nglyph(address()); } + /** @return a {@link FT_Size} view of the struct pointed to by the {@code size} field. */ + @Nullable + public FT_Size size() { return FT_Face.nsize(address()); } + /** @return a {@link FT_CharMap} view of the struct pointed to by the {@code charmap} field. */ + @Nullable + public FT_CharMap charmap() { return FT_Face.ncharmap(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Free_Func.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Free_Func.java new file mode 100644 index 00000000..dc0a5e03 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Free_Func.java @@ -0,0 +1,74 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     FT_Memory memory,
+ *     void *block
+ * )
+ */ +public abstract class FT_Free_Func extends Callback implements FT_Free_FuncI { + + /** + * Creates a {@code FT_Free_Func} instance from the specified function pointer. + * + * @return the new {@code FT_Free_Func} + */ + public static FT_Free_Func create(long functionPointer) { + FT_Free_FuncI instance = Callback.get(functionPointer); + return instance instanceof FT_Free_Func + ? (FT_Free_Func)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Free_Func createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Free_Func} instance that delegates to the specified {@code FT_Free_FuncI} instance. */ + public static FT_Free_Func create(FT_Free_FuncI instance) { + return instance instanceof FT_Free_Func + ? (FT_Free_Func)instance + : new Container(instance.address(), instance); + } + + protected FT_Free_Func() { + super(CIF); + } + + FT_Free_Func(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Free_Func { + + private final FT_Free_FuncI delegate; + + Container(long functionPointer, FT_Free_FuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long memory, long block) { + delegate.invoke(memory, block); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Free_FuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Free_FuncI.java new file mode 100644 index 00000000..a018838c --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Free_FuncI.java @@ -0,0 +1,48 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     FT_Memory memory,
+ *     void *block
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Free_Func") +public interface FT_Free_FuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_void, + ffi_type_pointer, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + invoke( + memGetAddress(memGetAddress(args)), + memGetAddress(memGetAddress(args + POINTER_SIZE)) + ); + } + + /** A function used to release a given block of memory. */ + void invoke(@NativeType("FT_Memory") long memory, @NativeType("void *") long block); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Generic.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Generic.java new file mode 100644 index 00000000..2124f7f9 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Generic.java @@ -0,0 +1,296 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Client applications often need to associate their own data to a variety of FreeType core objects. For example, a text layout API might + * want to associate a glyph cache to a given size object. + * + *

Layout

+ * + *

+ * struct FT_Generic {
+ *     void * data;
+ *     {@link FT_Generic_FinalizerI FT_Generic_Finalizer} finalizer;
+ * }
+ */ +public class FT_Generic extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + DATA, + FINALIZER; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + DATA = layout.offsetof(0); + FINALIZER = layout.offsetof(1); + } + + protected FT_Generic(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Generic create(long address, @Nullable ByteBuffer container) { + return new FT_Generic(address, container); + } + + /** + * Creates a {@code FT_Generic} instance at the current position of the specified {@link 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 FT_Generic(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code data} field. */ + @NativeType("void *") + public long data() { return ndata(address()); } + /** @return the value of the {@code finalizer} field. */ + public FT_Generic_Finalizer finalizer() { return nfinalizer(address()); } + + /** Sets the specified value to the {@code data} field. */ + public FT_Generic data(@NativeType("void *") long value) { ndata(address(), value); return this; } + /** Sets the specified value to the {@code finalizer} field. */ + public FT_Generic finalizer(@NativeType("FT_Generic_Finalizer") FT_Generic_FinalizerI value) { nfinalizer(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_Generic set( + long data, + FT_Generic_FinalizerI finalizer + ) { + data(data); + finalizer(finalizer); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Generic set(FT_Generic src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Generic} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Generic malloc() { + return new FT_Generic(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Generic} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Generic calloc() { + return new FT_Generic(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Generic} instance allocated with {@link BufferUtils}. */ + public static FT_Generic create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Generic(memAddress(container), container); + } + + /** Returns a new {@code FT_Generic} instance for the specified memory address. */ + public static FT_Generic create(long address) { + return new FT_Generic(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Generic createSafe(long address) { + return address == NULL ? null : new FT_Generic(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Generic} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Generic malloc(MemoryStack stack) { + return new FT_Generic(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Generic} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Generic calloc(MemoryStack stack) { + return new FT_Generic(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #data}. */ + public static long ndata(long struct) { return memGetAddress(struct + FT_Generic.DATA); } + /** Unsafe version of {@link #finalizer}. */ + public static FT_Generic_Finalizer nfinalizer(long struct) { return FT_Generic_Finalizer.create(memGetAddress(struct + FT_Generic.FINALIZER)); } + + /** Unsafe version of {@link #data(long) data}. */ + public static void ndata(long struct, long value) { memPutAddress(struct + FT_Generic.DATA, value); } + /** Unsafe version of {@link #finalizer(FT_Generic_FinalizerI) finalizer}. */ + public static void nfinalizer(long struct, FT_Generic_FinalizerI value) { memPutAddress(struct + FT_Generic.FINALIZER, value.address()); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + FT_Generic.FINALIZER)); + } + + // ----------------------------------- + + /** An array of {@link FT_Generic} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Generic ELEMENT_FACTORY = FT_Generic.create(-1L); + + /** + * Creates a new {@code FT_Generic.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 {@link FT_Generic#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Generic getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code data} field. */ + @NativeType("void *") + public long data() { return FT_Generic.ndata(address()); } + /** @return the value of the {@code finalizer} field. */ + public FT_Generic_Finalizer finalizer() { return FT_Generic.nfinalizer(address()); } + + /** Sets the specified value to the {@code data} field. */ + public Buffer data(@NativeType("void *") long value) { FT_Generic.ndata(address(), value); return this; } + /** Sets the specified value to the {@code finalizer} field. */ + public Buffer finalizer(@NativeType("FT_Generic_Finalizer") FT_Generic_FinalizerI value) { FT_Generic.nfinalizer(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Generic_Finalizer.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Generic_Finalizer.java new file mode 100644 index 00000000..e7a98696 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Generic_Finalizer.java @@ -0,0 +1,73 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     void *object
+ * )
+ */ +public abstract class FT_Generic_Finalizer extends Callback implements FT_Generic_FinalizerI { + + /** + * Creates a {@code FT_Generic_Finalizer} instance from the specified function pointer. + * + * @return the new {@code FT_Generic_Finalizer} + */ + public static FT_Generic_Finalizer create(long functionPointer) { + FT_Generic_FinalizerI instance = Callback.get(functionPointer); + return instance instanceof FT_Generic_Finalizer + ? (FT_Generic_Finalizer)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Generic_Finalizer createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Generic_Finalizer} instance that delegates to the specified {@code FT_Generic_FinalizerI} instance. */ + public static FT_Generic_Finalizer create(FT_Generic_FinalizerI instance) { + return instance instanceof FT_Generic_Finalizer + ? (FT_Generic_Finalizer)instance + : new Container(instance.address(), instance); + } + + protected FT_Generic_Finalizer() { + super(CIF); + } + + FT_Generic_Finalizer(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Generic_Finalizer { + + private final FT_Generic_FinalizerI delegate; + + Container(long functionPointer, FT_Generic_FinalizerI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long object) { + delegate.invoke(object); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Generic_FinalizerI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Generic_FinalizerI.java new file mode 100644 index 00000000..dd032ace --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Generic_FinalizerI.java @@ -0,0 +1,50 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     void *object
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Generic_Finalizer") +public interface FT_Generic_FinalizerI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_void, + ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + invoke( + memGetAddress(memGetAddress(args)) + ); + } + + /** + * Describe a function used to destroy the {@code client} data of any FreeType object. + * + * @param object the address of the FreeType object that is under finalization. Its client data is accessed through its {@code generic} field. + */ + void invoke(@NativeType("void *") long object); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Glyph.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Glyph.java new file mode 100644 index 00000000..77fbbcff --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Glyph.java @@ -0,0 +1,181 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The root glyph structure contains a given glyph image plus its advance width in 16.16 fixed-point format. + * + *

Layout

+ * + *

+ * struct FT_GlyphRec {
+ *     FT_Library library;
+ *     FT_Glyph_Class const * clazz;
+ *     FT_Glyph_Format format;
+ *     {@link FT_Vector FT_Vector} advance;
+ * }
+ */ +@NativeType("struct FT_GlyphRec") +public class FT_Glyph extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + LIBRARY, + CLAZZ, + FORMAT, + ADVANCE; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(4), + __member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + LIBRARY = layout.offsetof(0); + CLAZZ = layout.offsetof(1); + FORMAT = layout.offsetof(2); + ADVANCE = layout.offsetof(3); + } + + protected FT_Glyph(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Glyph create(long address, @Nullable ByteBuffer container) { + return new FT_Glyph(address, container); + } + + /** + * Creates a {@code FT_Glyph} instance at the current position of the specified {@link 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 FT_Glyph(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code library} field. */ + @NativeType("FT_Library") + public long library() { return nlibrary(address()); } + /** @return the value of the {@code format} field. */ + @NativeType("FT_Glyph_Format") + public int format() { return nformat(address()); } + /** @return a {@link FT_Vector} view of the {@code advance} field. */ + public FT_Vector advance() { return nadvance(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Glyph} instance for the specified memory address. */ + public static FT_Glyph create(long address) { + return new FT_Glyph(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Glyph createSafe(long address) { + return address == NULL ? null : new FT_Glyph(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #library}. */ + public static long nlibrary(long struct) { return memGetAddress(struct + FT_Glyph.LIBRARY); } + public static long nclazz(long struct) { return memGetAddress(struct + FT_Glyph.CLAZZ); } + /** Unsafe version of {@link #format}. */ + public static int nformat(long struct) { return UNSAFE.getInt(null, struct + FT_Glyph.FORMAT); } + /** Unsafe version of {@link #advance}. */ + public static FT_Vector nadvance(long struct) { return FT_Vector.create(struct + FT_Glyph.ADVANCE); } + + // ----------------------------------- + + /** An array of {@link FT_Glyph} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_Glyph ELEMENT_FACTORY = FT_Glyph.create(-1L); + + /** + * Creates a new {@code FT_Glyph.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 {@link FT_Glyph#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Glyph getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code library} field. */ + @NativeType("FT_Library") + public long library() { return FT_Glyph.nlibrary(address()); } + /** @return the value of the {@code format} field. */ + @NativeType("FT_Glyph_Format") + public int format() { return FT_Glyph.nformat(address()); } + /** @return a {@link FT_Vector} view of the {@code advance} field. */ + public FT_Vector advance() { return FT_Glyph.nadvance(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_GlyphSlot.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_GlyphSlot.java new file mode 100644 index 00000000..cf0f922d --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_GlyphSlot.java @@ -0,0 +1,352 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * FreeType root glyph slot class structure. A glyph slot is a container where individual glyphs can be loaded, be they in outline or bitmap format. + * + *

Layout

+ * + *

+ * struct FT_GlyphSlotRec {
+ *     FT_Library library;
+ *     {@link FT_Face FT_Face} face;
+ *     {@link FT_GlyphSlot FT_GlyphSlot} next;
+ *     FT_UInt glyph_index;
+ *     {@link FT_Generic FT_Generic} generic;
+ *     {@link FT_Glyph_Metrics FT_Glyph_Metrics} metrics;
+ *     FT_Fixed linearHoriAdvance;
+ *     FT_Fixed linearVertAdvance;
+ *     {@link FT_Vector FT_Vector} advance;
+ *     FT_Glyph_Format format;
+ *     {@link FT_Bitmap FT_Bitmap} bitmap;
+ *     FT_Int bitmap_left;
+ *     FT_Int bitmap_top;
+ *     {@link FT_Outline FT_Outline} outline;
+ *     FT_UInt num_subglyphs;
+ *     FT_SubGlyph subglyphs;
+ *     void * control_data;
+ *     long control_len;
+ *     FT_Pos lsb_delta;
+ *     FT_Pos rsb_delta;
+ *     void * other;
+ *     FT_Slot_Internal internal;
+ * }
+ */ +@NativeType("struct FT_GlyphSlotRec") +public class FT_GlyphSlot extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + LIBRARY, + FACE, + NEXT, + GLYPH_INDEX, + GENERIC, + METRICS, + LINEARHORIADVANCE, + LINEARVERTADVANCE, + ADVANCE, + FORMAT, + BITMAP, + BITMAP_LEFT, + BITMAP_TOP, + OUTLINE, + NUM_SUBGLYPHS, + SUBGLYPHS, + CONTROL_DATA, + CONTROL_LEN, + LSB_DELTA, + RSB_DELTA, + OTHER, + INTERNAL; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(4), + __member(FT_Generic.SIZEOF, FT_Generic.ALIGNOF), + __member(FT_Glyph_Metrics.SIZEOF, FT_Glyph_Metrics.ALIGNOF), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF), + __member(4), + __member(FT_Bitmap.SIZEOF, FT_Bitmap.ALIGNOF), + __member(4), + __member(4), + __member(FT_Outline.SIZEOF, FT_Outline.ALIGNOF), + __member(4), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + LIBRARY = layout.offsetof(0); + FACE = layout.offsetof(1); + NEXT = layout.offsetof(2); + GLYPH_INDEX = layout.offsetof(3); + GENERIC = layout.offsetof(4); + METRICS = layout.offsetof(5); + LINEARHORIADVANCE = layout.offsetof(6); + LINEARVERTADVANCE = layout.offsetof(7); + ADVANCE = layout.offsetof(8); + FORMAT = layout.offsetof(9); + BITMAP = layout.offsetof(10); + BITMAP_LEFT = layout.offsetof(11); + BITMAP_TOP = layout.offsetof(12); + OUTLINE = layout.offsetof(13); + NUM_SUBGLYPHS = layout.offsetof(14); + SUBGLYPHS = layout.offsetof(15); + CONTROL_DATA = layout.offsetof(16); + CONTROL_LEN = layout.offsetof(17); + LSB_DELTA = layout.offsetof(18); + RSB_DELTA = layout.offsetof(19); + OTHER = layout.offsetof(20); + INTERNAL = layout.offsetof(21); + } + + protected FT_GlyphSlot(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_GlyphSlot create(long address, @Nullable ByteBuffer container) { + return new FT_GlyphSlot(address, container); + } + + /** + * Creates a {@code FT_GlyphSlot} instance at the current position of the specified {@link 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 FT_GlyphSlot(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code library} field. */ + @NativeType("FT_Library") + public long library() { return nlibrary(address()); } + /** @return a {@link FT_Face} view of the struct pointed to by the {@code face} field. */ + public FT_Face face() { return nface(address()); } + /** @return a {@link FT_GlyphSlot} view of the struct pointed to by the {@code next} field. */ + @Nullable + public FT_GlyphSlot next() { return nnext(address()); } + /** @return the value of the {@code glyph_index} field. */ + @NativeType("FT_UInt") + public int glyph_index() { return nglyph_index(address()); } + /** @return a {@link FT_Generic} view of the {@code generic} field. */ + public FT_Generic generic() { return ngeneric(address()); } + /** @return a {@link FT_Glyph_Metrics} view of the {@code metrics} field. */ + public FT_Glyph_Metrics metrics() { return nmetrics(address()); } + /** @return the value of the {@code linearHoriAdvance} field. */ + @NativeType("FT_Fixed") + public long linearHoriAdvance() { return nlinearHoriAdvance(address()); } + /** @return the value of the {@code linearVertAdvance} field. */ + @NativeType("FT_Fixed") + public long linearVertAdvance() { return nlinearVertAdvance(address()); } + /** @return a {@link FT_Vector} view of the {@code advance} field. */ + public FT_Vector advance() { return nadvance(address()); } + /** @return the value of the {@code format} field. */ + @NativeType("FT_Glyph_Format") + public int format() { return nformat(address()); } + /** @return a {@link FT_Bitmap} view of the {@code bitmap} field. */ + public FT_Bitmap bitmap() { return nbitmap(address()); } + /** @return the value of the {@code bitmap_left} field. */ + @NativeType("FT_Int") + public int bitmap_left() { return nbitmap_left(address()); } + /** @return the value of the {@code bitmap_top} field. */ + @NativeType("FT_Int") + public int bitmap_top() { return nbitmap_top(address()); } + /** @return a {@link FT_Outline} view of the {@code outline} field. */ + public FT_Outline outline() { return noutline(address()); } + /** @return the value of the {@code lsb_delta} field. */ + @NativeType("FT_Pos") + public long lsb_delta() { return nlsb_delta(address()); } + /** @return the value of the {@code rsb_delta} field. */ + @NativeType("FT_Pos") + public long rsb_delta() { return nrsb_delta(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_GlyphSlot} instance for the specified memory address. */ + public static FT_GlyphSlot create(long address) { + return new FT_GlyphSlot(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_GlyphSlot createSafe(long address) { + return address == NULL ? null : new FT_GlyphSlot(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #library}. */ + public static long nlibrary(long struct) { return memGetAddress(struct + FT_GlyphSlot.LIBRARY); } + /** Unsafe version of {@link #face}. */ + public static FT_Face nface(long struct) { return FT_Face.create(memGetAddress(struct + FT_GlyphSlot.FACE)); } + /** Unsafe version of {@link #next}. */ + @Nullable public static FT_GlyphSlot nnext(long struct) { return FT_GlyphSlot.createSafe(memGetAddress(struct + FT_GlyphSlot.NEXT)); } + /** Unsafe version of {@link #glyph_index}. */ + public static int nglyph_index(long struct) { return UNSAFE.getInt(null, struct + FT_GlyphSlot.GLYPH_INDEX); } + /** Unsafe version of {@link #generic}. */ + public static FT_Generic ngeneric(long struct) { return FT_Generic.create(struct + FT_GlyphSlot.GENERIC); } + /** Unsafe version of {@link #metrics}. */ + public static FT_Glyph_Metrics nmetrics(long struct) { return FT_Glyph_Metrics.create(struct + FT_GlyphSlot.METRICS); } + /** Unsafe version of {@link #linearHoriAdvance}. */ + public static long nlinearHoriAdvance(long struct) { return memGetCLong(struct + FT_GlyphSlot.LINEARHORIADVANCE); } + /** Unsafe version of {@link #linearVertAdvance}. */ + public static long nlinearVertAdvance(long struct) { return memGetCLong(struct + FT_GlyphSlot.LINEARVERTADVANCE); } + /** Unsafe version of {@link #advance}. */ + public static FT_Vector nadvance(long struct) { return FT_Vector.create(struct + FT_GlyphSlot.ADVANCE); } + /** Unsafe version of {@link #format}. */ + public static int nformat(long struct) { return UNSAFE.getInt(null, struct + FT_GlyphSlot.FORMAT); } + /** Unsafe version of {@link #bitmap}. */ + public static FT_Bitmap nbitmap(long struct) { return FT_Bitmap.create(struct + FT_GlyphSlot.BITMAP); } + /** Unsafe version of {@link #bitmap_left}. */ + public static int nbitmap_left(long struct) { return UNSAFE.getInt(null, struct + FT_GlyphSlot.BITMAP_LEFT); } + /** Unsafe version of {@link #bitmap_top}. */ + public static int nbitmap_top(long struct) { return UNSAFE.getInt(null, struct + FT_GlyphSlot.BITMAP_TOP); } + /** Unsafe version of {@link #outline}. */ + public static FT_Outline noutline(long struct) { return FT_Outline.create(struct + FT_GlyphSlot.OUTLINE); } + public static int nnum_subglyphs(long struct) { return UNSAFE.getInt(null, struct + FT_GlyphSlot.NUM_SUBGLYPHS); } + public static long nsubglyphs(long struct) { return memGetAddress(struct + FT_GlyphSlot.SUBGLYPHS); } + @Nullable public static ByteBuffer ncontrol_data(long struct) { return memByteBufferSafe(memGetAddress(struct + FT_GlyphSlot.CONTROL_DATA), (int)ncontrol_len(struct)); } + public static long ncontrol_len(long struct) { return memGetCLong(struct + FT_GlyphSlot.CONTROL_LEN); } + /** Unsafe version of {@link #lsb_delta}. */ + public static long nlsb_delta(long struct) { return memGetCLong(struct + FT_GlyphSlot.LSB_DELTA); } + /** Unsafe version of {@link #rsb_delta}. */ + public static long nrsb_delta(long struct) { return memGetCLong(struct + FT_GlyphSlot.RSB_DELTA); } + public static long nother(long struct) { return memGetAddress(struct + FT_GlyphSlot.OTHER); } + public static long ninternal(long struct) { return memGetAddress(struct + FT_GlyphSlot.INTERNAL); } + + // ----------------------------------- + + /** An array of {@link FT_GlyphSlot} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_GlyphSlot ELEMENT_FACTORY = FT_GlyphSlot.create(-1L); + + /** + * Creates a new {@code FT_GlyphSlot.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 {@link FT_GlyphSlot#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_GlyphSlot getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code library} field. */ + @NativeType("FT_Library") + public long library() { return FT_GlyphSlot.nlibrary(address()); } + /** @return a {@link FT_Face} view of the struct pointed to by the {@code face} field. */ + public FT_Face face() { return FT_GlyphSlot.nface(address()); } + /** @return a {@link FT_GlyphSlot} view of the struct pointed to by the {@code next} field. */ + @Nullable + public FT_GlyphSlot next() { return FT_GlyphSlot.nnext(address()); } + /** @return the value of the {@code glyph_index} field. */ + @NativeType("FT_UInt") + public int glyph_index() { return FT_GlyphSlot.nglyph_index(address()); } + /** @return a {@link FT_Generic} view of the {@code generic} field. */ + public FT_Generic generic() { return FT_GlyphSlot.ngeneric(address()); } + /** @return a {@link FT_Glyph_Metrics} view of the {@code metrics} field. */ + public FT_Glyph_Metrics metrics() { return FT_GlyphSlot.nmetrics(address()); } + /** @return the value of the {@code linearHoriAdvance} field. */ + @NativeType("FT_Fixed") + public long linearHoriAdvance() { return FT_GlyphSlot.nlinearHoriAdvance(address()); } + /** @return the value of the {@code linearVertAdvance} field. */ + @NativeType("FT_Fixed") + public long linearVertAdvance() { return FT_GlyphSlot.nlinearVertAdvance(address()); } + /** @return a {@link FT_Vector} view of the {@code advance} field. */ + public FT_Vector advance() { return FT_GlyphSlot.nadvance(address()); } + /** @return the value of the {@code format} field. */ + @NativeType("FT_Glyph_Format") + public int format() { return FT_GlyphSlot.nformat(address()); } + /** @return a {@link FT_Bitmap} view of the {@code bitmap} field. */ + public FT_Bitmap bitmap() { return FT_GlyphSlot.nbitmap(address()); } + /** @return the value of the {@code bitmap_left} field. */ + @NativeType("FT_Int") + public int bitmap_left() { return FT_GlyphSlot.nbitmap_left(address()); } + /** @return the value of the {@code bitmap_top} field. */ + @NativeType("FT_Int") + public int bitmap_top() { return FT_GlyphSlot.nbitmap_top(address()); } + /** @return a {@link FT_Outline} view of the {@code outline} field. */ + public FT_Outline outline() { return FT_GlyphSlot.noutline(address()); } + /** @return the value of the {@code lsb_delta} field. */ + @NativeType("FT_Pos") + public long lsb_delta() { return FT_GlyphSlot.nlsb_delta(address()); } + /** @return the value of the {@code rsb_delta} field. */ + @NativeType("FT_Pos") + public long rsb_delta() { return FT_GlyphSlot.nrsb_delta(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Glyph_Metrics.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Glyph_Metrics.java new file mode 100644 index 00000000..6642ed8d --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Glyph_Metrics.java @@ -0,0 +1,250 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure to model the metrics of a single glyph. + * + *

The values are expressed in 26.6 fractional pixel format; if the flag {@link FreeType#FT_LOAD_NO_SCALE LOAD_NO_SCALE} has been used while loading the glyph, values are expressed in + * font units instead.

+ * + *
Note
+ * + *

If not disabled with {@link FreeType#FT_LOAD_NO_HINTING LOAD_NO_HINTING}, the values represent dimensions of the hinted glyph (in case hinting is applicable).

+ * + *

Stroking a glyph with an outside border does not increase {@code horiAdvance} or {@code vertAdvance}; you have to manually adjust these values to + * account for the added width and height.

+ * + *

FreeType doesn't use the {@code VORG} table data for CFF fonts because it doesn't have an interface to quickly retrieve the glyph height. The + * y~coordinate of the vertical origin can be simply computed as {@code vertBearingY + height} after loading a glyph.

+ * + *

Layout

+ * + *

+ * struct FT_Glyph_Metrics {
+ *     FT_Pos {@link #width};
+ *     FT_Pos {@link #height};
+ *     FT_Pos {@link #horiBearingX};
+ *     FT_Pos {@link #horiBearingY};
+ *     FT_Pos {@link #horiAdvance};
+ *     FT_Pos {@link #vertBearingX};
+ *     FT_Pos {@link #vertBearingY};
+ *     FT_Pos {@link #vertAdvance};
+ * }
+ */ +public class FT_Glyph_Metrics extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + WIDTH, + HEIGHT, + HORIBEARINGX, + HORIBEARINGY, + HORIADVANCE, + VERTBEARINGX, + VERTBEARINGY, + VERTADVANCE; + + static { + Layout layout = __struct( + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + WIDTH = layout.offsetof(0); + HEIGHT = layout.offsetof(1); + HORIBEARINGX = layout.offsetof(2); + HORIBEARINGY = layout.offsetof(3); + HORIADVANCE = layout.offsetof(4); + VERTBEARINGX = layout.offsetof(5); + VERTBEARINGY = layout.offsetof(6); + VERTADVANCE = layout.offsetof(7); + } + + protected FT_Glyph_Metrics(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Glyph_Metrics create(long address, @Nullable ByteBuffer container) { + return new FT_Glyph_Metrics(address, container); + } + + /** + * Creates a {@code FT_Glyph_Metrics} instance at the current position of the specified {@link 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 FT_Glyph_Metrics(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** the glyph's width */ + @NativeType("FT_Pos") + public long width() { return nwidth(address()); } + /** the glyph's height */ + @NativeType("FT_Pos") + public long height() { return nheight(address()); } + /** left side bearing for horizontal layout */ + @NativeType("FT_Pos") + public long horiBearingX() { return nhoriBearingX(address()); } + /** top side bearing for horizontal layout */ + @NativeType("FT_Pos") + public long horiBearingY() { return nhoriBearingY(address()); } + /** advance width for horizontal layout */ + @NativeType("FT_Pos") + public long horiAdvance() { return nhoriAdvance(address()); } + /** left side bearing for vertical layout */ + @NativeType("FT_Pos") + public long vertBearingX() { return nvertBearingX(address()); } + /** top side bearing for vertical layout. Larger positive values mean further below the vertical glyph origin */ + @NativeType("FT_Pos") + public long vertBearingY() { return nvertBearingY(address()); } + /** advance height for vertical layout. Positive values mean the glyph has a positive advance downward */ + @NativeType("FT_Pos") + public long vertAdvance() { return nvertAdvance(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Glyph_Metrics} instance for the specified memory address. */ + public static FT_Glyph_Metrics create(long address) { + return new FT_Glyph_Metrics(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Glyph_Metrics createSafe(long address) { + return address == NULL ? null : new FT_Glyph_Metrics(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #width}. */ + public static long nwidth(long struct) { return memGetCLong(struct + FT_Glyph_Metrics.WIDTH); } + /** Unsafe version of {@link #height}. */ + public static long nheight(long struct) { return memGetCLong(struct + FT_Glyph_Metrics.HEIGHT); } + /** Unsafe version of {@link #horiBearingX}. */ + public static long nhoriBearingX(long struct) { return memGetCLong(struct + FT_Glyph_Metrics.HORIBEARINGX); } + /** Unsafe version of {@link #horiBearingY}. */ + public static long nhoriBearingY(long struct) { return memGetCLong(struct + FT_Glyph_Metrics.HORIBEARINGY); } + /** Unsafe version of {@link #horiAdvance}. */ + public static long nhoriAdvance(long struct) { return memGetCLong(struct + FT_Glyph_Metrics.HORIADVANCE); } + /** Unsafe version of {@link #vertBearingX}. */ + public static long nvertBearingX(long struct) { return memGetCLong(struct + FT_Glyph_Metrics.VERTBEARINGX); } + /** Unsafe version of {@link #vertBearingY}. */ + public static long nvertBearingY(long struct) { return memGetCLong(struct + FT_Glyph_Metrics.VERTBEARINGY); } + /** Unsafe version of {@link #vertAdvance}. */ + public static long nvertAdvance(long struct) { return memGetCLong(struct + FT_Glyph_Metrics.VERTADVANCE); } + + // ----------------------------------- + + /** An array of {@link FT_Glyph_Metrics} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_Glyph_Metrics ELEMENT_FACTORY = FT_Glyph_Metrics.create(-1L); + + /** + * Creates a new {@code FT_Glyph_Metrics.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 {@link FT_Glyph_Metrics#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Glyph_Metrics getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@link FT_Glyph_Metrics#width} field. */ + @NativeType("FT_Pos") + public long width() { return FT_Glyph_Metrics.nwidth(address()); } + /** @return the value of the {@link FT_Glyph_Metrics#height} field. */ + @NativeType("FT_Pos") + public long height() { return FT_Glyph_Metrics.nheight(address()); } + /** @return the value of the {@link FT_Glyph_Metrics#horiBearingX} field. */ + @NativeType("FT_Pos") + public long horiBearingX() { return FT_Glyph_Metrics.nhoriBearingX(address()); } + /** @return the value of the {@link FT_Glyph_Metrics#horiBearingY} field. */ + @NativeType("FT_Pos") + public long horiBearingY() { return FT_Glyph_Metrics.nhoriBearingY(address()); } + /** @return the value of the {@link FT_Glyph_Metrics#horiAdvance} field. */ + @NativeType("FT_Pos") + public long horiAdvance() { return FT_Glyph_Metrics.nhoriAdvance(address()); } + /** @return the value of the {@link FT_Glyph_Metrics#vertBearingX} field. */ + @NativeType("FT_Pos") + public long vertBearingX() { return FT_Glyph_Metrics.nvertBearingX(address()); } + /** @return the value of the {@link FT_Glyph_Metrics#vertBearingY} field. */ + @NativeType("FT_Pos") + public long vertBearingY() { return FT_Glyph_Metrics.nvertBearingY(address()); } + /** @return the value of the {@link FT_Glyph_Metrics#vertAdvance} field. */ + @NativeType("FT_Pos") + public long vertAdvance() { return FT_Glyph_Metrics.nvertAdvance(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_FreeGlyphDataFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_FreeGlyphDataFunc.java new file mode 100644 index 00000000..94dfe4ed --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_FreeGlyphDataFunc.java @@ -0,0 +1,74 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     FT_Incremental incremental,
+ *     FT_Data *data
+ * )
+ */ +public abstract class FT_Incremental_FreeGlyphDataFunc extends Callback implements FT_Incremental_FreeGlyphDataFuncI { + + /** + * Creates a {@code FT_Incremental_FreeGlyphDataFunc} instance from the specified function pointer. + * + * @return the new {@code FT_Incremental_FreeGlyphDataFunc} + */ + public static FT_Incremental_FreeGlyphDataFunc create(long functionPointer) { + FT_Incremental_FreeGlyphDataFuncI instance = Callback.get(functionPointer); + return instance instanceof FT_Incremental_FreeGlyphDataFunc + ? (FT_Incremental_FreeGlyphDataFunc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Incremental_FreeGlyphDataFunc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Incremental_FreeGlyphDataFunc} instance that delegates to the specified {@code FT_Incremental_FreeGlyphDataFuncI} instance. */ + public static FT_Incremental_FreeGlyphDataFunc create(FT_Incremental_FreeGlyphDataFuncI instance) { + return instance instanceof FT_Incremental_FreeGlyphDataFunc + ? (FT_Incremental_FreeGlyphDataFunc)instance + : new Container(instance.address(), instance); + } + + protected FT_Incremental_FreeGlyphDataFunc() { + super(CIF); + } + + FT_Incremental_FreeGlyphDataFunc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Incremental_FreeGlyphDataFunc { + + private final FT_Incremental_FreeGlyphDataFuncI delegate; + + Container(long functionPointer, FT_Incremental_FreeGlyphDataFuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long incremental, long data) { + delegate.invoke(incremental, data); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_FreeGlyphDataFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_FreeGlyphDataFuncI.java new file mode 100644 index 00000000..e70c4bd3 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_FreeGlyphDataFuncI.java @@ -0,0 +1,48 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     FT_Incremental incremental,
+ *     FT_Data *data
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Incremental_FreeGlyphDataFunc") +public interface FT_Incremental_FreeGlyphDataFuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_void, + ffi_type_pointer, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + invoke( + memGetAddress(memGetAddress(args)), + memGetAddress(memGetAddress(args + POINTER_SIZE)) + ); + } + + /** A function used to release the glyph data bytes returned by a successful call to {@link FT_Incremental_GetGlyphDataFunc}. */ + void invoke(@NativeType("FT_Incremental") long incremental, @NativeType("FT_Data *") long data); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_Funcs.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_Funcs.java new file mode 100644 index 00000000..30df7fed --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_Funcs.java @@ -0,0 +1,315 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A table of functions for accessing fonts that load data incrementally. Used in {@link FT_Incremental_Interface}. + * + *

Layout

+ * + *

+ * struct FT_Incremental_FuncsRec {
+ *     {@link FT_Incremental_GetGlyphDataFuncI FT_Incremental_GetGlyphDataFunc} get_glyph_data;
+ *     {@link FT_Incremental_FreeGlyphDataFuncI FT_Incremental_FreeGlyphDataFunc} free_glyph_data;
+ *     {@link FT_Incremental_GetGlyphMetricsFuncI FT_Incremental_GetGlyphMetricsFunc} get_glyph_metrics;
+ * }
+ */ +@NativeType("struct FT_Incremental_FuncsRec") +public class FT_Incremental_Funcs extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + GET_GLYPH_DATA, + FREE_GLYPH_DATA, + GET_GLYPH_METRICS; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + GET_GLYPH_DATA = layout.offsetof(0); + FREE_GLYPH_DATA = layout.offsetof(1); + GET_GLYPH_METRICS = layout.offsetof(2); + } + + protected FT_Incremental_Funcs(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Incremental_Funcs create(long address, @Nullable ByteBuffer container) { + return new FT_Incremental_Funcs(address, container); + } + + /** + * Creates a {@code FT_Incremental_Funcs} instance at the current position of the specified {@link 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 FT_Incremental_Funcs(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code get_glyph_data} field. */ + public FT_Incremental_GetGlyphDataFunc get_glyph_data() { return nget_glyph_data(address()); } + /** @return the value of the {@code free_glyph_data} field. */ + public FT_Incremental_FreeGlyphDataFunc free_glyph_data() { return nfree_glyph_data(address()); } + /** @return the value of the {@code get_glyph_metrics} field. */ + @Nullable + public FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics() { return nget_glyph_metrics(address()); } + + /** Sets the specified value to the {@code get_glyph_data} field. */ + public FT_Incremental_Funcs get_glyph_data(@NativeType("FT_Incremental_GetGlyphDataFunc") FT_Incremental_GetGlyphDataFuncI value) { nget_glyph_data(address(), value); return this; } + /** Sets the specified value to the {@code free_glyph_data} field. */ + public FT_Incremental_Funcs free_glyph_data(@NativeType("FT_Incremental_FreeGlyphDataFunc") FT_Incremental_FreeGlyphDataFuncI value) { nfree_glyph_data(address(), value); return this; } + /** Sets the specified value to the {@code get_glyph_metrics} field. */ + public FT_Incremental_Funcs get_glyph_metrics(@Nullable @NativeType("FT_Incremental_GetGlyphMetricsFunc") FT_Incremental_GetGlyphMetricsFuncI value) { nget_glyph_metrics(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_Incremental_Funcs set( + FT_Incremental_GetGlyphDataFuncI get_glyph_data, + FT_Incremental_FreeGlyphDataFuncI free_glyph_data, + FT_Incremental_GetGlyphMetricsFuncI get_glyph_metrics + ) { + get_glyph_data(get_glyph_data); + free_glyph_data(free_glyph_data); + get_glyph_metrics(get_glyph_metrics); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Incremental_Funcs set(FT_Incremental_Funcs src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Incremental_Funcs} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Incremental_Funcs malloc() { + return new FT_Incremental_Funcs(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Incremental_Funcs} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Incremental_Funcs calloc() { + return new FT_Incremental_Funcs(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Incremental_Funcs} instance allocated with {@link BufferUtils}. */ + public static FT_Incremental_Funcs create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Incremental_Funcs(memAddress(container), container); + } + + /** Returns a new {@code FT_Incremental_Funcs} instance for the specified memory address. */ + public static FT_Incremental_Funcs create(long address) { + return new FT_Incremental_Funcs(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Incremental_Funcs createSafe(long address) { + return address == NULL ? null : new FT_Incremental_Funcs(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Incremental_Funcs} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Incremental_Funcs malloc(MemoryStack stack) { + return new FT_Incremental_Funcs(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Incremental_Funcs} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Incremental_Funcs calloc(MemoryStack stack) { + return new FT_Incremental_Funcs(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #get_glyph_data}. */ + public static FT_Incremental_GetGlyphDataFunc nget_glyph_data(long struct) { return FT_Incremental_GetGlyphDataFunc.create(memGetAddress(struct + FT_Incremental_Funcs.GET_GLYPH_DATA)); } + /** Unsafe version of {@link #free_glyph_data}. */ + public static FT_Incremental_FreeGlyphDataFunc nfree_glyph_data(long struct) { return FT_Incremental_FreeGlyphDataFunc.create(memGetAddress(struct + FT_Incremental_Funcs.FREE_GLYPH_DATA)); } + /** Unsafe version of {@link #get_glyph_metrics}. */ + @Nullable public static FT_Incremental_GetGlyphMetricsFunc nget_glyph_metrics(long struct) { return FT_Incremental_GetGlyphMetricsFunc.createSafe(memGetAddress(struct + FT_Incremental_Funcs.GET_GLYPH_METRICS)); } + + /** Unsafe version of {@link #get_glyph_data(FT_Incremental_GetGlyphDataFuncI) get_glyph_data}. */ + public static void nget_glyph_data(long struct, FT_Incremental_GetGlyphDataFuncI value) { memPutAddress(struct + FT_Incremental_Funcs.GET_GLYPH_DATA, value.address()); } + /** Unsafe version of {@link #free_glyph_data(FT_Incremental_FreeGlyphDataFuncI) free_glyph_data}. */ + public static void nfree_glyph_data(long struct, FT_Incremental_FreeGlyphDataFuncI value) { memPutAddress(struct + FT_Incremental_Funcs.FREE_GLYPH_DATA, value.address()); } + /** Unsafe version of {@link #get_glyph_metrics(FT_Incremental_GetGlyphMetricsFuncI) get_glyph_metrics}. */ + public static void nget_glyph_metrics(long struct, @Nullable FT_Incremental_GetGlyphMetricsFuncI value) { memPutAddress(struct + FT_Incremental_Funcs.GET_GLYPH_METRICS, memAddressSafe(value)); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + FT_Incremental_Funcs.GET_GLYPH_DATA)); + check(memGetAddress(struct + FT_Incremental_Funcs.FREE_GLYPH_DATA)); + } + + // ----------------------------------- + + /** An array of {@link FT_Incremental_Funcs} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Incremental_Funcs ELEMENT_FACTORY = FT_Incremental_Funcs.create(-1L); + + /** + * Creates a new {@code FT_Incremental_Funcs.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 {@link FT_Incremental_Funcs#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Incremental_Funcs getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code get_glyph_data} field. */ + public FT_Incremental_GetGlyphDataFunc get_glyph_data() { return FT_Incremental_Funcs.nget_glyph_data(address()); } + /** @return the value of the {@code free_glyph_data} field. */ + public FT_Incremental_FreeGlyphDataFunc free_glyph_data() { return FT_Incremental_Funcs.nfree_glyph_data(address()); } + /** @return the value of the {@code get_glyph_metrics} field. */ + @Nullable + public FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics() { return FT_Incremental_Funcs.nget_glyph_metrics(address()); } + + /** Sets the specified value to the {@code get_glyph_data} field. */ + public Buffer get_glyph_data(@NativeType("FT_Incremental_GetGlyphDataFunc") FT_Incremental_GetGlyphDataFuncI value) { FT_Incremental_Funcs.nget_glyph_data(address(), value); return this; } + /** Sets the specified value to the {@code free_glyph_data} field. */ + public Buffer free_glyph_data(@NativeType("FT_Incremental_FreeGlyphDataFunc") FT_Incremental_FreeGlyphDataFuncI value) { FT_Incremental_Funcs.nfree_glyph_data(address(), value); return this; } + /** Sets the specified value to the {@code get_glyph_metrics} field. */ + public Buffer get_glyph_metrics(@Nullable @NativeType("FT_Incremental_GetGlyphMetricsFunc") FT_Incremental_GetGlyphMetricsFuncI value) { FT_Incremental_Funcs.nget_glyph_metrics(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphDataFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphDataFunc.java new file mode 100644 index 00000000..74ae8b85 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphDataFunc.java @@ -0,0 +1,75 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * FT_Error (*{@link #invoke}) (
+ *     FT_Incremental incremental,
+ *     FT_UInt glyph_index,
+ *     FT_Data *adata
+ * )
+ */ +public abstract class FT_Incremental_GetGlyphDataFunc extends Callback implements FT_Incremental_GetGlyphDataFuncI { + + /** + * Creates a {@code FT_Incremental_GetGlyphDataFunc} instance from the specified function pointer. + * + * @return the new {@code FT_Incremental_GetGlyphDataFunc} + */ + public static FT_Incremental_GetGlyphDataFunc create(long functionPointer) { + FT_Incremental_GetGlyphDataFuncI instance = Callback.get(functionPointer); + return instance instanceof FT_Incremental_GetGlyphDataFunc + ? (FT_Incremental_GetGlyphDataFunc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Incremental_GetGlyphDataFunc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Incremental_GetGlyphDataFunc} instance that delegates to the specified {@code FT_Incremental_GetGlyphDataFuncI} instance. */ + public static FT_Incremental_GetGlyphDataFunc create(FT_Incremental_GetGlyphDataFuncI instance) { + return instance instanceof FT_Incremental_GetGlyphDataFunc + ? (FT_Incremental_GetGlyphDataFunc)instance + : new Container(instance.address(), instance); + } + + protected FT_Incremental_GetGlyphDataFunc() { + super(CIF); + } + + FT_Incremental_GetGlyphDataFunc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Incremental_GetGlyphDataFunc { + + private final FT_Incremental_GetGlyphDataFuncI delegate; + + Container(long functionPointer, FT_Incremental_GetGlyphDataFuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public int invoke(long incremental, int glyph_index, long adata) { + return delegate.invoke(incremental, glyph_index, adata); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphDataFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphDataFuncI.java new file mode 100644 index 00000000..1fa3ad8e --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphDataFuncI.java @@ -0,0 +1,51 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * FT_Error (*{@link #invoke}) (
+ *     FT_Incremental incremental,
+ *     FT_UInt glyph_index,
+ *     FT_Data *adata
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Incremental_GetGlyphDataFunc") +public interface FT_Incremental_GetGlyphDataFuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_sint32, + ffi_type_pointer, ffi_type_uint32, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + int __result = invoke( + memGetAddress(memGetAddress(args)), + memGetInt(memGetAddress(args + POINTER_SIZE)), + memGetAddress(memGetAddress(args + 2 * POINTER_SIZE)) + ); + apiClosureRet(ret, __result); + } + + /** A function called by FreeType to access a given glyph's data bytes during {@link FreeType#FT_Load_Glyph Load_Glyph} or {@link FreeType#FT_Load_Char Load_Char} if incremental loading is enabled. */ + @NativeType("FT_Error") int invoke(@NativeType("FT_Incremental") long incremental, @NativeType("FT_UInt") int glyph_index, @NativeType("FT_Data *") long adata); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphMetricsFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphMetricsFunc.java new file mode 100644 index 00000000..ad6b6ab3 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphMetricsFunc.java @@ -0,0 +1,76 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * FT_Error (*{@link #invoke}) (
+ *     FT_Incremental incremental,
+ *     FT_UInt glyph_index,
+ *     FT_Bool vertical,
+ *     FT_Incremental_MetricsRec *ametrics
+ * )
+ */ +public abstract class FT_Incremental_GetGlyphMetricsFunc extends Callback implements FT_Incremental_GetGlyphMetricsFuncI { + + /** + * Creates a {@code FT_Incremental_GetGlyphMetricsFunc} instance from the specified function pointer. + * + * @return the new {@code FT_Incremental_GetGlyphMetricsFunc} + */ + public static FT_Incremental_GetGlyphMetricsFunc create(long functionPointer) { + FT_Incremental_GetGlyphMetricsFuncI instance = Callback.get(functionPointer); + return instance instanceof FT_Incremental_GetGlyphMetricsFunc + ? (FT_Incremental_GetGlyphMetricsFunc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Incremental_GetGlyphMetricsFunc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Incremental_GetGlyphMetricsFunc} instance that delegates to the specified {@code FT_Incremental_GetGlyphMetricsFuncI} instance. */ + public static FT_Incremental_GetGlyphMetricsFunc create(FT_Incremental_GetGlyphMetricsFuncI instance) { + return instance instanceof FT_Incremental_GetGlyphMetricsFunc + ? (FT_Incremental_GetGlyphMetricsFunc)instance + : new Container(instance.address(), instance); + } + + protected FT_Incremental_GetGlyphMetricsFunc() { + super(CIF); + } + + FT_Incremental_GetGlyphMetricsFunc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Incremental_GetGlyphMetricsFunc { + + private final FT_Incremental_GetGlyphMetricsFuncI delegate; + + Container(long functionPointer, FT_Incremental_GetGlyphMetricsFuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public int invoke(long incremental, int glyph_index, boolean vertical, long ametrics) { + return delegate.invoke(incremental, glyph_index, vertical, ametrics); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphMetricsFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphMetricsFuncI.java new file mode 100644 index 00000000..b0d0ed1a --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphMetricsFuncI.java @@ -0,0 +1,53 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * FT_Error (*{@link #invoke}) (
+ *     FT_Incremental incremental,
+ *     FT_UInt glyph_index,
+ *     FT_Bool vertical,
+ *     FT_Incremental_MetricsRec *ametrics
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Incremental_GetGlyphMetricsFunc") +public interface FT_Incremental_GetGlyphMetricsFuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_sint32, + ffi_type_pointer, ffi_type_uint32, ffi_type_uint8, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + int __result = invoke( + memGetAddress(memGetAddress(args)), + memGetInt(memGetAddress(args + POINTER_SIZE)), + memGetByte(memGetAddress(args + 2 * POINTER_SIZE)) != 0, + memGetAddress(memGetAddress(args + 3 * POINTER_SIZE)) + ); + apiClosureRet(ret, __result); + } + + /** A function used to retrieve the basic metrics of a given glyph index before accessing its data. */ + @NativeType("FT_Error") int invoke(@NativeType("FT_Incremental") long incremental, @NativeType("FT_UInt") int glyph_index, @NativeType("FT_Bool") boolean vertical, @NativeType("FT_Incremental_MetricsRec *") long ametrics); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_Interface.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_Interface.java new file mode 100644 index 00000000..e993128a --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_Interface.java @@ -0,0 +1,300 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A structure to be used with {@link FreeType#FT_Open_Face Open_Face} to indicate that the user wants to support incremental glyph loading. + * + *

Layout

+ * + *

+ * struct FT_Incremental_InterfaceRec {
+ *     {@link FT_Incremental_Funcs FT_Incremental_FuncsRec} const * funcs;
+ *     FT_Incremental object;
+ * }
+ */ +@NativeType("struct FT_Incremental_InterfaceRec") +public class FT_Incremental_Interface extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + FUNCS, + OBJECT; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + FUNCS = layout.offsetof(0); + OBJECT = layout.offsetof(1); + } + + protected FT_Incremental_Interface(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Incremental_Interface create(long address, @Nullable ByteBuffer container) { + return new FT_Incremental_Interface(address, container); + } + + /** + * Creates a {@code FT_Incremental_Interface} instance at the current position of the specified {@link 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 FT_Incremental_Interface(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_Incremental_Funcs} view of the struct pointed to by the {@code funcs} field. */ + @NativeType("FT_Incremental_FuncsRec const *") + public FT_Incremental_Funcs funcs() { return nfuncs(address()); } + /** @return the value of the {@code object} field. */ + @NativeType("FT_Incremental") + public long object() { return nobject(address()); } + + /** Sets the address of the specified {@link FT_Incremental_Funcs} to the {@code funcs} field. */ + public FT_Incremental_Interface funcs(@NativeType("FT_Incremental_FuncsRec const *") FT_Incremental_Funcs value) { nfuncs(address(), value); return this; } + /** Sets the specified value to the {@code object} field. */ + public FT_Incremental_Interface object(@NativeType("FT_Incremental") long value) { nobject(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_Incremental_Interface set( + FT_Incremental_Funcs funcs, + long object + ) { + funcs(funcs); + object(object); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Incremental_Interface set(FT_Incremental_Interface src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Incremental_Interface} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Incremental_Interface malloc() { + return new FT_Incremental_Interface(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Incremental_Interface} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Incremental_Interface calloc() { + return new FT_Incremental_Interface(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Incremental_Interface} instance allocated with {@link BufferUtils}. */ + public static FT_Incremental_Interface create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Incremental_Interface(memAddress(container), container); + } + + /** Returns a new {@code FT_Incremental_Interface} instance for the specified memory address. */ + public static FT_Incremental_Interface create(long address) { + return new FT_Incremental_Interface(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Incremental_Interface createSafe(long address) { + return address == NULL ? null : new FT_Incremental_Interface(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Incremental_Interface} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Incremental_Interface malloc(MemoryStack stack) { + return new FT_Incremental_Interface(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Incremental_Interface} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Incremental_Interface calloc(MemoryStack stack) { + return new FT_Incremental_Interface(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #funcs}. */ + public static FT_Incremental_Funcs nfuncs(long struct) { return FT_Incremental_Funcs.create(memGetAddress(struct + FT_Incremental_Interface.FUNCS)); } + /** Unsafe version of {@link #object}. */ + public static long nobject(long struct) { return memGetAddress(struct + FT_Incremental_Interface.OBJECT); } + + /** Unsafe version of {@link #funcs(FT_Incremental_Funcs) funcs}. */ + public static void nfuncs(long struct, FT_Incremental_Funcs value) { memPutAddress(struct + FT_Incremental_Interface.FUNCS, value.address()); } + /** Unsafe version of {@link #object(long) object}. */ + public static void nobject(long struct, long value) { memPutAddress(struct + FT_Incremental_Interface.OBJECT, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + long funcs = memGetAddress(struct + FT_Incremental_Interface.FUNCS); + check(funcs); + FT_Incremental_Funcs.validate(funcs); + } + + // ----------------------------------- + + /** An array of {@link FT_Incremental_Interface} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Incremental_Interface ELEMENT_FACTORY = FT_Incremental_Interface.create(-1L); + + /** + * Creates a new {@code FT_Incremental_Interface.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 {@link FT_Incremental_Interface#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Incremental_Interface getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_Incremental_Funcs} view of the struct pointed to by the {@code funcs} field. */ + @NativeType("FT_Incremental_FuncsRec const *") + public FT_Incremental_Funcs funcs() { return FT_Incremental_Interface.nfuncs(address()); } + /** @return the value of the {@code object} field. */ + @NativeType("FT_Incremental") + public long object() { return FT_Incremental_Interface.nobject(address()); } + + /** Sets the address of the specified {@link FT_Incremental_Funcs} to the {@code funcs} field. */ + public Buffer funcs(@NativeType("FT_Incremental_FuncsRec const *") FT_Incremental_Funcs value) { FT_Incremental_Interface.nfuncs(address(), value); return this; } + /** Sets the specified value to the {@code object} field. */ + public Buffer object(@NativeType("FT_Incremental") long value) { FT_Incremental_Interface.nobject(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_Metrics.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_Metrics.java new file mode 100644 index 00000000..700d8851 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_Metrics.java @@ -0,0 +1,190 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A small structure used to contain the basic glyph metrics returned by the {@link FT_Incremental_GetGlyphMetricsFunc} method. + * + *

Layout

+ * + *

+ * struct FT_Incremental_MetricsRec {
+ *     FT_Long bearing_x;
+ *     FT_Long bearing_y;
+ *     FT_Long advance;
+ *     FT_Long advance_v;
+ * }
+ */ +@NativeType("struct FT_Incremental_MetricsRec") +public class FT_Incremental_Metrics extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + BEARING_X, + BEARING_Y, + ADVANCE, + ADVANCE_V; + + static { + Layout layout = __struct( + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + BEARING_X = layout.offsetof(0); + BEARING_Y = layout.offsetof(1); + ADVANCE = layout.offsetof(2); + ADVANCE_V = layout.offsetof(3); + } + + protected FT_Incremental_Metrics(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Incremental_Metrics create(long address, @Nullable ByteBuffer container) { + return new FT_Incremental_Metrics(address, container); + } + + /** + * Creates a {@code FT_Incremental_Metrics} instance at the current position of the specified {@link 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 FT_Incremental_Metrics(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code bearing_x} field. */ + @NativeType("FT_Long") + public long bearing_x() { return nbearing_x(address()); } + /** @return the value of the {@code bearing_y} field. */ + @NativeType("FT_Long") + public long bearing_y() { return nbearing_y(address()); } + /** @return the value of the {@code advance} field. */ + @NativeType("FT_Long") + public long advance() { return nadvance(address()); } + /** @return the value of the {@code advance_v} field. */ + @NativeType("FT_Long") + public long advance_v() { return nadvance_v(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Incremental_Metrics} instance for the specified memory address. */ + public static FT_Incremental_Metrics create(long address) { + return new FT_Incremental_Metrics(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Incremental_Metrics createSafe(long address) { + return address == NULL ? null : new FT_Incremental_Metrics(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #bearing_x}. */ + public static long nbearing_x(long struct) { return memGetCLong(struct + FT_Incremental_Metrics.BEARING_X); } + /** Unsafe version of {@link #bearing_y}. */ + public static long nbearing_y(long struct) { return memGetCLong(struct + FT_Incremental_Metrics.BEARING_Y); } + /** Unsafe version of {@link #advance}. */ + public static long nadvance(long struct) { return memGetCLong(struct + FT_Incremental_Metrics.ADVANCE); } + /** Unsafe version of {@link #advance_v}. */ + public static long nadvance_v(long struct) { return memGetCLong(struct + FT_Incremental_Metrics.ADVANCE_V); } + + // ----------------------------------- + + /** An array of {@link FT_Incremental_Metrics} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_Incremental_Metrics ELEMENT_FACTORY = FT_Incremental_Metrics.create(-1L); + + /** + * Creates a new {@code FT_Incremental_Metrics.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 {@link FT_Incremental_Metrics#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Incremental_Metrics getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code bearing_x} field. */ + @NativeType("FT_Long") + public long bearing_x() { return FT_Incremental_Metrics.nbearing_x(address()); } + /** @return the value of the {@code bearing_y} field. */ + @NativeType("FT_Long") + public long bearing_y() { return FT_Incremental_Metrics.nbearing_y(address()); } + /** @return the value of the {@code advance} field. */ + @NativeType("FT_Long") + public long advance() { return FT_Incremental_Metrics.nadvance(address()); } + /** @return the value of the {@code advance_v} field. */ + @NativeType("FT_Long") + public long advance_v() { return FT_Incremental_Metrics.nadvance_v(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_LayerIterator.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_LayerIterator.java new file mode 100644 index 00000000..465c8245 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_LayerIterator.java @@ -0,0 +1,271 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * This iterator object is needed for {@link FreeType#FT_Get_Color_Glyph_Layer Get_Color_Glyph_Layer}. + * + *

Layout

+ * + *

+ * struct FT_LayerIterator {
+ *     FT_UInt num_layers;
+ *     FT_UInt layer;
+ *     FT_Byte * p;
+ * }
+ */ +public class FT_LayerIterator extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + NUM_LAYERS, + LAYER, + P; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + NUM_LAYERS = layout.offsetof(0); + LAYER = layout.offsetof(1); + P = layout.offsetof(2); + } + + protected FT_LayerIterator(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_LayerIterator create(long address, @Nullable ByteBuffer container) { + return new FT_LayerIterator(address, container); + } + + /** + * Creates a {@code FT_LayerIterator} instance at the current position of the specified {@link 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 FT_LayerIterator(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code num_layers} field. */ + @NativeType("FT_UInt") + public int num_layers() { return nnum_layers(address()); } + /** @return the value of the {@code layer} field. */ + @NativeType("FT_UInt") + public int layer() { return nlayer(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code p} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("FT_Byte *") + public ByteBuffer p(int capacity) { return np(address(), capacity); } + + // ----------------------------------- + + /** Returns a new {@code FT_LayerIterator} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_LayerIterator malloc() { + return new FT_LayerIterator(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_LayerIterator} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_LayerIterator calloc() { + return new FT_LayerIterator(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_LayerIterator} instance allocated with {@link BufferUtils}. */ + public static FT_LayerIterator create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_LayerIterator(memAddress(container), container); + } + + /** Returns a new {@code FT_LayerIterator} instance for the specified memory address. */ + public static FT_LayerIterator create(long address) { + return new FT_LayerIterator(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_LayerIterator createSafe(long address) { + return address == NULL ? null : new FT_LayerIterator(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_LayerIterator} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_LayerIterator malloc(MemoryStack stack) { + return new FT_LayerIterator(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_LayerIterator} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_LayerIterator calloc(MemoryStack stack) { + return new FT_LayerIterator(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #num_layers}. */ + public static int nnum_layers(long struct) { return UNSAFE.getInt(null, struct + FT_LayerIterator.NUM_LAYERS); } + /** Unsafe version of {@link #layer}. */ + public static int nlayer(long struct) { return UNSAFE.getInt(null, struct + FT_LayerIterator.LAYER); } + /** Unsafe version of {@link #p(int) p}. */ + @Nullable public static ByteBuffer np(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + FT_LayerIterator.P), capacity); } + + // ----------------------------------- + + /** An array of {@link FT_LayerIterator} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_LayerIterator ELEMENT_FACTORY = FT_LayerIterator.create(-1L); + + /** + * Creates a new {@code FT_LayerIterator.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 {@link FT_LayerIterator#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_LayerIterator getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code num_layers} field. */ + @NativeType("FT_UInt") + public int num_layers() { return FT_LayerIterator.nnum_layers(address()); } + /** @return the value of the {@code layer} field. */ + @NativeType("FT_UInt") + public int layer() { return FT_LayerIterator.nlayer(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code p} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("FT_Byte *") + public ByteBuffer p(int capacity) { return FT_LayerIterator.np(address(), capacity); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List.java new file mode 100644 index 00000000..1ffee56b --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List.java @@ -0,0 +1,166 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure used to hold a simple doubly-linked list. These are used in many parts of FreeType. + * + *

Layout

+ * + *

+ * struct FT_ListRec {
+ *     {@link FT_ListNode FT_ListNode} head;
+ *     {@link FT_ListNode FT_ListNode} tail;
+ * }
+ */ +@NativeType("struct FT_ListRec") +public class FT_List extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + HEAD, + TAIL; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + HEAD = layout.offsetof(0); + TAIL = layout.offsetof(1); + } + + protected FT_List(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_List create(long address, @Nullable ByteBuffer container) { + return new FT_List(address, container); + } + + /** + * Creates a {@code FT_List} instance at the current position of the specified {@link 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 FT_List(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_ListNode} view of the struct pointed to by the {@code head} field. */ + @Nullable + public FT_ListNode head() { return nhead(address()); } + /** @return a {@link FT_ListNode} view of the struct pointed to by the {@code tail} field. */ + @Nullable + public FT_ListNode tail() { return ntail(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_List} instance for the specified memory address. */ + public static FT_List create(long address) { + return new FT_List(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_List createSafe(long address) { + return address == NULL ? null : new FT_List(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #head}. */ + @Nullable public static FT_ListNode nhead(long struct) { return FT_ListNode.createSafe(memGetAddress(struct + FT_List.HEAD)); } + /** Unsafe version of {@link #tail}. */ + @Nullable public static FT_ListNode ntail(long struct) { return FT_ListNode.createSafe(memGetAddress(struct + FT_List.TAIL)); } + + // ----------------------------------- + + /** An array of {@link FT_List} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_List ELEMENT_FACTORY = FT_List.create(-1L); + + /** + * Creates a new {@code FT_List.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 {@link FT_List#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_List getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_ListNode} view of the struct pointed to by the {@code head} field. */ + @Nullable + public FT_ListNode head() { return FT_List.nhead(address()); } + /** @return a {@link FT_ListNode} view of the struct pointed to by the {@code tail} field. */ + @Nullable + public FT_ListNode tail() { return FT_List.ntail(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ListNode.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ListNode.java new file mode 100644 index 00000000..d43d5e2c --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ListNode.java @@ -0,0 +1,186 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure used to hold a single list element. + * + *

Layout

+ * + *

+ * struct FT_ListNodeRec {
+ *     {@link FT_ListNode FT_ListNode} prev;
+ *     {@link FT_ListNode FT_ListNode} next;
+ *     void * data;
+ * }
+ */ +@NativeType("struct FT_ListNodeRec") +public class FT_ListNode extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + PREV, + NEXT, + DATA; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + PREV = layout.offsetof(0); + NEXT = layout.offsetof(1); + DATA = layout.offsetof(2); + } + + protected FT_ListNode(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_ListNode create(long address, @Nullable ByteBuffer container) { + return new FT_ListNode(address, container); + } + + /** + * Creates a {@code FT_ListNode} instance at the current position of the specified {@link 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 FT_ListNode(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_ListNode} view of the struct pointed to by the {@code prev} field. */ + @Nullable + public FT_ListNode prev() { return nprev(address()); } + /** @return a {@link FT_ListNode} view of the struct pointed to by the {@code next} field. */ + @Nullable + public FT_ListNode next() { return nnext(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code data} field. + * + * @param capacity the number of elements in the returned buffer + */ + @NativeType("void *") + public ByteBuffer data(int capacity) { return ndata(address(), capacity); } + + // ----------------------------------- + + /** Returns a new {@code FT_ListNode} instance for the specified memory address. */ + public static FT_ListNode create(long address) { + return new FT_ListNode(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_ListNode createSafe(long address) { + return address == NULL ? null : new FT_ListNode(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #prev}. */ + @Nullable public static FT_ListNode nprev(long struct) { return FT_ListNode.createSafe(memGetAddress(struct + FT_ListNode.PREV)); } + /** Unsafe version of {@link #next}. */ + @Nullable public static FT_ListNode nnext(long struct) { return FT_ListNode.createSafe(memGetAddress(struct + FT_ListNode.NEXT)); } + /** Unsafe version of {@link #data(int) data}. */ + public static ByteBuffer ndata(long struct, int capacity) { return memByteBuffer(memGetAddress(struct + FT_ListNode.DATA), capacity); } + + // ----------------------------------- + + /** An array of {@link FT_ListNode} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_ListNode ELEMENT_FACTORY = FT_ListNode.create(-1L); + + /** + * Creates a new {@code FT_ListNode.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 {@link FT_ListNode#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_ListNode getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_ListNode} view of the struct pointed to by the {@code prev} field. */ + @Nullable + public FT_ListNode prev() { return FT_ListNode.nprev(address()); } + /** @return a {@link FT_ListNode} view of the struct pointed to by the {@code next} field. */ + @Nullable + public FT_ListNode next() { return FT_ListNode.nnext(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code data} field. + * + * @param capacity the number of elements in the returned buffer + */ + @NativeType("void *") + public ByteBuffer data(int capacity) { return FT_ListNode.ndata(address(), capacity); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_Destructor.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_Destructor.java new file mode 100644 index 00000000..a71a7ab2 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_Destructor.java @@ -0,0 +1,75 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     FT_Memory memory,
+ *     void *data,
+ *     void *user
+ * )
+ */ +public abstract class FT_List_Destructor extends Callback implements FT_List_DestructorI { + + /** + * Creates a {@code FT_List_Destructor} instance from the specified function pointer. + * + * @return the new {@code FT_List_Destructor} + */ + public static FT_List_Destructor create(long functionPointer) { + FT_List_DestructorI instance = Callback.get(functionPointer); + return instance instanceof FT_List_Destructor + ? (FT_List_Destructor)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_List_Destructor createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_List_Destructor} instance that delegates to the specified {@code FT_List_DestructorI} instance. */ + public static FT_List_Destructor create(FT_List_DestructorI instance) { + return instance instanceof FT_List_Destructor + ? (FT_List_Destructor)instance + : new Container(instance.address(), instance); + } + + protected FT_List_Destructor() { + super(CIF); + } + + FT_List_Destructor(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_List_Destructor { + + private final FT_List_DestructorI delegate; + + Container(long functionPointer, FT_List_DestructorI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long memory, long data, long user) { + delegate.invoke(memory, data, user); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_DestructorI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_DestructorI.java new file mode 100644 index 00000000..30361d64 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_DestructorI.java @@ -0,0 +1,50 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     FT_Memory memory,
+ *     void *data,
+ *     void *user
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_List_Destructor") +public interface FT_List_DestructorI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_void, + ffi_type_pointer, ffi_type_pointer, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + invoke( + memGetAddress(memGetAddress(args)), + memGetAddress(memGetAddress(args + POINTER_SIZE)), + memGetAddress(memGetAddress(args + 2 * POINTER_SIZE)) + ); + } + + /** An {@code FT_List} iterator function that is called during a list finalization by {@link FreeType#FT_List_Finalize List_Finalize} to destroy all elements in a given list. */ + void invoke(@NativeType("FT_Memory") long memory, @NativeType("void *") long data, @NativeType("void *") long user); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_Iterator.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_Iterator.java new file mode 100644 index 00000000..15679d7c --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_Iterator.java @@ -0,0 +1,74 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * FT_Error (*{@link #invoke}) (
+ *     FT_ListNode node,
+ *     void *user
+ * )
+ */ +public abstract class FT_List_Iterator extends Callback implements FT_List_IteratorI { + + /** + * Creates a {@code FT_List_Iterator} instance from the specified function pointer. + * + * @return the new {@code FT_List_Iterator} + */ + public static FT_List_Iterator create(long functionPointer) { + FT_List_IteratorI instance = Callback.get(functionPointer); + return instance instanceof FT_List_Iterator + ? (FT_List_Iterator)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_List_Iterator createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_List_Iterator} instance that delegates to the specified {@code FT_List_IteratorI} instance. */ + public static FT_List_Iterator create(FT_List_IteratorI instance) { + return instance instanceof FT_List_Iterator + ? (FT_List_Iterator)instance + : new Container(instance.address(), instance); + } + + protected FT_List_Iterator() { + super(CIF); + } + + FT_List_Iterator(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_List_Iterator { + + private final FT_List_IteratorI delegate; + + Container(long functionPointer, FT_List_IteratorI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public int invoke(long node, long user) { + return delegate.invoke(node, user); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_IteratorI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_IteratorI.java new file mode 100644 index 00000000..86ed1a1f --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_IteratorI.java @@ -0,0 +1,49 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * FT_Error (*{@link #invoke}) (
+ *     FT_ListNode node,
+ *     void *user
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_List_Iterator") +public interface FT_List_IteratorI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_sint32, + ffi_type_pointer, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + int __result = invoke( + memGetAddress(memGetAddress(args)), + memGetAddress(memGetAddress(args + POINTER_SIZE)) + ); + apiClosureRet(ret, __result); + } + + /** An {@code FT_List} iterator function that is called during a list parse by {@link FreeType#FT_List_Iterate List_Iterate}. */ + @NativeType("FT_Error") int invoke(@NativeType("FT_ListNode") long node, @NativeType("void *") long user); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_MM_Axis.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_MM_Axis.java new file mode 100644 index 00000000..262d05dd --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_MM_Axis.java @@ -0,0 +1,185 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure to model a given axis in design space for Multiple Masters fonts. + * + *

Layout

+ * + *

+ * struct FT_MM_Axis {
+ *     FT_String * name;
+ *     FT_Long minimum;
+ *     FT_Long maximum;
+ * }
+ */ +public class FT_MM_Axis extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + NAME, + MINIMUM, + MAXIMUM; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + NAME = layout.offsetof(0); + MINIMUM = layout.offsetof(1); + MAXIMUM = layout.offsetof(2); + } + + protected FT_MM_Axis(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_MM_Axis create(long address, @Nullable ByteBuffer container) { + return new FT_MM_Axis(address, container); + } + + /** + * Creates a {@code FT_MM_Axis} instance at the current position of the specified {@link 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 FT_MM_Axis(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code name} field. */ + @NativeType("FT_String *") + public ByteBuffer name() { return nname(address()); } + /** @return the null-terminated string pointed to by the {@code name} field. */ + @NativeType("FT_String *") + public String nameString() { return nnameString(address()); } + /** @return the value of the {@code minimum} field. */ + @NativeType("FT_Long") + public long minimum() { return nminimum(address()); } + /** @return the value of the {@code maximum} field. */ + @NativeType("FT_Long") + public long maximum() { return nmaximum(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_MM_Axis} instance for the specified memory address. */ + public static FT_MM_Axis create(long address) { + return new FT_MM_Axis(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_MM_Axis createSafe(long address) { + return address == NULL ? null : new FT_MM_Axis(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #name}. */ + public static ByteBuffer nname(long struct) { return memByteBufferNT1(memGetAddress(struct + FT_MM_Axis.NAME)); } + /** Unsafe version of {@link #nameString}. */ + public static String nnameString(long struct) { return memUTF8(memGetAddress(struct + FT_MM_Axis.NAME)); } + /** Unsafe version of {@link #minimum}. */ + public static long nminimum(long struct) { return memGetCLong(struct + FT_MM_Axis.MINIMUM); } + /** Unsafe version of {@link #maximum}. */ + public static long nmaximum(long struct) { return memGetCLong(struct + FT_MM_Axis.MAXIMUM); } + + // ----------------------------------- + + /** An array of {@link FT_MM_Axis} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_MM_Axis ELEMENT_FACTORY = FT_MM_Axis.create(-1L); + + /** + * Creates a new {@code FT_MM_Axis.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 {@link FT_MM_Axis#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_MM_Axis getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code name} field. */ + @NativeType("FT_String *") + public ByteBuffer name() { return FT_MM_Axis.nname(address()); } + /** @return the null-terminated string pointed to by the {@code name} field. */ + @NativeType("FT_String *") + public String nameString() { return FT_MM_Axis.nnameString(address()); } + /** @return the value of the {@code minimum} field. */ + @NativeType("FT_Long") + public long minimum() { return FT_MM_Axis.nminimum(address()); } + /** @return the value of the {@code maximum} field. */ + @NativeType("FT_Long") + public long maximum() { return FT_MM_Axis.nmaximum(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_MM_Var.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_MM_Var.java new file mode 100644 index 00000000..1d392209 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_MM_Var.java @@ -0,0 +1,285 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A structure to model the axes and space of an Adobe MM, TrueType GX, or OpenType variation font. + * + *

Layout

+ * + *

+ * struct FT_MM_Var {
+ *     FT_UInt num_axis;
+ *     FT_UInt num_designs;
+ *     FT_UInt num_namedstyles;
+ *     {@link FT_Var_Axis FT_Var_Axis} * axis;
+ *     {@link FT_Var_Named_Style FT_Var_Named_Style} * namedstyle;
+ * }
+ */ +public class FT_MM_Var extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + NUM_AXIS, + NUM_DESIGNS, + NUM_NAMEDSTYLES, + AXIS, + NAMEDSTYLE; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __member(4), + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + NUM_AXIS = layout.offsetof(0); + NUM_DESIGNS = layout.offsetof(1); + NUM_NAMEDSTYLES = layout.offsetof(2); + AXIS = layout.offsetof(3); + NAMEDSTYLE = layout.offsetof(4); + } + + protected FT_MM_Var(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_MM_Var create(long address, @Nullable ByteBuffer container) { + return new FT_MM_Var(address, container); + } + + /** + * Creates a {@code FT_MM_Var} instance at the current position of the specified {@link 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 FT_MM_Var(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code num_axis} field. */ + @NativeType("FT_UInt") + public int num_axis() { return nnum_axis(address()); } + /** @return the value of the {@code num_designs} field. */ + @NativeType("FT_UInt") + public int num_designs() { return nnum_designs(address()); } + /** @return the value of the {@code num_namedstyles} field. */ + @NativeType("FT_UInt") + public int num_namedstyles() { return nnum_namedstyles(address()); } + /** @return a {@link FT_Var_Axis.Buffer} view of the struct array pointed to by the {@code axis} field. */ + @NativeType("FT_Var_Axis *") + public FT_Var_Axis.Buffer axis() { return naxis(address()); } + /** @return a {@link FT_Var_Named_Style.Buffer} view of the struct array pointed to by the {@code namedstyle} field. */ + @NativeType("FT_Var_Named_Style *") + public FT_Var_Named_Style.Buffer namedstyle() { return nnamedstyle(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_MM_Var} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_MM_Var malloc() { + return new FT_MM_Var(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_MM_Var} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_MM_Var calloc() { + return new FT_MM_Var(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_MM_Var} instance allocated with {@link BufferUtils}. */ + public static FT_MM_Var create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_MM_Var(memAddress(container), container); + } + + /** Returns a new {@code FT_MM_Var} instance for the specified memory address. */ + public static FT_MM_Var create(long address) { + return new FT_MM_Var(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_MM_Var createSafe(long address) { + return address == NULL ? null : new FT_MM_Var(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_MM_Var} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_MM_Var malloc(MemoryStack stack) { + return new FT_MM_Var(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_MM_Var} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_MM_Var calloc(MemoryStack stack) { + return new FT_MM_Var(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #num_axis}. */ + public static int nnum_axis(long struct) { return UNSAFE.getInt(null, struct + FT_MM_Var.NUM_AXIS); } + /** Unsafe version of {@link #num_designs}. */ + public static int nnum_designs(long struct) { return UNSAFE.getInt(null, struct + FT_MM_Var.NUM_DESIGNS); } + /** Unsafe version of {@link #num_namedstyles}. */ + public static int nnum_namedstyles(long struct) { return UNSAFE.getInt(null, struct + FT_MM_Var.NUM_NAMEDSTYLES); } + /** Unsafe version of {@link #axis}. */ + public static FT_Var_Axis.Buffer naxis(long struct) { return FT_Var_Axis.create(memGetAddress(struct + FT_MM_Var.AXIS), nnum_axis(struct)); } + /** Unsafe version of {@link #namedstyle}. */ + public static FT_Var_Named_Style.Buffer nnamedstyle(long struct) { return FT_Var_Named_Style.create(memGetAddress(struct + FT_MM_Var.NAMEDSTYLE), nnum_namedstyles(struct)); } + + // ----------------------------------- + + /** An array of {@link FT_MM_Var} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_MM_Var ELEMENT_FACTORY = FT_MM_Var.create(-1L); + + /** + * Creates a new {@code FT_MM_Var.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 {@link FT_MM_Var#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_MM_Var getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code num_axis} field. */ + @NativeType("FT_UInt") + public int num_axis() { return FT_MM_Var.nnum_axis(address()); } + /** @return the value of the {@code num_designs} field. */ + @NativeType("FT_UInt") + public int num_designs() { return FT_MM_Var.nnum_designs(address()); } + /** @return the value of the {@code num_namedstyles} field. */ + @NativeType("FT_UInt") + public int num_namedstyles() { return FT_MM_Var.nnum_namedstyles(address()); } + /** @return a {@link FT_Var_Axis.Buffer} view of the struct array pointed to by the {@code axis} field. */ + @NativeType("FT_Var_Axis *") + public FT_Var_Axis.Buffer axis() { return FT_MM_Var.naxis(address()); } + /** @return a {@link FT_Var_Named_Style.Buffer} view of the struct array pointed to by the {@code namedstyle} field. */ + @NativeType("FT_Var_Named_Style *") + public FT_Var_Named_Style.Buffer namedstyle() { return FT_MM_Var.nnamedstyle(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Matrix.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Matrix.java new file mode 100644 index 00000000..a3102191 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Matrix.java @@ -0,0 +1,327 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A simple structure used to store a 2x2 matrix. Coefficients are in 16.16 fixed-point format. + * + *

Layout

+ * + *

+ * struct FT_Matrix {
+ *     FT_Fixed xx;
+ *     FT_Fixed xy;
+ *     FT_Fixed yx;
+ *     FT_Fixed yy;
+ * }
+ */ +public class FT_Matrix extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + XX, + XY, + YX, + YY; + + static { + Layout layout = __struct( + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + XX = layout.offsetof(0); + XY = layout.offsetof(1); + YX = layout.offsetof(2); + YY = layout.offsetof(3); + } + + protected FT_Matrix(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Matrix create(long address, @Nullable ByteBuffer container) { + return new FT_Matrix(address, container); + } + + /** + * Creates a {@code FT_Matrix} instance at the current position of the specified {@link 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 FT_Matrix(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code xx} field. */ + @NativeType("FT_Fixed") + public long xx() { return nxx(address()); } + /** @return the value of the {@code xy} field. */ + @NativeType("FT_Fixed") + public long xy() { return nxy(address()); } + /** @return the value of the {@code yx} field. */ + @NativeType("FT_Fixed") + public long yx() { return nyx(address()); } + /** @return the value of the {@code yy} field. */ + @NativeType("FT_Fixed") + public long yy() { return nyy(address()); } + + /** Sets the specified value to the {@code xx} field. */ + public FT_Matrix xx(@NativeType("FT_Fixed") long value) { nxx(address(), value); return this; } + /** Sets the specified value to the {@code xy} field. */ + public FT_Matrix xy(@NativeType("FT_Fixed") long value) { nxy(address(), value); return this; } + /** Sets the specified value to the {@code yx} field. */ + public FT_Matrix yx(@NativeType("FT_Fixed") long value) { nyx(address(), value); return this; } + /** Sets the specified value to the {@code yy} field. */ + public FT_Matrix yy(@NativeType("FT_Fixed") long value) { nyy(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_Matrix set( + long xx, + long xy, + long yx, + long yy + ) { + xx(xx); + xy(xy); + yx(yx); + yy(yy); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Matrix set(FT_Matrix src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Matrix} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Matrix malloc() { + return new FT_Matrix(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Matrix} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Matrix calloc() { + return new FT_Matrix(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Matrix} instance allocated with {@link BufferUtils}. */ + public static FT_Matrix create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Matrix(memAddress(container), container); + } + + /** Returns a new {@code FT_Matrix} instance for the specified memory address. */ + public static FT_Matrix create(long address) { + return new FT_Matrix(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Matrix createSafe(long address) { + return address == NULL ? null : new FT_Matrix(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Matrix} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Matrix malloc(MemoryStack stack) { + return new FT_Matrix(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Matrix} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Matrix calloc(MemoryStack stack) { + return new FT_Matrix(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #xx}. */ + public static long nxx(long struct) { return memGetCLong(struct + FT_Matrix.XX); } + /** Unsafe version of {@link #xy}. */ + public static long nxy(long struct) { return memGetCLong(struct + FT_Matrix.XY); } + /** Unsafe version of {@link #yx}. */ + public static long nyx(long struct) { return memGetCLong(struct + FT_Matrix.YX); } + /** Unsafe version of {@link #yy}. */ + public static long nyy(long struct) { return memGetCLong(struct + FT_Matrix.YY); } + + /** Unsafe version of {@link #xx(long) xx}. */ + public static void nxx(long struct, long value) { memPutCLong(struct + FT_Matrix.XX, value); } + /** Unsafe version of {@link #xy(long) xy}. */ + public static void nxy(long struct, long value) { memPutCLong(struct + FT_Matrix.XY, value); } + /** Unsafe version of {@link #yx(long) yx}. */ + public static void nyx(long struct, long value) { memPutCLong(struct + FT_Matrix.YX, value); } + /** Unsafe version of {@link #yy(long) yy}. */ + public static void nyy(long struct, long value) { memPutCLong(struct + FT_Matrix.YY, value); } + + // ----------------------------------- + + /** An array of {@link FT_Matrix} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Matrix ELEMENT_FACTORY = FT_Matrix.create(-1L); + + /** + * Creates a new {@code FT_Matrix.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 {@link FT_Matrix#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Matrix getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code xx} field. */ + @NativeType("FT_Fixed") + public long xx() { return FT_Matrix.nxx(address()); } + /** @return the value of the {@code xy} field. */ + @NativeType("FT_Fixed") + public long xy() { return FT_Matrix.nxy(address()); } + /** @return the value of the {@code yx} field. */ + @NativeType("FT_Fixed") + public long yx() { return FT_Matrix.nyx(address()); } + /** @return the value of the {@code yy} field. */ + @NativeType("FT_Fixed") + public long yy() { return FT_Matrix.nyy(address()); } + + /** Sets the specified value to the {@code xx} field. */ + public Buffer xx(@NativeType("FT_Fixed") long value) { FT_Matrix.nxx(address(), value); return this; } + /** Sets the specified value to the {@code xy} field. */ + public Buffer xy(@NativeType("FT_Fixed") long value) { FT_Matrix.nxy(address(), value); return this; } + /** Sets the specified value to the {@code yx} field. */ + public Buffer yx(@NativeType("FT_Fixed") long value) { FT_Matrix.nyx(address(), value); return this; } + /** Sets the specified value to the {@code yy} field. */ + public Buffer yy(@NativeType("FT_Fixed") long value) { FT_Matrix.nyy(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Memory.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Memory.java new file mode 100644 index 00000000..b22dc128 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Memory.java @@ -0,0 +1,328 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A structure used to describe a given memory manager to FreeType~2. + * + *

Layout

+ * + *

+ * struct FT_MemoryRec_ {
+ *     void * user;
+ *     {@link FT_Alloc_FuncI FT_Alloc_Func} alloc;
+ *     {@link FT_Free_FuncI FT_Free_Func} free;
+ *     {@link FT_Realloc_FuncI FT_Realloc_Func} realloc;
+ * }
+ */ +@NativeType("struct FT_MemoryRec_") +public class FT_Memory extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + USER, + ALLOC, + FREE, + REALLOC; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + USER = layout.offsetof(0); + ALLOC = layout.offsetof(1); + FREE = layout.offsetof(2); + REALLOC = layout.offsetof(3); + } + + protected FT_Memory(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Memory create(long address, @Nullable ByteBuffer container) { + return new FT_Memory(address, container); + } + + /** + * Creates a {@code FT_Memory} instance at the current position of the specified {@link 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 FT_Memory(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code user} field. */ + @NativeType("void *") + public long user() { return nuser(address()); } + /** @return the value of the {@code alloc} field. */ + @Nullable + public FT_Alloc_Func alloc() { return nalloc(address()); } + /** @return the value of the {@code free} field. */ + @Nullable + public FT_Free_Func free$() { return nfree$(address()); } + /** @return the value of the {@code realloc} field. */ + @Nullable + public FT_Realloc_Func realloc() { return nrealloc(address()); } + + /** Sets the specified value to the {@code user} field. */ + public FT_Memory user(@NativeType("void *") long value) { nuser(address(), value); return this; } + /** Sets the specified value to the {@code alloc} field. */ + public FT_Memory alloc(@Nullable @NativeType("FT_Alloc_Func") FT_Alloc_FuncI value) { nalloc(address(), value); return this; } + /** Sets the specified value to the {@code free} field. */ + public FT_Memory free$(@Nullable @NativeType("FT_Free_Func") FT_Free_FuncI value) { nfree$(address(), value); return this; } + /** Sets the specified value to the {@code realloc} field. */ + public FT_Memory realloc(@Nullable @NativeType("FT_Realloc_Func") FT_Realloc_FuncI value) { nrealloc(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_Memory set( + long user, + FT_Alloc_FuncI alloc, + FT_Free_FuncI free$, + FT_Realloc_FuncI realloc + ) { + user(user); + alloc(alloc); + free$(free$); + realloc(realloc); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Memory set(FT_Memory src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Memory} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Memory malloc() { + return new FT_Memory(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Memory} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Memory calloc() { + return new FT_Memory(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Memory} instance allocated with {@link BufferUtils}. */ + public static FT_Memory create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Memory(memAddress(container), container); + } + + /** Returns a new {@code FT_Memory} instance for the specified memory address. */ + public static FT_Memory create(long address) { + return new FT_Memory(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Memory createSafe(long address) { + return address == NULL ? null : new FT_Memory(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Memory} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Memory malloc(MemoryStack stack) { + return new FT_Memory(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Memory} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Memory calloc(MemoryStack stack) { + return new FT_Memory(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #user}. */ + public static long nuser(long struct) { return memGetAddress(struct + FT_Memory.USER); } + /** Unsafe version of {@link #alloc}. */ + @Nullable public static FT_Alloc_Func nalloc(long struct) { return FT_Alloc_Func.createSafe(memGetAddress(struct + FT_Memory.ALLOC)); } + /** Unsafe version of {@link #free$}. */ + @Nullable public static FT_Free_Func nfree$(long struct) { return FT_Free_Func.createSafe(memGetAddress(struct + FT_Memory.FREE)); } + /** Unsafe version of {@link #realloc}. */ + @Nullable public static FT_Realloc_Func nrealloc(long struct) { return FT_Realloc_Func.createSafe(memGetAddress(struct + FT_Memory.REALLOC)); } + + /** Unsafe version of {@link #user(long) user}. */ + public static void nuser(long struct, long value) { memPutAddress(struct + FT_Memory.USER, value); } + /** Unsafe version of {@link #alloc(FT_Alloc_FuncI) alloc}. */ + public static void nalloc(long struct, @Nullable FT_Alloc_FuncI value) { memPutAddress(struct + FT_Memory.ALLOC, memAddressSafe(value)); } + /** Unsafe version of {@link #free$(FT_Free_FuncI) free$}. */ + public static void nfree$(long struct, @Nullable FT_Free_FuncI value) { memPutAddress(struct + FT_Memory.FREE, memAddressSafe(value)); } + /** Unsafe version of {@link #realloc(FT_Realloc_FuncI) realloc}. */ + public static void nrealloc(long struct, @Nullable FT_Realloc_FuncI value) { memPutAddress(struct + FT_Memory.REALLOC, memAddressSafe(value)); } + + // ----------------------------------- + + /** An array of {@link FT_Memory} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Memory ELEMENT_FACTORY = FT_Memory.create(-1L); + + /** + * Creates a new {@code FT_Memory.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 {@link FT_Memory#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Memory getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code user} field. */ + @NativeType("void *") + public long user() { return FT_Memory.nuser(address()); } + /** @return the value of the {@code alloc} field. */ + @Nullable + public FT_Alloc_Func alloc() { return FT_Memory.nalloc(address()); } + /** @return the value of the {@code free} field. */ + @Nullable + public FT_Free_Func free$() { return FT_Memory.nfree$(address()); } + /** @return the value of the {@code realloc} field. */ + @Nullable + public FT_Realloc_Func realloc() { return FT_Memory.nrealloc(address()); } + + /** Sets the specified value to the {@code user} field. */ + public Buffer user(@NativeType("void *") long value) { FT_Memory.nuser(address(), value); return this; } + /** Sets the specified value to the {@code alloc} field. */ + public Buffer alloc(@Nullable @NativeType("FT_Alloc_Func") FT_Alloc_FuncI value) { FT_Memory.nalloc(address(), value); return this; } + /** Sets the specified value to the {@code free} field. */ + public Buffer free$(@Nullable @NativeType("FT_Free_Func") FT_Free_FuncI value) { FT_Memory.nfree$(address(), value); return this; } + /** Sets the specified value to the {@code realloc} field. */ + public Buffer realloc(@Nullable @NativeType("FT_Realloc_Func") FT_Realloc_FuncI value) { FT_Memory.nrealloc(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Class.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Class.java new file mode 100644 index 00000000..a634970e --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Class.java @@ -0,0 +1,458 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * The module class descriptor. + * + *

Layout

+ * + *

+ * struct FT_Module_Class {
+ *     FT_ULong module_flags;
+ *     FT_Long module_size;
+ *     FT_String const * module_name;
+ *     FT_Fixed module_version;
+ *     FT_Fixed module_requires;
+ *     void const * module_interface;
+ *     {@link FT_Module_ConstructorI FT_Module_Constructor} module_init;
+ *     {@link FT_Module_DestructorI FT_Module_Destructor} module_done;
+ *     {@link FT_Module_RequesterI FT_Module_Requester} get_interface;
+ * }
+ */ +public class FT_Module_Class extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + MODULE_FLAGS, + MODULE_SIZE, + MODULE_NAME, + MODULE_VERSION, + MODULE_REQUIRES, + MODULE_INTERFACE, + MODULE_INIT, + MODULE_DONE, + GET_INTERFACE; + + static { + Layout layout = __struct( + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + MODULE_FLAGS = layout.offsetof(0); + MODULE_SIZE = layout.offsetof(1); + MODULE_NAME = layout.offsetof(2); + MODULE_VERSION = layout.offsetof(3); + MODULE_REQUIRES = layout.offsetof(4); + MODULE_INTERFACE = layout.offsetof(5); + MODULE_INIT = layout.offsetof(6); + MODULE_DONE = layout.offsetof(7); + GET_INTERFACE = layout.offsetof(8); + } + + protected FT_Module_Class(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Module_Class create(long address, @Nullable ByteBuffer container) { + return new FT_Module_Class(address, container); + } + + /** + * Creates a {@code FT_Module_Class} instance at the current position of the specified {@link 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 FT_Module_Class(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code module_flags} field. */ + @NativeType("FT_ULong") + public long module_flags() { return nmodule_flags(address()); } + /** @return the value of the {@code module_size} field. */ + @NativeType("FT_Long") + public long module_size() { return nmodule_size(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code module_name} field. */ + @NativeType("FT_String const *") + public ByteBuffer module_name() { return nmodule_name(address()); } + /** @return the null-terminated string pointed to by the {@code module_name} field. */ + @NativeType("FT_String const *") + public String module_nameString() { return nmodule_nameString(address()); } + /** @return the value of the {@code module_version} field. */ + @NativeType("FT_Fixed") + public long module_version() { return nmodule_version(address()); } + /** @return the value of the {@code module_requires} field. */ + @NativeType("FT_Fixed") + public long module_requires() { return nmodule_requires(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code module_interface} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void const *") + public ByteBuffer module_interface(int capacity) { return nmodule_interface(address(), capacity); } + /** @return the value of the {@code module_init} field. */ + @Nullable + public FT_Module_Constructor module_init() { return nmodule_init(address()); } + /** @return the value of the {@code module_done} field. */ + @Nullable + public FT_Module_Destructor module_done() { return nmodule_done(address()); } + /** @return the value of the {@code get_interface} field. */ + @Nullable + public FT_Module_Requester get_interface() { return nget_interface(address()); } + + /** Sets the specified value to the {@code module_flags} field. */ + public FT_Module_Class module_flags(@NativeType("FT_ULong") long value) { nmodule_flags(address(), value); return this; } + /** Sets the specified value to the {@code module_size} field. */ + public FT_Module_Class module_size(@NativeType("FT_Long") long value) { nmodule_size(address(), value); return this; } + /** Sets the address of the specified encoded string to the {@code module_name} field. */ + public FT_Module_Class module_name(@NativeType("FT_String const *") ByteBuffer value) { nmodule_name(address(), value); return this; } + /** Sets the specified value to the {@code module_version} field. */ + public FT_Module_Class module_version(@NativeType("FT_Fixed") long value) { nmodule_version(address(), value); return this; } + /** Sets the specified value to the {@code module_requires} field. */ + public FT_Module_Class module_requires(@NativeType("FT_Fixed") long value) { nmodule_requires(address(), value); return this; } + /** Sets the address of the specified {@link ByteBuffer} to the {@code module_interface} field. */ + public FT_Module_Class module_interface(@Nullable @NativeType("void const *") ByteBuffer value) { nmodule_interface(address(), value); return this; } + /** Sets the specified value to the {@code module_init} field. */ + public FT_Module_Class module_init(@Nullable @NativeType("FT_Module_Constructor") FT_Module_ConstructorI value) { nmodule_init(address(), value); return this; } + /** Sets the specified value to the {@code module_done} field. */ + public FT_Module_Class module_done(@Nullable @NativeType("FT_Module_Destructor") FT_Module_DestructorI value) { nmodule_done(address(), value); return this; } + /** Sets the specified value to the {@code get_interface} field. */ + public FT_Module_Class get_interface(@Nullable @NativeType("FT_Module_Requester") FT_Module_RequesterI value) { nget_interface(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_Module_Class set( + long module_flags, + long module_size, + ByteBuffer module_name, + long module_version, + long module_requires, + @Nullable ByteBuffer module_interface, + @Nullable FT_Module_ConstructorI module_init, + @Nullable FT_Module_DestructorI module_done, + @Nullable FT_Module_RequesterI get_interface + ) { + module_flags(module_flags); + module_size(module_size); + module_name(module_name); + module_version(module_version); + module_requires(module_requires); + module_interface(module_interface); + module_init(module_init); + module_done(module_done); + get_interface(get_interface); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Module_Class set(FT_Module_Class src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Module_Class} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Module_Class malloc() { + return new FT_Module_Class(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Module_Class} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Module_Class calloc() { + return new FT_Module_Class(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Module_Class} instance allocated with {@link BufferUtils}. */ + public static FT_Module_Class create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Module_Class(memAddress(container), container); + } + + /** Returns a new {@code FT_Module_Class} instance for the specified memory address. */ + public static FT_Module_Class create(long address) { + return new FT_Module_Class(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Module_Class createSafe(long address) { + return address == NULL ? null : new FT_Module_Class(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Module_Class} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Module_Class malloc(MemoryStack stack) { + return new FT_Module_Class(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Module_Class} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Module_Class calloc(MemoryStack stack) { + return new FT_Module_Class(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #module_flags}. */ + public static long nmodule_flags(long struct) { return memGetCLong(struct + FT_Module_Class.MODULE_FLAGS); } + /** Unsafe version of {@link #module_size}. */ + public static long nmodule_size(long struct) { return memGetCLong(struct + FT_Module_Class.MODULE_SIZE); } + /** Unsafe version of {@link #module_name}. */ + public static ByteBuffer nmodule_name(long struct) { return memByteBufferNT1(memGetAddress(struct + FT_Module_Class.MODULE_NAME)); } + /** Unsafe version of {@link #module_nameString}. */ + public static String nmodule_nameString(long struct) { return memUTF8(memGetAddress(struct + FT_Module_Class.MODULE_NAME)); } + /** Unsafe version of {@link #module_version}. */ + public static long nmodule_version(long struct) { return memGetCLong(struct + FT_Module_Class.MODULE_VERSION); } + /** Unsafe version of {@link #module_requires}. */ + public static long nmodule_requires(long struct) { return memGetCLong(struct + FT_Module_Class.MODULE_REQUIRES); } + /** Unsafe version of {@link #module_interface(int) module_interface}. */ + @Nullable public static ByteBuffer nmodule_interface(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + FT_Module_Class.MODULE_INTERFACE), capacity); } + /** Unsafe version of {@link #module_init}. */ + @Nullable public static FT_Module_Constructor nmodule_init(long struct) { return FT_Module_Constructor.createSafe(memGetAddress(struct + FT_Module_Class.MODULE_INIT)); } + /** Unsafe version of {@link #module_done}. */ + @Nullable public static FT_Module_Destructor nmodule_done(long struct) { return FT_Module_Destructor.createSafe(memGetAddress(struct + FT_Module_Class.MODULE_DONE)); } + /** Unsafe version of {@link #get_interface}. */ + @Nullable public static FT_Module_Requester nget_interface(long struct) { return FT_Module_Requester.createSafe(memGetAddress(struct + FT_Module_Class.GET_INTERFACE)); } + + /** Unsafe version of {@link #module_flags(long) module_flags}. */ + public static void nmodule_flags(long struct, long value) { memPutCLong(struct + FT_Module_Class.MODULE_FLAGS, value); } + /** Unsafe version of {@link #module_size(long) module_size}. */ + public static void nmodule_size(long struct, long value) { memPutCLong(struct + FT_Module_Class.MODULE_SIZE, value); } + /** Unsafe version of {@link #module_name(ByteBuffer) module_name}. */ + public static void nmodule_name(long struct, ByteBuffer value) { + if (CHECKS) { checkNT1(value); } + memPutAddress(struct + FT_Module_Class.MODULE_NAME, memAddress(value)); + } + /** Unsafe version of {@link #module_version(long) module_version}. */ + public static void nmodule_version(long struct, long value) { memPutCLong(struct + FT_Module_Class.MODULE_VERSION, value); } + /** Unsafe version of {@link #module_requires(long) module_requires}. */ + public static void nmodule_requires(long struct, long value) { memPutCLong(struct + FT_Module_Class.MODULE_REQUIRES, value); } + /** Unsafe version of {@link #module_interface(ByteBuffer) module_interface}. */ + public static void nmodule_interface(long struct, @Nullable ByteBuffer value) { memPutAddress(struct + FT_Module_Class.MODULE_INTERFACE, memAddressSafe(value)); } + /** Unsafe version of {@link #module_init(FT_Module_ConstructorI) module_init}. */ + public static void nmodule_init(long struct, @Nullable FT_Module_ConstructorI value) { memPutAddress(struct + FT_Module_Class.MODULE_INIT, memAddressSafe(value)); } + /** Unsafe version of {@link #module_done(FT_Module_DestructorI) module_done}. */ + public static void nmodule_done(long struct, @Nullable FT_Module_DestructorI value) { memPutAddress(struct + FT_Module_Class.MODULE_DONE, memAddressSafe(value)); } + /** Unsafe version of {@link #get_interface(FT_Module_RequesterI) get_interface}. */ + public static void nget_interface(long struct, @Nullable FT_Module_RequesterI value) { memPutAddress(struct + FT_Module_Class.GET_INTERFACE, memAddressSafe(value)); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + FT_Module_Class.MODULE_NAME)); + } + + // ----------------------------------- + + /** An array of {@link FT_Module_Class} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Module_Class ELEMENT_FACTORY = FT_Module_Class.create(-1L); + + /** + * Creates a new {@code FT_Module_Class.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 {@link FT_Module_Class#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Module_Class getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code module_flags} field. */ + @NativeType("FT_ULong") + public long module_flags() { return FT_Module_Class.nmodule_flags(address()); } + /** @return the value of the {@code module_size} field. */ + @NativeType("FT_Long") + public long module_size() { return FT_Module_Class.nmodule_size(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code module_name} field. */ + @NativeType("FT_String const *") + public ByteBuffer module_name() { return FT_Module_Class.nmodule_name(address()); } + /** @return the null-terminated string pointed to by the {@code module_name} field. */ + @NativeType("FT_String const *") + public String module_nameString() { return FT_Module_Class.nmodule_nameString(address()); } + /** @return the value of the {@code module_version} field. */ + @NativeType("FT_Fixed") + public long module_version() { return FT_Module_Class.nmodule_version(address()); } + /** @return the value of the {@code module_requires} field. */ + @NativeType("FT_Fixed") + public long module_requires() { return FT_Module_Class.nmodule_requires(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code module_interface} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void const *") + public ByteBuffer module_interface(int capacity) { return FT_Module_Class.nmodule_interface(address(), capacity); } + /** @return the value of the {@code module_init} field. */ + @Nullable + public FT_Module_Constructor module_init() { return FT_Module_Class.nmodule_init(address()); } + /** @return the value of the {@code module_done} field. */ + @Nullable + public FT_Module_Destructor module_done() { return FT_Module_Class.nmodule_done(address()); } + /** @return the value of the {@code get_interface} field. */ + @Nullable + public FT_Module_Requester get_interface() { return FT_Module_Class.nget_interface(address()); } + + /** Sets the specified value to the {@code module_flags} field. */ + public Buffer module_flags(@NativeType("FT_ULong") long value) { FT_Module_Class.nmodule_flags(address(), value); return this; } + /** Sets the specified value to the {@code module_size} field. */ + public Buffer module_size(@NativeType("FT_Long") long value) { FT_Module_Class.nmodule_size(address(), value); return this; } + /** Sets the address of the specified encoded string to the {@code module_name} field. */ + public Buffer module_name(@NativeType("FT_String const *") ByteBuffer value) { FT_Module_Class.nmodule_name(address(), value); return this; } + /** Sets the specified value to the {@code module_version} field. */ + public Buffer module_version(@NativeType("FT_Fixed") long value) { FT_Module_Class.nmodule_version(address(), value); return this; } + /** Sets the specified value to the {@code module_requires} field. */ + public Buffer module_requires(@NativeType("FT_Fixed") long value) { FT_Module_Class.nmodule_requires(address(), value); return this; } + /** Sets the address of the specified {@link ByteBuffer} to the {@code module_interface} field. */ + public Buffer module_interface(@Nullable @NativeType("void const *") ByteBuffer value) { FT_Module_Class.nmodule_interface(address(), value); return this; } + /** Sets the specified value to the {@code module_init} field. */ + public Buffer module_init(@Nullable @NativeType("FT_Module_Constructor") FT_Module_ConstructorI value) { FT_Module_Class.nmodule_init(address(), value); return this; } + /** Sets the specified value to the {@code module_done} field. */ + public Buffer module_done(@Nullable @NativeType("FT_Module_Destructor") FT_Module_DestructorI value) { FT_Module_Class.nmodule_done(address(), value); return this; } + /** Sets the specified value to the {@code get_interface} field. */ + public Buffer get_interface(@Nullable @NativeType("FT_Module_Requester") FT_Module_RequesterI value) { FT_Module_Class.nget_interface(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Constructor.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Constructor.java new file mode 100644 index 00000000..9a688163 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Constructor.java @@ -0,0 +1,73 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * FT_Error (*{@link #invoke}) (
+ *     FT_Module module
+ * )
+ */ +public abstract class FT_Module_Constructor extends Callback implements FT_Module_ConstructorI { + + /** + * Creates a {@code FT_Module_Constructor} instance from the specified function pointer. + * + * @return the new {@code FT_Module_Constructor} + */ + public static FT_Module_Constructor create(long functionPointer) { + FT_Module_ConstructorI instance = Callback.get(functionPointer); + return instance instanceof FT_Module_Constructor + ? (FT_Module_Constructor)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Module_Constructor createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Module_Constructor} instance that delegates to the specified {@code FT_Module_ConstructorI} instance. */ + public static FT_Module_Constructor create(FT_Module_ConstructorI instance) { + return instance instanceof FT_Module_Constructor + ? (FT_Module_Constructor)instance + : new Container(instance.address(), instance); + } + + protected FT_Module_Constructor() { + super(CIF); + } + + FT_Module_Constructor(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Module_Constructor { + + private final FT_Module_ConstructorI delegate; + + Container(long functionPointer, FT_Module_ConstructorI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public int invoke(long module) { + return delegate.invoke(module); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_ConstructorI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_ConstructorI.java new file mode 100644 index 00000000..bcf5e91f --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_ConstructorI.java @@ -0,0 +1,47 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * FT_Error (*{@link #invoke}) (
+ *     FT_Module module
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Module_Constructor") +public interface FT_Module_ConstructorI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_sint32, + ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + int __result = invoke( + memGetAddress(memGetAddress(args)) + ); + apiClosureRet(ret, __result); + } + + /** A function used to initialize (not create) a new module object. */ + @NativeType("FT_Error") int invoke(@NativeType("FT_Module") long module); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Destructor.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Destructor.java new file mode 100644 index 00000000..c19f5ac3 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Destructor.java @@ -0,0 +1,73 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     FT_Module module
+ * )
+ */ +public abstract class FT_Module_Destructor extends Callback implements FT_Module_DestructorI { + + /** + * Creates a {@code FT_Module_Destructor} instance from the specified function pointer. + * + * @return the new {@code FT_Module_Destructor} + */ + public static FT_Module_Destructor create(long functionPointer) { + FT_Module_DestructorI instance = Callback.get(functionPointer); + return instance instanceof FT_Module_Destructor + ? (FT_Module_Destructor)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Module_Destructor createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Module_Destructor} instance that delegates to the specified {@code FT_Module_DestructorI} instance. */ + public static FT_Module_Destructor create(FT_Module_DestructorI instance) { + return instance instanceof FT_Module_Destructor + ? (FT_Module_Destructor)instance + : new Container(instance.address(), instance); + } + + protected FT_Module_Destructor() { + super(CIF); + } + + FT_Module_Destructor(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Module_Destructor { + + private final FT_Module_DestructorI delegate; + + Container(long functionPointer, FT_Module_DestructorI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long module) { + delegate.invoke(module); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_DestructorI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_DestructorI.java new file mode 100644 index 00000000..96a5b185 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_DestructorI.java @@ -0,0 +1,46 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     FT_Module module
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Module_Destructor") +public interface FT_Module_DestructorI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_void, + ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + invoke( + memGetAddress(memGetAddress(args)) + ); + } + + /** A function used to finalize (not destroy) a given module object. */ + void invoke(@NativeType("FT_Module") long module); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Requester.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Requester.java new file mode 100644 index 00000000..2aed1f41 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Requester.java @@ -0,0 +1,74 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * FT_Module_Interface (*{@link #invoke}) (
+ *     FT_Module module,
+ *     char const *name
+ * )
+ */ +public abstract class FT_Module_Requester extends Callback implements FT_Module_RequesterI { + + /** + * Creates a {@code FT_Module_Requester} instance from the specified function pointer. + * + * @return the new {@code FT_Module_Requester} + */ + public static FT_Module_Requester create(long functionPointer) { + FT_Module_RequesterI instance = Callback.get(functionPointer); + return instance instanceof FT_Module_Requester + ? (FT_Module_Requester)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Module_Requester createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Module_Requester} instance that delegates to the specified {@code FT_Module_RequesterI} instance. */ + public static FT_Module_Requester create(FT_Module_RequesterI instance) { + return instance instanceof FT_Module_Requester + ? (FT_Module_Requester)instance + : new Container(instance.address(), instance); + } + + protected FT_Module_Requester() { + super(CIF); + } + + FT_Module_Requester(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Module_Requester { + + private final FT_Module_RequesterI delegate; + + Container(long functionPointer, FT_Module_RequesterI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public long invoke(long module, long name) { + return delegate.invoke(module, name); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_RequesterI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_RequesterI.java new file mode 100644 index 00000000..f11dae5d --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_RequesterI.java @@ -0,0 +1,49 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * FT_Module_Interface (*{@link #invoke}) (
+ *     FT_Module module,
+ *     char const *name
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Module_Requester") +public interface FT_Module_RequesterI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_pointer, + ffi_type_pointer, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + long __result = invoke( + memGetAddress(memGetAddress(args)), + memGetAddress(memGetAddress(args + POINTER_SIZE)) + ); + apiClosureRetP(ret, __result); + } + + /** A function used to query a given module for a specific interface. */ + @NativeType("FT_Module_Interface") long invoke(@NativeType("FT_Module") long module, @NativeType("char const *") long name); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Multi_Master.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Multi_Master.java new file mode 100644 index 00000000..28b4d0dc --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Multi_Master.java @@ -0,0 +1,272 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +import static org.lwjgl.util.freetype.FreeType.*; + +/** + * A structure to model the axes and space of a Multiple Masters font. + * + *

Layout

+ * + *

+ * struct FT_Multi_Master {
+ *     FT_UInt num_axis;
+ *     FT_UInt num_designs;
+ *     {@link FT_MM_Axis FT_MM_Axis} axis[T1_MAX_MM_AXIS];
+ * }
+ */ +public class FT_Multi_Master extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + NUM_AXIS, + NUM_DESIGNS, + AXIS; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __array(FT_MM_Axis.SIZEOF, FT_MM_Axis.ALIGNOF, T1_MAX_MM_AXIS) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + NUM_AXIS = layout.offsetof(0); + NUM_DESIGNS = layout.offsetof(1); + AXIS = layout.offsetof(2); + } + + protected FT_Multi_Master(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Multi_Master create(long address, @Nullable ByteBuffer container) { + return new FT_Multi_Master(address, container); + } + + /** + * Creates a {@code FT_Multi_Master} instance at the current position of the specified {@link 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 FT_Multi_Master(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code num_axis} field. */ + @NativeType("FT_UInt") + public int num_axis() { return nnum_axis(address()); } + /** @return the value of the {@code num_designs} field. */ + @NativeType("FT_UInt") + public int num_designs() { return nnum_designs(address()); } + /** @return a {@link FT_MM_Axis}.Buffer view of the {@code axis} field. */ + @NativeType("FT_MM_Axis[T1_MAX_MM_AXIS]") + public FT_MM_Axis.Buffer axis() { return naxis(address()); } + /** @return a {@link FT_MM_Axis} view of the struct at the specified index of the {@code axis} field. */ + public FT_MM_Axis axis(int index) { return naxis(address(), index); } + + // ----------------------------------- + + /** Returns a new {@code FT_Multi_Master} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Multi_Master malloc() { + return new FT_Multi_Master(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Multi_Master} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Multi_Master calloc() { + return new FT_Multi_Master(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Multi_Master} instance allocated with {@link BufferUtils}. */ + public static FT_Multi_Master create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Multi_Master(memAddress(container), container); + } + + /** Returns a new {@code FT_Multi_Master} instance for the specified memory address. */ + public static FT_Multi_Master create(long address) { + return new FT_Multi_Master(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Multi_Master createSafe(long address) { + return address == NULL ? null : new FT_Multi_Master(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Multi_Master} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Multi_Master malloc(MemoryStack stack) { + return new FT_Multi_Master(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Multi_Master} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Multi_Master calloc(MemoryStack stack) { + return new FT_Multi_Master(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #num_axis}. */ + public static int nnum_axis(long struct) { return UNSAFE.getInt(null, struct + FT_Multi_Master.NUM_AXIS); } + /** Unsafe version of {@link #num_designs}. */ + public static int nnum_designs(long struct) { return UNSAFE.getInt(null, struct + FT_Multi_Master.NUM_DESIGNS); } + /** Unsafe version of {@link #axis}. */ + public static FT_MM_Axis.Buffer naxis(long struct) { return FT_MM_Axis.create(struct + FT_Multi_Master.AXIS, T1_MAX_MM_AXIS); } + /** Unsafe version of {@link #axis(int) axis}. */ + public static FT_MM_Axis naxis(long struct, int index) { + return FT_MM_Axis.create(struct + FT_Multi_Master.AXIS + check(index, T1_MAX_MM_AXIS) * FT_MM_Axis.SIZEOF); + } + + // ----------------------------------- + + /** An array of {@link FT_Multi_Master} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Multi_Master ELEMENT_FACTORY = FT_Multi_Master.create(-1L); + + /** + * Creates a new {@code FT_Multi_Master.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 {@link FT_Multi_Master#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Multi_Master getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code num_axis} field. */ + @NativeType("FT_UInt") + public int num_axis() { return FT_Multi_Master.nnum_axis(address()); } + /** @return the value of the {@code num_designs} field. */ + @NativeType("FT_UInt") + public int num_designs() { return FT_Multi_Master.nnum_designs(address()); } + /** @return a {@link FT_MM_Axis}.Buffer view of the {@code axis} field. */ + @NativeType("FT_MM_Axis[T1_MAX_MM_AXIS]") + public FT_MM_Axis.Buffer axis() { return FT_Multi_Master.naxis(address()); } + /** @return a {@link FT_MM_Axis} view of the struct at the specified index of the {@code axis} field. */ + public FT_MM_Axis axis(int index) { return FT_Multi_Master.naxis(address(), index); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_OpaquePaint.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_OpaquePaint.java new file mode 100644 index 00000000..8f321de8 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_OpaquePaint.java @@ -0,0 +1,260 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A structure representing an offset to a {@code Paint} value stored in any of the paint tables of a {@code COLR} v1 font. + * + *

Layout

+ * + *

+ * struct FT_OpaquePaintRec {
+ *     FT_Byte * p;
+ *     FT_Bool insert_root_transform;
+ * }
+ */ +@NativeType("struct FT_OpaquePaintRec") +public class FT_OpaquePaint extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + P, + INSERT_ROOT_TRANSFORM; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(1) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + P = layout.offsetof(0); + INSERT_ROOT_TRANSFORM = layout.offsetof(1); + } + + protected FT_OpaquePaint(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_OpaquePaint create(long address, @Nullable ByteBuffer container) { + return new FT_OpaquePaint(address, container); + } + + /** + * Creates a {@code FT_OpaquePaint} instance at the current position of the specified {@link 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 FT_OpaquePaint(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code p} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("FT_Byte *") + public ByteBuffer p(int capacity) { return np(address(), capacity); } + /** @return the value of the {@code insert_root_transform} field. */ + @NativeType("FT_Bool") + public boolean insert_root_transform() { return ninsert_root_transform(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_OpaquePaint} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_OpaquePaint malloc() { + return new FT_OpaquePaint(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_OpaquePaint} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_OpaquePaint calloc() { + return new FT_OpaquePaint(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_OpaquePaint} instance allocated with {@link BufferUtils}. */ + public static FT_OpaquePaint create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_OpaquePaint(memAddress(container), container); + } + + /** Returns a new {@code FT_OpaquePaint} instance for the specified memory address. */ + public static FT_OpaquePaint create(long address) { + return new FT_OpaquePaint(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_OpaquePaint createSafe(long address) { + return address == NULL ? null : new FT_OpaquePaint(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_OpaquePaint} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_OpaquePaint malloc(MemoryStack stack) { + return new FT_OpaquePaint(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_OpaquePaint} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_OpaquePaint calloc(MemoryStack stack) { + return new FT_OpaquePaint(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #p(int) p}. */ + @Nullable public static ByteBuffer np(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + FT_OpaquePaint.P), capacity); } + /** Unsafe version of {@link #insert_root_transform}. */ + public static boolean ninsert_root_transform(long struct) { return UNSAFE.getByte(null, struct + FT_OpaquePaint.INSERT_ROOT_TRANSFORM) != 0; } + + // ----------------------------------- + + /** An array of {@link FT_OpaquePaint} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_OpaquePaint ELEMENT_FACTORY = FT_OpaquePaint.create(-1L); + + /** + * Creates a new {@code FT_OpaquePaint.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 {@link FT_OpaquePaint#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_OpaquePaint getElementFactory() { + return ELEMENT_FACTORY; + } + + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code p} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("FT_Byte *") + public ByteBuffer p(int capacity) { return FT_OpaquePaint.np(address(), capacity); } + /** @return the value of the {@code insert_root_transform} field. */ + @NativeType("FT_Bool") + public boolean insert_root_transform() { return FT_OpaquePaint.ninsert_root_transform(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Open_Args.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Open_Args.java new file mode 100644 index 00000000..952e2b70 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Open_Args.java @@ -0,0 +1,428 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A structure to indicate how to open a new font file or stream. A pointer to such a structure can be used as a parameter for the functions + * {@link FreeType#FT_Open_Face Open_Face} and {@link FreeType#FT_Attach_Stream Attach_Stream}. + * + *

Layout

+ * + *

+ * struct FT_Open_Args {
+ *     FT_UInt flags;
+ *     FT_Byte const * memory_base;
+ *     FT_Long memory_size;
+ *     FT_String * pathname;
+ *     {@link FT_Stream FT_Stream} stream;
+ *     FT_Module driver;
+ *     FT_Int num_params;
+ *     {@link FT_Parameter FT_Parameter} * params;
+ * }
+ */ +public class FT_Open_Args extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + FLAGS, + MEMORY_BASE, + MEMORY_SIZE, + PATHNAME, + STREAM, + DRIVER, + NUM_PARAMS, + PARAMS; + + static { + Layout layout = __struct( + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(4), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + FLAGS = layout.offsetof(0); + MEMORY_BASE = layout.offsetof(1); + MEMORY_SIZE = layout.offsetof(2); + PATHNAME = layout.offsetof(3); + STREAM = layout.offsetof(4); + DRIVER = layout.offsetof(5); + NUM_PARAMS = layout.offsetof(6); + PARAMS = layout.offsetof(7); + } + + protected FT_Open_Args(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Open_Args create(long address, @Nullable ByteBuffer container) { + return new FT_Open_Args(address, container); + } + + /** + * Creates a {@code FT_Open_Args} instance at the current position of the specified {@link 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 FT_Open_Args(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code flags} field. */ + @NativeType("FT_UInt") + public int flags() { return nflags(address()); } + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code memory_base} field. */ + @Nullable + @NativeType("FT_Byte const *") + public ByteBuffer memory_base() { return nmemory_base(address()); } + /** @return the value of the {@code memory_size} field. */ + @NativeType("FT_Long") + public long memory_size() { return nmemory_size(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code pathname} field. */ + @Nullable + @NativeType("FT_String *") + public ByteBuffer pathname() { return npathname(address()); } + /** @return the null-terminated string pointed to by the {@code pathname} field. */ + @Nullable + @NativeType("FT_String *") + public String pathnameString() { return npathnameString(address()); } + /** @return a {@link FT_Stream} view of the struct pointed to by the {@code stream} field. */ + @Nullable + public FT_Stream stream$() { return nstream$(address()); } + /** @return the value of the {@code driver} field. */ + @NativeType("FT_Module") + public long driver() { return ndriver(address()); } + /** @return the value of the {@code num_params} field. */ + @NativeType("FT_Int") + public int num_params() { return nnum_params(address()); } + /** @return a {@link FT_Parameter.Buffer} view of the struct array pointed to by the {@code params} field. */ + @Nullable + @NativeType("FT_Parameter *") + public FT_Parameter.Buffer params() { return nparams(address()); } + + /** Sets the specified value to the {@code flags} field. */ + public FT_Open_Args flags(@NativeType("FT_UInt") int value) { nflags(address(), value); return this; } + /** Sets the address of the specified {@link ByteBuffer} to the {@code memory_base} field. */ + public FT_Open_Args memory_base(@Nullable @NativeType("FT_Byte const *") ByteBuffer value) { nmemory_base(address(), value); return this; } + /** Sets the specified value to the {@code memory_size} field. */ + public FT_Open_Args memory_size(@NativeType("FT_Long") long value) { nmemory_size(address(), value); return this; } + /** Sets the address of the specified encoded string to the {@code pathname} field. */ + public FT_Open_Args pathname(@Nullable @NativeType("FT_String *") ByteBuffer value) { npathname(address(), value); return this; } + /** Sets the address of the specified {@link FT_Stream} to the {@code stream} field. */ + public FT_Open_Args stream$(@Nullable FT_Stream value) { nstream$(address(), value); return this; } + /** Sets the specified value to the {@code driver} field. */ + public FT_Open_Args driver(@NativeType("FT_Module") long value) { ndriver(address(), value); return this; } + /** Sets the specified value to the {@code num_params} field. */ + public FT_Open_Args num_params(@NativeType("FT_Int") int value) { nnum_params(address(), value); return this; } + /** Sets the address of the specified {@link FT_Parameter.Buffer} to the {@code params} field. */ + public FT_Open_Args params(@Nullable @NativeType("FT_Parameter *") FT_Parameter.Buffer value) { nparams(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_Open_Args set( + int flags, + @Nullable ByteBuffer memory_base, + long memory_size, + @Nullable ByteBuffer pathname, + @Nullable FT_Stream stream$, + long driver, + int num_params, + @Nullable FT_Parameter.Buffer params + ) { + flags(flags); + memory_base(memory_base); + memory_size(memory_size); + pathname(pathname); + stream$(stream$); + driver(driver); + num_params(num_params); + params(params); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Open_Args set(FT_Open_Args src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Open_Args} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Open_Args malloc() { + return new FT_Open_Args(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Open_Args} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Open_Args calloc() { + return new FT_Open_Args(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Open_Args} instance allocated with {@link BufferUtils}. */ + public static FT_Open_Args create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Open_Args(memAddress(container), container); + } + + /** Returns a new {@code FT_Open_Args} instance for the specified memory address. */ + public static FT_Open_Args create(long address) { + return new FT_Open_Args(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Open_Args createSafe(long address) { + return address == NULL ? null : new FT_Open_Args(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Open_Args} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Open_Args malloc(MemoryStack stack) { + return new FT_Open_Args(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Open_Args} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Open_Args calloc(MemoryStack stack) { + return new FT_Open_Args(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #flags}. */ + public static int nflags(long struct) { return UNSAFE.getInt(null, struct + FT_Open_Args.FLAGS); } + /** Unsafe version of {@link #memory_base() memory_base}. */ + @Nullable public static ByteBuffer nmemory_base(long struct) { return memByteBufferSafe(memGetAddress(struct + FT_Open_Args.MEMORY_BASE), (int)nmemory_size(struct)); } + /** Unsafe version of {@link #memory_size}. */ + public static long nmemory_size(long struct) { return memGetCLong(struct + FT_Open_Args.MEMORY_SIZE); } + /** Unsafe version of {@link #pathname}. */ + @Nullable public static ByteBuffer npathname(long struct) { return memByteBufferNT1Safe(memGetAddress(struct + FT_Open_Args.PATHNAME)); } + /** Unsafe version of {@link #pathnameString}. */ + @Nullable public static String npathnameString(long struct) { return memUTF8Safe(memGetAddress(struct + FT_Open_Args.PATHNAME)); } + /** Unsafe version of {@link #stream$}. */ + @Nullable public static FT_Stream nstream$(long struct) { return FT_Stream.createSafe(memGetAddress(struct + FT_Open_Args.STREAM)); } + /** Unsafe version of {@link #driver}. */ + public static long ndriver(long struct) { return memGetAddress(struct + FT_Open_Args.DRIVER); } + /** Unsafe version of {@link #num_params}. */ + public static int nnum_params(long struct) { return UNSAFE.getInt(null, struct + FT_Open_Args.NUM_PARAMS); } + /** Unsafe version of {@link #params}. */ + @Nullable public static FT_Parameter.Buffer nparams(long struct) { return FT_Parameter.createSafe(memGetAddress(struct + FT_Open_Args.PARAMS), nnum_params(struct)); } + + /** Unsafe version of {@link #flags(int) flags}. */ + public static void nflags(long struct, int value) { UNSAFE.putInt(null, struct + FT_Open_Args.FLAGS, value); } + /** Unsafe version of {@link #memory_base(ByteBuffer) memory_base}. */ + public static void nmemory_base(long struct, @Nullable ByteBuffer value) { memPutAddress(struct + FT_Open_Args.MEMORY_BASE, memAddressSafe(value)); nmemory_size(struct, value == null ? 0 : value.remaining()); } + /** Sets the specified value to the {@code memory_size} field of the specified {@code struct}. */ + public static void nmemory_size(long struct, long value) { memPutCLong(struct + FT_Open_Args.MEMORY_SIZE, value); } + /** Unsafe version of {@link #pathname(ByteBuffer) pathname}. */ + public static void npathname(long struct, @Nullable ByteBuffer value) { + if (CHECKS) { checkNT1Safe(value); } + memPutAddress(struct + FT_Open_Args.PATHNAME, memAddressSafe(value)); + } + /** Unsafe version of {@link #stream$(FT_Stream) stream$}. */ + public static void nstream$(long struct, @Nullable FT_Stream value) { memPutAddress(struct + FT_Open_Args.STREAM, memAddressSafe(value)); } + /** Unsafe version of {@link #driver(long) driver}. */ + public static void ndriver(long struct, long value) { memPutAddress(struct + FT_Open_Args.DRIVER, value); } + /** Sets the specified value to the {@code num_params} field of the specified {@code struct}. */ + public static void nnum_params(long struct, int value) { UNSAFE.putInt(null, struct + FT_Open_Args.NUM_PARAMS, value); } + /** Unsafe version of {@link #params(FT_Parameter.Buffer) params}. */ + public static void nparams(long struct, @Nullable FT_Parameter.Buffer value) { memPutAddress(struct + FT_Open_Args.PARAMS, memAddressSafe(value)); nnum_params(struct, value == null ? 0 : value.remaining()); } + + // ----------------------------------- + + /** An array of {@link FT_Open_Args} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Open_Args ELEMENT_FACTORY = FT_Open_Args.create(-1L); + + /** + * Creates a new {@code FT_Open_Args.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 {@link FT_Open_Args#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Open_Args getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code flags} field. */ + @NativeType("FT_UInt") + public int flags() { return FT_Open_Args.nflags(address()); } + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code memory_base} field. */ + @Nullable + @NativeType("FT_Byte const *") + public ByteBuffer memory_base() { return FT_Open_Args.nmemory_base(address()); } + /** @return the value of the {@code memory_size} field. */ + @NativeType("FT_Long") + public long memory_size() { return FT_Open_Args.nmemory_size(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code pathname} field. */ + @Nullable + @NativeType("FT_String *") + public ByteBuffer pathname() { return FT_Open_Args.npathname(address()); } + /** @return the null-terminated string pointed to by the {@code pathname} field. */ + @Nullable + @NativeType("FT_String *") + public String pathnameString() { return FT_Open_Args.npathnameString(address()); } + /** @return a {@link FT_Stream} view of the struct pointed to by the {@code stream} field. */ + @Nullable + public FT_Stream stream$() { return FT_Open_Args.nstream$(address()); } + /** @return the value of the {@code driver} field. */ + @NativeType("FT_Module") + public long driver() { return FT_Open_Args.ndriver(address()); } + /** @return the value of the {@code num_params} field. */ + @NativeType("FT_Int") + public int num_params() { return FT_Open_Args.nnum_params(address()); } + /** @return a {@link FT_Parameter.Buffer} view of the struct array pointed to by the {@code params} field. */ + @Nullable + @NativeType("FT_Parameter *") + public FT_Parameter.Buffer params() { return FT_Open_Args.nparams(address()); } + + /** Sets the specified value to the {@code flags} field. */ + public Buffer flags(@NativeType("FT_UInt") int value) { FT_Open_Args.nflags(address(), value); return this; } + /** Sets the address of the specified {@link ByteBuffer} to the {@code memory_base} field. */ + public Buffer memory_base(@Nullable @NativeType("FT_Byte const *") ByteBuffer value) { FT_Open_Args.nmemory_base(address(), value); return this; } + /** Sets the specified value to the {@code memory_size} field. */ + public Buffer memory_size(@NativeType("FT_Long") long value) { FT_Open_Args.nmemory_size(address(), value); return this; } + /** Sets the address of the specified encoded string to the {@code pathname} field. */ + public Buffer pathname(@Nullable @NativeType("FT_String *") ByteBuffer value) { FT_Open_Args.npathname(address(), value); return this; } + /** Sets the address of the specified {@link FT_Stream} to the {@code stream} field. */ + public Buffer stream$(@Nullable FT_Stream value) { FT_Open_Args.nstream$(address(), value); return this; } + /** Sets the specified value to the {@code driver} field. */ + public Buffer driver(@NativeType("FT_Module") long value) { FT_Open_Args.ndriver(address(), value); return this; } + /** Sets the specified value to the {@code num_params} field. */ + public Buffer num_params(@NativeType("FT_Int") int value) { FT_Open_Args.nnum_params(address(), value); return this; } + /** Sets the address of the specified {@link FT_Parameter.Buffer} to the {@code params} field. */ + public Buffer params(@Nullable @NativeType("FT_Parameter *") FT_Parameter.Buffer value) { FT_Open_Args.nparams(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline.java new file mode 100644 index 00000000..76f53300 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline.java @@ -0,0 +1,291 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * This structure is used to describe an outline to the scan-line converter. + * + *

Layout

+ * + *

+ * struct FT_Outline {
+ *     short {@link #n_contours};
+ *     short {@link #n_points};
+ *     {@link FT_Vector FT_Vector} * {@link #points};
+ *     char * {@link #tags};
+ *     short * {@link #contours};
+ *     int {@link #flags};
+ * }
+ */ +public class FT_Outline extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + N_CONTOURS, + N_POINTS, + POINTS, + TAGS, + CONTOURS, + FLAGS; + + static { + Layout layout = __struct( + __member(2), + __member(2), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + N_CONTOURS = layout.offsetof(0); + N_POINTS = layout.offsetof(1); + POINTS = layout.offsetof(2); + TAGS = layout.offsetof(3); + CONTOURS = layout.offsetof(4); + FLAGS = layout.offsetof(5); + } + + protected FT_Outline(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Outline create(long address, @Nullable ByteBuffer container) { + return new FT_Outline(address, container); + } + + /** + * Creates a {@code FT_Outline} instance at the current position of the specified {@link 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 FT_Outline(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** number of contours in glyph */ + public short n_contours() { return nn_contours(address()); } + /** number of points in the glyph */ + public short n_points() { return nn_points(address()); } + /** the outline's points */ + @NativeType("FT_Vector *") + public FT_Vector.Buffer points() { return npoints(address()); } + /** the points flags */ + @NativeType("char *") + public ByteBuffer tags() { return ntags(address()); } + /** the contour end points */ + @NativeType("short *") + public ShortBuffer contours() { return ncontours(address()); } + /** outline masks */ + public int flags() { return nflags(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Outline} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Outline malloc() { + return new FT_Outline(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Outline} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Outline calloc() { + return new FT_Outline(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Outline} instance allocated with {@link BufferUtils}. */ + public static FT_Outline create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Outline(memAddress(container), container); + } + + /** Returns a new {@code FT_Outline} instance for the specified memory address. */ + public static FT_Outline create(long address) { + return new FT_Outline(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Outline createSafe(long address) { + return address == NULL ? null : new FT_Outline(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Outline} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Outline malloc(MemoryStack stack) { + return new FT_Outline(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Outline} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Outline calloc(MemoryStack stack) { + return new FT_Outline(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #n_contours}. */ + public static short nn_contours(long struct) { return UNSAFE.getShort(null, struct + FT_Outline.N_CONTOURS); } + /** Unsafe version of {@link #n_points}. */ + public static short nn_points(long struct) { return UNSAFE.getShort(null, struct + FT_Outline.N_POINTS); } + /** Unsafe version of {@link #points}. */ + public static FT_Vector.Buffer npoints(long struct) { return FT_Vector.create(memGetAddress(struct + FT_Outline.POINTS), nn_points(struct)); } + /** Unsafe version of {@link #tags() tags}. */ + public static ByteBuffer ntags(long struct) { return memByteBuffer(memGetAddress(struct + FT_Outline.TAGS), nn_points(struct)); } + /** Unsafe version of {@link #contours() contours}. */ + public static ShortBuffer ncontours(long struct) { return memShortBuffer(memGetAddress(struct + FT_Outline.CONTOURS), nn_contours(struct)); } + /** Unsafe version of {@link #flags}. */ + public static int nflags(long struct) { return UNSAFE.getInt(null, struct + FT_Outline.FLAGS); } + + // ----------------------------------- + + /** An array of {@link FT_Outline} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Outline ELEMENT_FACTORY = FT_Outline.create(-1L); + + /** + * Creates a new {@code FT_Outline.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 {@link FT_Outline#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Outline getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@link FT_Outline#n_contours} field. */ + public short n_contours() { return FT_Outline.nn_contours(address()); } + /** @return the value of the {@link FT_Outline#n_points} field. */ + public short n_points() { return FT_Outline.nn_points(address()); } + /** @return a {@link FT_Vector.Buffer} view of the struct array pointed to by the {@link FT_Outline#points} field. */ + @NativeType("FT_Vector *") + public FT_Vector.Buffer points() { return FT_Outline.npoints(address()); } + /** @return a {@link ByteBuffer} view of the data pointed to by the {@link FT_Outline#tags} field. */ + @NativeType("char *") + public ByteBuffer tags() { return FT_Outline.ntags(address()); } + /** @return a {@link ShortBuffer} view of the data pointed to by the {@link FT_Outline#contours} field. */ + @NativeType("short *") + public ShortBuffer contours() { return FT_Outline.ncontours(address()); } + /** @return the value of the {@link FT_Outline#flags} field. */ + public int flags() { return FT_Outline.nflags(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_OutlineGlyph.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_OutlineGlyph.java new file mode 100644 index 00000000..5a314bef --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_OutlineGlyph.java @@ -0,0 +1,164 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure used for outline (vectorial) glyph images. This really is a 'sub-class' of {@link FT_Glyph}. + * + *

Layout

+ * + *

+ * struct FT_OutlineGlyphRec {
+ *     {@link FT_Glyph FT_GlyphRec} root;
+ *     {@link FT_Outline FT_Outline} outline;
+ * }
+ */ +@NativeType("struct FT_OutlineGlyphRec") +public class FT_OutlineGlyph extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + ROOT, + OUTLINE; + + static { + Layout layout = __struct( + __member(FT_Glyph.SIZEOF, FT_Glyph.ALIGNOF), + __member(FT_Outline.SIZEOF, FT_Outline.ALIGNOF) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + ROOT = layout.offsetof(0); + OUTLINE = layout.offsetof(1); + } + + protected FT_OutlineGlyph(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_OutlineGlyph create(long address, @Nullable ByteBuffer container) { + return new FT_OutlineGlyph(address, container); + } + + /** + * Creates a {@code FT_OutlineGlyph} instance at the current position of the specified {@link 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 FT_OutlineGlyph(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_Glyph} view of the {@code root} field. */ + @NativeType("FT_GlyphRec") + public FT_Glyph root() { return nroot(address()); } + /** @return a {@link FT_Outline} view of the {@code outline} field. */ + public FT_Outline outline() { return noutline(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_OutlineGlyph} instance for the specified memory address. */ + public static FT_OutlineGlyph create(long address) { + return new FT_OutlineGlyph(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_OutlineGlyph createSafe(long address) { + return address == NULL ? null : new FT_OutlineGlyph(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #root}. */ + public static FT_Glyph nroot(long struct) { return FT_Glyph.create(struct + FT_OutlineGlyph.ROOT); } + /** Unsafe version of {@link #outline}. */ + public static FT_Outline noutline(long struct) { return FT_Outline.create(struct + FT_OutlineGlyph.OUTLINE); } + + // ----------------------------------- + + /** An array of {@link FT_OutlineGlyph} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_OutlineGlyph ELEMENT_FACTORY = FT_OutlineGlyph.create(-1L); + + /** + * Creates a new {@code FT_OutlineGlyph.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 {@link FT_OutlineGlyph#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_OutlineGlyph getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_Glyph} view of the {@code root} field. */ + @NativeType("FT_GlyphRec") + public FT_Glyph root() { return FT_OutlineGlyph.nroot(address()); } + /** @return a {@link FT_Outline} view of the {@code outline} field. */ + public FT_Outline outline() { return FT_OutlineGlyph.noutline(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_ConicToFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_ConicToFunc.java new file mode 100644 index 00000000..324fe0c7 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_ConicToFunc.java @@ -0,0 +1,75 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * int (*{@link #invoke}) (
+ *     FT_Vector const *control,
+ *     FT_Vector const *to,
+ *     void *user
+ * )
+ */ +public abstract class FT_Outline_ConicToFunc extends Callback implements FT_Outline_ConicToFuncI { + + /** + * Creates a {@code FT_Outline_ConicToFunc} instance from the specified function pointer. + * + * @return the new {@code FT_Outline_ConicToFunc} + */ + public static FT_Outline_ConicToFunc create(long functionPointer) { + FT_Outline_ConicToFuncI instance = Callback.get(functionPointer); + return instance instanceof FT_Outline_ConicToFunc + ? (FT_Outline_ConicToFunc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Outline_ConicToFunc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Outline_ConicToFunc} instance that delegates to the specified {@code FT_Outline_ConicToFuncI} instance. */ + public static FT_Outline_ConicToFunc create(FT_Outline_ConicToFuncI instance) { + return instance instanceof FT_Outline_ConicToFunc + ? (FT_Outline_ConicToFunc)instance + : new Container(instance.address(), instance); + } + + protected FT_Outline_ConicToFunc() { + super(CIF); + } + + FT_Outline_ConicToFunc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Outline_ConicToFunc { + + private final FT_Outline_ConicToFuncI delegate; + + Container(long functionPointer, FT_Outline_ConicToFuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public int invoke(long control, long to, long user) { + return delegate.invoke(control, to, user); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_ConicToFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_ConicToFuncI.java new file mode 100644 index 00000000..2f708327 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_ConicToFuncI.java @@ -0,0 +1,51 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * int (*{@link #invoke}) (
+ *     FT_Vector const *control,
+ *     FT_Vector const *to,
+ *     void *user
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Outline_ConicToFunc") +public interface FT_Outline_ConicToFuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_sint32, + ffi_type_pointer, ffi_type_pointer, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + int __result = invoke( + memGetAddress(memGetAddress(args)), + memGetAddress(memGetAddress(args + POINTER_SIZE)), + memGetAddress(memGetAddress(args + 2 * POINTER_SIZE)) + ); + apiClosureRet(ret, __result); + } + + /** A function pointer type used to describe the signature of a 'conic to' function during outline walking or decomposition. */ + int invoke(@NativeType("FT_Vector const *") long control, @NativeType("FT_Vector const *") long to, @NativeType("void *") long user); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_CubicToFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_CubicToFunc.java new file mode 100644 index 00000000..964b8658 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_CubicToFunc.java @@ -0,0 +1,76 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * int (*{@link #invoke}) (
+ *     FT_Vector const *control1,
+ *     FT_Vector const *control2,
+ *     FT_Vector const *to,
+ *     void *user
+ * )
+ */ +public abstract class FT_Outline_CubicToFunc extends Callback implements FT_Outline_CubicToFuncI { + + /** + * Creates a {@code FT_Outline_CubicToFunc} instance from the specified function pointer. + * + * @return the new {@code FT_Outline_CubicToFunc} + */ + public static FT_Outline_CubicToFunc create(long functionPointer) { + FT_Outline_CubicToFuncI instance = Callback.get(functionPointer); + return instance instanceof FT_Outline_CubicToFunc + ? (FT_Outline_CubicToFunc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Outline_CubicToFunc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Outline_CubicToFunc} instance that delegates to the specified {@code FT_Outline_CubicToFuncI} instance. */ + public static FT_Outline_CubicToFunc create(FT_Outline_CubicToFuncI instance) { + return instance instanceof FT_Outline_CubicToFunc + ? (FT_Outline_CubicToFunc)instance + : new Container(instance.address(), instance); + } + + protected FT_Outline_CubicToFunc() { + super(CIF); + } + + FT_Outline_CubicToFunc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Outline_CubicToFunc { + + private final FT_Outline_CubicToFuncI delegate; + + Container(long functionPointer, FT_Outline_CubicToFuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public int invoke(long control1, long control2, long to, long user) { + return delegate.invoke(control1, control2, to, user); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_CubicToFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_CubicToFuncI.java new file mode 100644 index 00000000..b5eeb9db --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_CubicToFuncI.java @@ -0,0 +1,53 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * int (*{@link #invoke}) (
+ *     FT_Vector const *control1,
+ *     FT_Vector const *control2,
+ *     FT_Vector const *to,
+ *     void *user
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Outline_CubicToFunc") +public interface FT_Outline_CubicToFuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_sint32, + ffi_type_pointer, ffi_type_pointer, ffi_type_pointer, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + int __result = invoke( + memGetAddress(memGetAddress(args)), + memGetAddress(memGetAddress(args + POINTER_SIZE)), + memGetAddress(memGetAddress(args + 2 * POINTER_SIZE)), + memGetAddress(memGetAddress(args + 3 * POINTER_SIZE)) + ); + apiClosureRet(ret, __result); + } + + /** A function pointer type used to describe the signature of a 'cubic to' function during outline walking or decomposition. */ + int invoke(@NativeType("FT_Vector const *") long control1, @NativeType("FT_Vector const *") long control2, @NativeType("FT_Vector const *") long to, @NativeType("void *") long user); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_Funcs.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_Funcs.java new file mode 100644 index 00000000..be744ffa --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_Funcs.java @@ -0,0 +1,365 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A structure to hold various function pointers used during outline decomposition in order to emit segments, conic, and cubic Beziers. + * + *

Layout

+ * + *

+ * struct FT_Outline_Funcs {
+ *     {@link FT_Outline_MoveToFuncI FT_Outline_MoveToFunc} move_to;
+ *     {@link FT_Outline_LineToFuncI FT_Outline_LineToFunc} line_to;
+ *     {@link FT_Outline_ConicToFuncI FT_Outline_ConicToFunc} conic_to;
+ *     {@link FT_Outline_CubicToFuncI FT_Outline_CubicToFunc} cubic_to;
+ *     int shift;
+ *     FT_Pos delta;
+ * }
+ */ +public class FT_Outline_Funcs extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + MOVE_TO, + LINE_TO, + CONIC_TO, + CUBIC_TO, + SHIFT, + DELTA; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(4), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + MOVE_TO = layout.offsetof(0); + LINE_TO = layout.offsetof(1); + CONIC_TO = layout.offsetof(2); + CUBIC_TO = layout.offsetof(3); + SHIFT = layout.offsetof(4); + DELTA = layout.offsetof(5); + } + + protected FT_Outline_Funcs(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Outline_Funcs create(long address, @Nullable ByteBuffer container) { + return new FT_Outline_Funcs(address, container); + } + + /** + * Creates a {@code FT_Outline_Funcs} instance at the current position of the specified {@link 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 FT_Outline_Funcs(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code move_to} field. */ + @Nullable + public FT_Outline_MoveToFunc move_to() { return nmove_to(address()); } + /** @return the value of the {@code line_to} field. */ + @Nullable + public FT_Outline_LineToFunc line_to() { return nline_to(address()); } + /** @return the value of the {@code conic_to} field. */ + @Nullable + public FT_Outline_ConicToFunc conic_to() { return nconic_to(address()); } + /** @return the value of the {@code cubic_to} field. */ + @Nullable + public FT_Outline_CubicToFunc cubic_to() { return ncubic_to(address()); } + /** @return the value of the {@code shift} field. */ + public int shift() { return nshift(address()); } + /** @return the value of the {@code delta} field. */ + @NativeType("FT_Pos") + public long delta() { return ndelta(address()); } + + /** Sets the specified value to the {@code move_to} field. */ + public FT_Outline_Funcs move_to(@Nullable @NativeType("FT_Outline_MoveToFunc") FT_Outline_MoveToFuncI value) { nmove_to(address(), value); return this; } + /** Sets the specified value to the {@code line_to} field. */ + public FT_Outline_Funcs line_to(@Nullable @NativeType("FT_Outline_LineToFunc") FT_Outline_LineToFuncI value) { nline_to(address(), value); return this; } + /** Sets the specified value to the {@code conic_to} field. */ + public FT_Outline_Funcs conic_to(@Nullable @NativeType("FT_Outline_ConicToFunc") FT_Outline_ConicToFuncI value) { nconic_to(address(), value); return this; } + /** Sets the specified value to the {@code cubic_to} field. */ + public FT_Outline_Funcs cubic_to(@Nullable @NativeType("FT_Outline_CubicToFunc") FT_Outline_CubicToFuncI value) { ncubic_to(address(), value); return this; } + /** Sets the specified value to the {@code shift} field. */ + public FT_Outline_Funcs shift(int value) { nshift(address(), value); return this; } + /** Sets the specified value to the {@code delta} field. */ + public FT_Outline_Funcs delta(@NativeType("FT_Pos") long value) { ndelta(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_Outline_Funcs set( + FT_Outline_MoveToFuncI move_to, + FT_Outline_LineToFuncI line_to, + FT_Outline_ConicToFuncI conic_to, + FT_Outline_CubicToFuncI cubic_to, + int shift, + long delta + ) { + move_to(move_to); + line_to(line_to); + conic_to(conic_to); + cubic_to(cubic_to); + shift(shift); + delta(delta); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Outline_Funcs set(FT_Outline_Funcs src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Outline_Funcs} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Outline_Funcs malloc() { + return new FT_Outline_Funcs(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Outline_Funcs} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Outline_Funcs calloc() { + return new FT_Outline_Funcs(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Outline_Funcs} instance allocated with {@link BufferUtils}. */ + public static FT_Outline_Funcs create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Outline_Funcs(memAddress(container), container); + } + + /** Returns a new {@code FT_Outline_Funcs} instance for the specified memory address. */ + public static FT_Outline_Funcs create(long address) { + return new FT_Outline_Funcs(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Outline_Funcs createSafe(long address) { + return address == NULL ? null : new FT_Outline_Funcs(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Outline_Funcs} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Outline_Funcs malloc(MemoryStack stack) { + return new FT_Outline_Funcs(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Outline_Funcs} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Outline_Funcs calloc(MemoryStack stack) { + return new FT_Outline_Funcs(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #move_to}. */ + @Nullable public static FT_Outline_MoveToFunc nmove_to(long struct) { return FT_Outline_MoveToFunc.createSafe(memGetAddress(struct + FT_Outline_Funcs.MOVE_TO)); } + /** Unsafe version of {@link #line_to}. */ + @Nullable public static FT_Outline_LineToFunc nline_to(long struct) { return FT_Outline_LineToFunc.createSafe(memGetAddress(struct + FT_Outline_Funcs.LINE_TO)); } + /** Unsafe version of {@link #conic_to}. */ + @Nullable public static FT_Outline_ConicToFunc nconic_to(long struct) { return FT_Outline_ConicToFunc.createSafe(memGetAddress(struct + FT_Outline_Funcs.CONIC_TO)); } + /** Unsafe version of {@link #cubic_to}. */ + @Nullable public static FT_Outline_CubicToFunc ncubic_to(long struct) { return FT_Outline_CubicToFunc.createSafe(memGetAddress(struct + FT_Outline_Funcs.CUBIC_TO)); } + /** Unsafe version of {@link #shift}. */ + public static int nshift(long struct) { return UNSAFE.getInt(null, struct + FT_Outline_Funcs.SHIFT); } + /** Unsafe version of {@link #delta}. */ + public static long ndelta(long struct) { return memGetCLong(struct + FT_Outline_Funcs.DELTA); } + + /** Unsafe version of {@link #move_to(FT_Outline_MoveToFuncI) move_to}. */ + public static void nmove_to(long struct, @Nullable FT_Outline_MoveToFuncI value) { memPutAddress(struct + FT_Outline_Funcs.MOVE_TO, memAddressSafe(value)); } + /** Unsafe version of {@link #line_to(FT_Outline_LineToFuncI) line_to}. */ + public static void nline_to(long struct, @Nullable FT_Outline_LineToFuncI value) { memPutAddress(struct + FT_Outline_Funcs.LINE_TO, memAddressSafe(value)); } + /** Unsafe version of {@link #conic_to(FT_Outline_ConicToFuncI) conic_to}. */ + public static void nconic_to(long struct, @Nullable FT_Outline_ConicToFuncI value) { memPutAddress(struct + FT_Outline_Funcs.CONIC_TO, memAddressSafe(value)); } + /** Unsafe version of {@link #cubic_to(FT_Outline_CubicToFuncI) cubic_to}. */ + public static void ncubic_to(long struct, @Nullable FT_Outline_CubicToFuncI value) { memPutAddress(struct + FT_Outline_Funcs.CUBIC_TO, memAddressSafe(value)); } + /** Unsafe version of {@link #shift(int) shift}. */ + public static void nshift(long struct, int value) { UNSAFE.putInt(null, struct + FT_Outline_Funcs.SHIFT, value); } + /** Unsafe version of {@link #delta(long) delta}. */ + public static void ndelta(long struct, long value) { memPutCLong(struct + FT_Outline_Funcs.DELTA, value); } + + // ----------------------------------- + + /** An array of {@link FT_Outline_Funcs} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Outline_Funcs ELEMENT_FACTORY = FT_Outline_Funcs.create(-1L); + + /** + * Creates a new {@code FT_Outline_Funcs.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 {@link FT_Outline_Funcs#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Outline_Funcs getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code move_to} field. */ + @Nullable + public FT_Outline_MoveToFunc move_to() { return FT_Outline_Funcs.nmove_to(address()); } + /** @return the value of the {@code line_to} field. */ + @Nullable + public FT_Outline_LineToFunc line_to() { return FT_Outline_Funcs.nline_to(address()); } + /** @return the value of the {@code conic_to} field. */ + @Nullable + public FT_Outline_ConicToFunc conic_to() { return FT_Outline_Funcs.nconic_to(address()); } + /** @return the value of the {@code cubic_to} field. */ + @Nullable + public FT_Outline_CubicToFunc cubic_to() { return FT_Outline_Funcs.ncubic_to(address()); } + /** @return the value of the {@code shift} field. */ + public int shift() { return FT_Outline_Funcs.nshift(address()); } + /** @return the value of the {@code delta} field. */ + @NativeType("FT_Pos") + public long delta() { return FT_Outline_Funcs.ndelta(address()); } + + /** Sets the specified value to the {@code move_to} field. */ + public Buffer move_to(@Nullable @NativeType("FT_Outline_MoveToFunc") FT_Outline_MoveToFuncI value) { FT_Outline_Funcs.nmove_to(address(), value); return this; } + /** Sets the specified value to the {@code line_to} field. */ + public Buffer line_to(@Nullable @NativeType("FT_Outline_LineToFunc") FT_Outline_LineToFuncI value) { FT_Outline_Funcs.nline_to(address(), value); return this; } + /** Sets the specified value to the {@code conic_to} field. */ + public Buffer conic_to(@Nullable @NativeType("FT_Outline_ConicToFunc") FT_Outline_ConicToFuncI value) { FT_Outline_Funcs.nconic_to(address(), value); return this; } + /** Sets the specified value to the {@code cubic_to} field. */ + public Buffer cubic_to(@Nullable @NativeType("FT_Outline_CubicToFunc") FT_Outline_CubicToFuncI value) { FT_Outline_Funcs.ncubic_to(address(), value); return this; } + /** Sets the specified value to the {@code shift} field. */ + public Buffer shift(int value) { FT_Outline_Funcs.nshift(address(), value); return this; } + /** Sets the specified value to the {@code delta} field. */ + public Buffer delta(@NativeType("FT_Pos") long value) { FT_Outline_Funcs.ndelta(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_LineToFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_LineToFunc.java new file mode 100644 index 00000000..8b215288 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_LineToFunc.java @@ -0,0 +1,74 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * int (*{@link #invoke}) (
+ *     FT_Vector const *to,
+ *     void *user
+ * )
+ */ +public abstract class FT_Outline_LineToFunc extends Callback implements FT_Outline_LineToFuncI { + + /** + * Creates a {@code FT_Outline_LineToFunc} instance from the specified function pointer. + * + * @return the new {@code FT_Outline_LineToFunc} + */ + public static FT_Outline_LineToFunc create(long functionPointer) { + FT_Outline_LineToFuncI instance = Callback.get(functionPointer); + return instance instanceof FT_Outline_LineToFunc + ? (FT_Outline_LineToFunc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Outline_LineToFunc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Outline_LineToFunc} instance that delegates to the specified {@code FT_Outline_LineToFuncI} instance. */ + public static FT_Outline_LineToFunc create(FT_Outline_LineToFuncI instance) { + return instance instanceof FT_Outline_LineToFunc + ? (FT_Outline_LineToFunc)instance + : new Container(instance.address(), instance); + } + + protected FT_Outline_LineToFunc() { + super(CIF); + } + + FT_Outline_LineToFunc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Outline_LineToFunc { + + private final FT_Outline_LineToFuncI delegate; + + Container(long functionPointer, FT_Outline_LineToFuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public int invoke(long to, long user) { + return delegate.invoke(to, user); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_LineToFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_LineToFuncI.java new file mode 100644 index 00000000..7043291d --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_LineToFuncI.java @@ -0,0 +1,49 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * int (*{@link #invoke}) (
+ *     FT_Vector const *to,
+ *     void *user
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Outline_LineToFunc") +public interface FT_Outline_LineToFuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_sint32, + ffi_type_pointer, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + int __result = invoke( + memGetAddress(memGetAddress(args)), + memGetAddress(memGetAddress(args + POINTER_SIZE)) + ); + apiClosureRet(ret, __result); + } + + /** A function pointer type used to describe the signature of a 'line to' function during outline walking/decomposition. */ + int invoke(@NativeType("FT_Vector const *") long to, @NativeType("void *") long user); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_MoveToFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_MoveToFunc.java new file mode 100644 index 00000000..dbf091d1 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_MoveToFunc.java @@ -0,0 +1,74 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * int (*{@link #invoke}) (
+ *     FT_Vector const *to,
+ *     void *user
+ * )
+ */ +public abstract class FT_Outline_MoveToFunc extends Callback implements FT_Outline_MoveToFuncI { + + /** + * Creates a {@code FT_Outline_MoveToFunc} instance from the specified function pointer. + * + * @return the new {@code FT_Outline_MoveToFunc} + */ + public static FT_Outline_MoveToFunc create(long functionPointer) { + FT_Outline_MoveToFuncI instance = Callback.get(functionPointer); + return instance instanceof FT_Outline_MoveToFunc + ? (FT_Outline_MoveToFunc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Outline_MoveToFunc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Outline_MoveToFunc} instance that delegates to the specified {@code FT_Outline_MoveToFuncI} instance. */ + public static FT_Outline_MoveToFunc create(FT_Outline_MoveToFuncI instance) { + return instance instanceof FT_Outline_MoveToFunc + ? (FT_Outline_MoveToFunc)instance + : new Container(instance.address(), instance); + } + + protected FT_Outline_MoveToFunc() { + super(CIF); + } + + FT_Outline_MoveToFunc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Outline_MoveToFunc { + + private final FT_Outline_MoveToFuncI delegate; + + Container(long functionPointer, FT_Outline_MoveToFuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public int invoke(long to, long user) { + return delegate.invoke(to, user); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_MoveToFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_MoveToFuncI.java new file mode 100644 index 00000000..b6019594 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_MoveToFuncI.java @@ -0,0 +1,49 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * int (*{@link #invoke}) (
+ *     FT_Vector const *to,
+ *     void *user
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Outline_MoveToFunc") +public interface FT_Outline_MoveToFuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_sint32, + ffi_type_pointer, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + int __result = invoke( + memGetAddress(memGetAddress(args)), + memGetAddress(memGetAddress(args + POINTER_SIZE)) + ); + apiClosureRet(ret, __result); + } + + /** A function pointer type used to describe the signature of a 'move to' function during outline walking/decomposition. */ + int invoke(@NativeType("FT_Vector const *") long to, @NativeType("void *") long user); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintColrGlyph.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintColrGlyph.java new file mode 100644 index 00000000..8ae8f5bf --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintColrGlyph.java @@ -0,0 +1,153 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure representing a {@code COLR} v1 {@code PaintColorGlyph} paint table. + * + *

Layout

+ * + *

+ * struct FT_PaintColrGlyph {
+ *     FT_UInt glyphID;
+ * }
+ */ +public class FT_PaintColrGlyph extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + GLYPHID; + + static { + Layout layout = __struct( + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + GLYPHID = layout.offsetof(0); + } + + protected FT_PaintColrGlyph(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_PaintColrGlyph create(long address, @Nullable ByteBuffer container) { + return new FT_PaintColrGlyph(address, container); + } + + /** + * Creates a {@code FT_PaintColrGlyph} instance at the current position of the specified {@link 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 FT_PaintColrGlyph(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code glyphID} field. */ + @NativeType("FT_UInt") + public int glyphID() { return nglyphID(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_PaintColrGlyph} instance for the specified memory address. */ + public static FT_PaintColrGlyph create(long address) { + return new FT_PaintColrGlyph(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_PaintColrGlyph createSafe(long address) { + return address == NULL ? null : new FT_PaintColrGlyph(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #glyphID}. */ + public static int nglyphID(long struct) { return UNSAFE.getInt(null, struct + FT_PaintColrGlyph.GLYPHID); } + + // ----------------------------------- + + /** An array of {@link FT_PaintColrGlyph} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_PaintColrGlyph ELEMENT_FACTORY = FT_PaintColrGlyph.create(-1L); + + /** + * Creates a new {@code FT_PaintColrGlyph.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 {@link FT_PaintColrGlyph#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_PaintColrGlyph getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code glyphID} field. */ + @NativeType("FT_UInt") + public int glyphID() { return FT_PaintColrGlyph.nglyphID(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintColrLayers.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintColrLayers.java new file mode 100644 index 00000000..ed941bb5 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintColrLayers.java @@ -0,0 +1,151 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure representing a {@code PaintColrLayers} table of a {@code COLR} v1 font. + * + *

Layout

+ * + *

+ * struct FT_PaintColrLayers {
+ *     {@link FT_LayerIterator FT_LayerIterator} layer_iterator;
+ * }
+ */ +public class FT_PaintColrLayers extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + LAYER_ITERATOR; + + static { + Layout layout = __struct( + __member(FT_LayerIterator.SIZEOF, FT_LayerIterator.ALIGNOF) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + LAYER_ITERATOR = layout.offsetof(0); + } + + protected FT_PaintColrLayers(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_PaintColrLayers create(long address, @Nullable ByteBuffer container) { + return new FT_PaintColrLayers(address, container); + } + + /** + * Creates a {@code FT_PaintColrLayers} instance at the current position of the specified {@link 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 FT_PaintColrLayers(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_LayerIterator} view of the {@code layer_iterator} field. */ + public FT_LayerIterator layer_iterator() { return nlayer_iterator(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_PaintColrLayers} instance for the specified memory address. */ + public static FT_PaintColrLayers create(long address) { + return new FT_PaintColrLayers(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_PaintColrLayers createSafe(long address) { + return address == NULL ? null : new FT_PaintColrLayers(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #layer_iterator}. */ + public static FT_LayerIterator nlayer_iterator(long struct) { return FT_LayerIterator.create(struct + FT_PaintColrLayers.LAYER_ITERATOR); } + + // ----------------------------------- + + /** An array of {@link FT_PaintColrLayers} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_PaintColrLayers ELEMENT_FACTORY = FT_PaintColrLayers.create(-1L); + + /** + * Creates a new {@code FT_PaintColrLayers.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 {@link FT_PaintColrLayers#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_PaintColrLayers getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_LayerIterator} view of the {@code layer_iterator} field. */ + public FT_LayerIterator layer_iterator() { return FT_PaintColrLayers.nlayer_iterator(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintComposite.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintComposite.java new file mode 100644 index 00000000..f3ec4ba1 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintComposite.java @@ -0,0 +1,178 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure representing a {@code COLR} v1 {@code PaintComposite} paint table. Used for compositing two paints in a {@code COLR} v1 directed acyclic + * graph. + * + *

Layout

+ * + *

+ * struct FT_PaintComposite {
+ *     {@link FT_OpaquePaint FT_OpaquePaintRec} source_paint;
+ *     FT_Composite_Mode composite_mode;
+ *     {@link FT_OpaquePaint FT_OpaquePaintRec} backdrop_paint;
+ * }
+ */ +public class FT_PaintComposite extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + SOURCE_PAINT, + COMPOSITE_MODE, + BACKDROP_PAINT; + + static { + Layout layout = __struct( + __member(FT_OpaquePaint.SIZEOF, FT_OpaquePaint.ALIGNOF), + __member(4), + __member(FT_OpaquePaint.SIZEOF, FT_OpaquePaint.ALIGNOF) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + SOURCE_PAINT = layout.offsetof(0); + COMPOSITE_MODE = layout.offsetof(1); + BACKDROP_PAINT = layout.offsetof(2); + } + + protected FT_PaintComposite(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_PaintComposite create(long address, @Nullable ByteBuffer container) { + return new FT_PaintComposite(address, container); + } + + /** + * Creates a {@code FT_PaintComposite} instance at the current position of the specified {@link 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 FT_PaintComposite(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_OpaquePaint} view of the {@code source_paint} field. */ + @NativeType("FT_OpaquePaintRec") + public FT_OpaquePaint source_paint() { return nsource_paint(address()); } + /** @return the value of the {@code composite_mode} field. */ + @NativeType("FT_Composite_Mode") + public int composite_mode() { return ncomposite_mode(address()); } + /** @return a {@link FT_OpaquePaint} view of the {@code backdrop_paint} field. */ + @NativeType("FT_OpaquePaintRec") + public FT_OpaquePaint backdrop_paint() { return nbackdrop_paint(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_PaintComposite} instance for the specified memory address. */ + public static FT_PaintComposite create(long address) { + return new FT_PaintComposite(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_PaintComposite createSafe(long address) { + return address == NULL ? null : new FT_PaintComposite(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #source_paint}. */ + public static FT_OpaquePaint nsource_paint(long struct) { return FT_OpaquePaint.create(struct + FT_PaintComposite.SOURCE_PAINT); } + /** Unsafe version of {@link #composite_mode}. */ + public static int ncomposite_mode(long struct) { return UNSAFE.getInt(null, struct + FT_PaintComposite.COMPOSITE_MODE); } + /** Unsafe version of {@link #backdrop_paint}. */ + public static FT_OpaquePaint nbackdrop_paint(long struct) { return FT_OpaquePaint.create(struct + FT_PaintComposite.BACKDROP_PAINT); } + + // ----------------------------------- + + /** An array of {@link FT_PaintComposite} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_PaintComposite ELEMENT_FACTORY = FT_PaintComposite.create(-1L); + + /** + * Creates a new {@code FT_PaintComposite.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 {@link FT_PaintComposite#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_PaintComposite getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_OpaquePaint} view of the {@code source_paint} field. */ + @NativeType("FT_OpaquePaintRec") + public FT_OpaquePaint source_paint() { return FT_PaintComposite.nsource_paint(address()); } + /** @return the value of the {@code composite_mode} field. */ + @NativeType("FT_Composite_Mode") + public int composite_mode() { return FT_PaintComposite.ncomposite_mode(address()); } + /** @return a {@link FT_OpaquePaint} view of the {@code backdrop_paint} field. */ + @NativeType("FT_OpaquePaintRec") + public FT_OpaquePaint backdrop_paint() { return FT_PaintComposite.nbackdrop_paint(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintGlyph.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintGlyph.java new file mode 100644 index 00000000..397c0009 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintGlyph.java @@ -0,0 +1,165 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure representing a {@code COLR} v1 {@code PaintGlyph} paint table. + * + *

Layout

+ * + *

+ * struct FT_PaintGlyph {
+ *     {@link FT_OpaquePaint FT_OpaquePaintRec} paint;
+ *     FT_UInt glyphID;
+ * }
+ */ +public class FT_PaintGlyph extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + PAINT, + GLYPHID; + + static { + Layout layout = __struct( + __member(FT_OpaquePaint.SIZEOF, FT_OpaquePaint.ALIGNOF), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + PAINT = layout.offsetof(0); + GLYPHID = layout.offsetof(1); + } + + protected FT_PaintGlyph(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_PaintGlyph create(long address, @Nullable ByteBuffer container) { + return new FT_PaintGlyph(address, container); + } + + /** + * Creates a {@code FT_PaintGlyph} instance at the current position of the specified {@link 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 FT_PaintGlyph(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */ + @NativeType("FT_OpaquePaintRec") + public FT_OpaquePaint paint() { return npaint(address()); } + /** @return the value of the {@code glyphID} field. */ + @NativeType("FT_UInt") + public int glyphID() { return nglyphID(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_PaintGlyph} instance for the specified memory address. */ + public static FT_PaintGlyph create(long address) { + return new FT_PaintGlyph(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_PaintGlyph createSafe(long address) { + return address == NULL ? null : new FT_PaintGlyph(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #paint}. */ + public static FT_OpaquePaint npaint(long struct) { return FT_OpaquePaint.create(struct + FT_PaintGlyph.PAINT); } + /** Unsafe version of {@link #glyphID}. */ + public static int nglyphID(long struct) { return UNSAFE.getInt(null, struct + FT_PaintGlyph.GLYPHID); } + + // ----------------------------------- + + /** An array of {@link FT_PaintGlyph} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_PaintGlyph ELEMENT_FACTORY = FT_PaintGlyph.create(-1L); + + /** + * Creates a new {@code FT_PaintGlyph.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 {@link FT_PaintGlyph#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_PaintGlyph getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */ + @NativeType("FT_OpaquePaintRec") + public FT_OpaquePaint paint() { return FT_PaintGlyph.npaint(address()); } + /** @return the value of the {@code glyphID} field. */ + @NativeType("FT_UInt") + public int glyphID() { return FT_PaintGlyph.nglyphID(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintLinearGradient.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintLinearGradient.java new file mode 100644 index 00000000..55a94298 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintLinearGradient.java @@ -0,0 +1,181 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure representing a {@code PaintLinearGradient} value of the {@code COLR} v1 extensions. + * + *

Layout

+ * + *

+ * struct FT_PaintLinearGradient {
+ *     {@link FT_ColorLine FT_ColorLine} colorline;
+ *     {@link FT_Vector FT_Vector} p0;
+ *     {@link FT_Vector FT_Vector} p1;
+ *     {@link FT_Vector FT_Vector} p2;
+ * }
+ */ +public class FT_PaintLinearGradient extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + COLORLINE, + P0, + P1, + P2; + + static { + Layout layout = __struct( + __member(FT_ColorLine.SIZEOF, FT_ColorLine.ALIGNOF), + __member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF), + __member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF), + __member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + COLORLINE = layout.offsetof(0); + P0 = layout.offsetof(1); + P1 = layout.offsetof(2); + P2 = layout.offsetof(3); + } + + protected FT_PaintLinearGradient(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_PaintLinearGradient create(long address, @Nullable ByteBuffer container) { + return new FT_PaintLinearGradient(address, container); + } + + /** + * Creates a {@code FT_PaintLinearGradient} instance at the current position of the specified {@link 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 FT_PaintLinearGradient(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_ColorLine} view of the {@code colorline} field. */ + public FT_ColorLine colorline() { return ncolorline(address()); } + /** @return a {@link FT_Vector} view of the {@code p0} field. */ + public FT_Vector p0() { return np0(address()); } + /** @return a {@link FT_Vector} view of the {@code p1} field. */ + public FT_Vector p1() { return np1(address()); } + /** @return a {@link FT_Vector} view of the {@code p2} field. */ + public FT_Vector p2() { return np2(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_PaintLinearGradient} instance for the specified memory address. */ + public static FT_PaintLinearGradient create(long address) { + return new FT_PaintLinearGradient(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_PaintLinearGradient createSafe(long address) { + return address == NULL ? null : new FT_PaintLinearGradient(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #colorline}. */ + public static FT_ColorLine ncolorline(long struct) { return FT_ColorLine.create(struct + FT_PaintLinearGradient.COLORLINE); } + /** Unsafe version of {@link #p0}. */ + public static FT_Vector np0(long struct) { return FT_Vector.create(struct + FT_PaintLinearGradient.P0); } + /** Unsafe version of {@link #p1}. */ + public static FT_Vector np1(long struct) { return FT_Vector.create(struct + FT_PaintLinearGradient.P1); } + /** Unsafe version of {@link #p2}. */ + public static FT_Vector np2(long struct) { return FT_Vector.create(struct + FT_PaintLinearGradient.P2); } + + // ----------------------------------- + + /** An array of {@link FT_PaintLinearGradient} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_PaintLinearGradient ELEMENT_FACTORY = FT_PaintLinearGradient.create(-1L); + + /** + * Creates a new {@code FT_PaintLinearGradient.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 {@link FT_PaintLinearGradient#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_PaintLinearGradient getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_ColorLine} view of the {@code colorline} field. */ + public FT_ColorLine colorline() { return FT_PaintLinearGradient.ncolorline(address()); } + /** @return a {@link FT_Vector} view of the {@code p0} field. */ + public FT_Vector p0() { return FT_PaintLinearGradient.np0(address()); } + /** @return a {@link FT_Vector} view of the {@code p1} field. */ + public FT_Vector p1() { return FT_PaintLinearGradient.np1(address()); } + /** @return a {@link FT_Vector} view of the {@code p2} field. */ + public FT_Vector p2() { return FT_PaintLinearGradient.np2(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintRadialGradient.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintRadialGradient.java new file mode 100644 index 00000000..e251bfd1 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintRadialGradient.java @@ -0,0 +1,195 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure representing a {@code PaintRadialGradient} value of the {@code COLR} v1 extensions. + * + *

Layout

+ * + *

+ * struct FT_PaintRadialGradient {
+ *     {@link FT_ColorLine FT_ColorLine} colorline;
+ *     {@link FT_Vector FT_Vector} c0;
+ *     FT_Pos r0;
+ *     {@link FT_Vector FT_Vector} c1;
+ *     FT_Pos r1;
+ * }
+ */ +public class FT_PaintRadialGradient extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + COLORLINE, + C0, + R0, + C1, + R1; + + static { + Layout layout = __struct( + __member(FT_ColorLine.SIZEOF, FT_ColorLine.ALIGNOF), + __member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF), + __member(CLONG_SIZE), + __member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + COLORLINE = layout.offsetof(0); + C0 = layout.offsetof(1); + R0 = layout.offsetof(2); + C1 = layout.offsetof(3); + R1 = layout.offsetof(4); + } + + protected FT_PaintRadialGradient(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_PaintRadialGradient create(long address, @Nullable ByteBuffer container) { + return new FT_PaintRadialGradient(address, container); + } + + /** + * Creates a {@code FT_PaintRadialGradient} instance at the current position of the specified {@link 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 FT_PaintRadialGradient(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_ColorLine} view of the {@code colorline} field. */ + public FT_ColorLine colorline() { return ncolorline(address()); } + /** @return a {@link FT_Vector} view of the {@code c0} field. */ + public FT_Vector c0() { return nc0(address()); } + /** @return the value of the {@code r0} field. */ + @NativeType("FT_Pos") + public long r0() { return nr0(address()); } + /** @return a {@link FT_Vector} view of the {@code c1} field. */ + public FT_Vector c1() { return nc1(address()); } + /** @return the value of the {@code r1} field. */ + @NativeType("FT_Pos") + public long r1() { return nr1(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_PaintRadialGradient} instance for the specified memory address. */ + public static FT_PaintRadialGradient create(long address) { + return new FT_PaintRadialGradient(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_PaintRadialGradient createSafe(long address) { + return address == NULL ? null : new FT_PaintRadialGradient(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #colorline}. */ + public static FT_ColorLine ncolorline(long struct) { return FT_ColorLine.create(struct + FT_PaintRadialGradient.COLORLINE); } + /** Unsafe version of {@link #c0}. */ + public static FT_Vector nc0(long struct) { return FT_Vector.create(struct + FT_PaintRadialGradient.C0); } + /** Unsafe version of {@link #r0}. */ + public static long nr0(long struct) { return memGetCLong(struct + FT_PaintRadialGradient.R0); } + /** Unsafe version of {@link #c1}. */ + public static FT_Vector nc1(long struct) { return FT_Vector.create(struct + FT_PaintRadialGradient.C1); } + /** Unsafe version of {@link #r1}. */ + public static long nr1(long struct) { return memGetCLong(struct + FT_PaintRadialGradient.R1); } + + // ----------------------------------- + + /** An array of {@link FT_PaintRadialGradient} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_PaintRadialGradient ELEMENT_FACTORY = FT_PaintRadialGradient.create(-1L); + + /** + * Creates a new {@code FT_PaintRadialGradient.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 {@link FT_PaintRadialGradient#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_PaintRadialGradient getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_ColorLine} view of the {@code colorline} field. */ + public FT_ColorLine colorline() { return FT_PaintRadialGradient.ncolorline(address()); } + /** @return a {@link FT_Vector} view of the {@code c0} field. */ + public FT_Vector c0() { return FT_PaintRadialGradient.nc0(address()); } + /** @return the value of the {@code r0} field. */ + @NativeType("FT_Pos") + public long r0() { return FT_PaintRadialGradient.nr0(address()); } + /** @return a {@link FT_Vector} view of the {@code c1} field. */ + public FT_Vector c1() { return FT_PaintRadialGradient.nc1(address()); } + /** @return the value of the {@code r1} field. */ + @NativeType("FT_Pos") + public long r1() { return FT_PaintRadialGradient.nr1(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintRotate.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintRotate.java new file mode 100644 index 00000000..3458d154 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintRotate.java @@ -0,0 +1,189 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure representing a {@code COLR} v1 {@code PaintRotate} paint table. Used for rotating downstream paints with a given center and angle. + * + *

Layout

+ * + *

+ * struct FT_PaintRotate {
+ *     {@link FT_OpaquePaint FT_OpaquePaintRec} paint;
+ *     FT_Fixed angle;
+ *     FT_Fixed center_x;
+ *     FT_Fixed center_y;
+ * }
+ */ +public class FT_PaintRotate extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + PAINT, + ANGLE, + CENTER_X, + CENTER_Y; + + static { + Layout layout = __struct( + __member(FT_OpaquePaint.SIZEOF, FT_OpaquePaint.ALIGNOF), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + PAINT = layout.offsetof(0); + ANGLE = layout.offsetof(1); + CENTER_X = layout.offsetof(2); + CENTER_Y = layout.offsetof(3); + } + + protected FT_PaintRotate(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_PaintRotate create(long address, @Nullable ByteBuffer container) { + return new FT_PaintRotate(address, container); + } + + /** + * Creates a {@code FT_PaintRotate} instance at the current position of the specified {@link 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 FT_PaintRotate(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */ + @NativeType("FT_OpaquePaintRec") + public FT_OpaquePaint paint() { return npaint(address()); } + /** @return the value of the {@code angle} field. */ + @NativeType("FT_Fixed") + public long angle() { return nangle(address()); } + /** @return the value of the {@code center_x} field. */ + @NativeType("FT_Fixed") + public long center_x() { return ncenter_x(address()); } + /** @return the value of the {@code center_y} field. */ + @NativeType("FT_Fixed") + public long center_y() { return ncenter_y(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_PaintRotate} instance for the specified memory address. */ + public static FT_PaintRotate create(long address) { + return new FT_PaintRotate(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_PaintRotate createSafe(long address) { + return address == NULL ? null : new FT_PaintRotate(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #paint}. */ + public static FT_OpaquePaint npaint(long struct) { return FT_OpaquePaint.create(struct + FT_PaintRotate.PAINT); } + /** Unsafe version of {@link #angle}. */ + public static long nangle(long struct) { return memGetCLong(struct + FT_PaintRotate.ANGLE); } + /** Unsafe version of {@link #center_x}. */ + public static long ncenter_x(long struct) { return memGetCLong(struct + FT_PaintRotate.CENTER_X); } + /** Unsafe version of {@link #center_y}. */ + public static long ncenter_y(long struct) { return memGetCLong(struct + FT_PaintRotate.CENTER_Y); } + + // ----------------------------------- + + /** An array of {@link FT_PaintRotate} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_PaintRotate ELEMENT_FACTORY = FT_PaintRotate.create(-1L); + + /** + * Creates a new {@code FT_PaintRotate.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 {@link FT_PaintRotate#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_PaintRotate getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */ + @NativeType("FT_OpaquePaintRec") + public FT_OpaquePaint paint() { return FT_PaintRotate.npaint(address()); } + /** @return the value of the {@code angle} field. */ + @NativeType("FT_Fixed") + public long angle() { return FT_PaintRotate.nangle(address()); } + /** @return the value of the {@code center_x} field. */ + @NativeType("FT_Fixed") + public long center_x() { return FT_PaintRotate.ncenter_x(address()); } + /** @return the value of the {@code center_y} field. */ + @NativeType("FT_Fixed") + public long center_y() { return FT_PaintRotate.ncenter_y(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintScale.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintScale.java new file mode 100644 index 00000000..c8b59995 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintScale.java @@ -0,0 +1,201 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure representing all of the {@code COLR} v1 {@code PaintScale*} paint tables. + * + *

Layout

+ * + *

+ * struct FT_PaintScale {
+ *     {@link FT_OpaquePaint FT_OpaquePaintRec} paint;
+ *     FT_Fixed scale_x;
+ *     FT_Fixed scale_y;
+ *     FT_Fixed center_x;
+ *     FT_Fixed center_y;
+ * }
+ */ +public class FT_PaintScale extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + PAINT, + SCALE_X, + SCALE_Y, + CENTER_X, + CENTER_Y; + + static { + Layout layout = __struct( + __member(FT_OpaquePaint.SIZEOF, FT_OpaquePaint.ALIGNOF), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + PAINT = layout.offsetof(0); + SCALE_X = layout.offsetof(1); + SCALE_Y = layout.offsetof(2); + CENTER_X = layout.offsetof(3); + CENTER_Y = layout.offsetof(4); + } + + protected FT_PaintScale(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_PaintScale create(long address, @Nullable ByteBuffer container) { + return new FT_PaintScale(address, container); + } + + /** + * Creates a {@code FT_PaintScale} instance at the current position of the specified {@link 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 FT_PaintScale(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */ + @NativeType("FT_OpaquePaintRec") + public FT_OpaquePaint paint() { return npaint(address()); } + /** @return the value of the {@code scale_x} field. */ + @NativeType("FT_Fixed") + public long scale_x() { return nscale_x(address()); } + /** @return the value of the {@code scale_y} field. */ + @NativeType("FT_Fixed") + public long scale_y() { return nscale_y(address()); } + /** @return the value of the {@code center_x} field. */ + @NativeType("FT_Fixed") + public long center_x() { return ncenter_x(address()); } + /** @return the value of the {@code center_y} field. */ + @NativeType("FT_Fixed") + public long center_y() { return ncenter_y(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_PaintScale} instance for the specified memory address. */ + public static FT_PaintScale create(long address) { + return new FT_PaintScale(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_PaintScale createSafe(long address) { + return address == NULL ? null : new FT_PaintScale(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #paint}. */ + public static FT_OpaquePaint npaint(long struct) { return FT_OpaquePaint.create(struct + FT_PaintScale.PAINT); } + /** Unsafe version of {@link #scale_x}. */ + public static long nscale_x(long struct) { return memGetCLong(struct + FT_PaintScale.SCALE_X); } + /** Unsafe version of {@link #scale_y}. */ + public static long nscale_y(long struct) { return memGetCLong(struct + FT_PaintScale.SCALE_Y); } + /** Unsafe version of {@link #center_x}. */ + public static long ncenter_x(long struct) { return memGetCLong(struct + FT_PaintScale.CENTER_X); } + /** Unsafe version of {@link #center_y}. */ + public static long ncenter_y(long struct) { return memGetCLong(struct + FT_PaintScale.CENTER_Y); } + + // ----------------------------------- + + /** An array of {@link FT_PaintScale} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_PaintScale ELEMENT_FACTORY = FT_PaintScale.create(-1L); + + /** + * Creates a new {@code FT_PaintScale.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 {@link FT_PaintScale#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_PaintScale getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */ + @NativeType("FT_OpaquePaintRec") + public FT_OpaquePaint paint() { return FT_PaintScale.npaint(address()); } + /** @return the value of the {@code scale_x} field. */ + @NativeType("FT_Fixed") + public long scale_x() { return FT_PaintScale.nscale_x(address()); } + /** @return the value of the {@code scale_y} field. */ + @NativeType("FT_Fixed") + public long scale_y() { return FT_PaintScale.nscale_y(address()); } + /** @return the value of the {@code center_x} field. */ + @NativeType("FT_Fixed") + public long center_x() { return FT_PaintScale.ncenter_x(address()); } + /** @return the value of the {@code center_y} field. */ + @NativeType("FT_Fixed") + public long center_y() { return FT_PaintScale.ncenter_y(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintSkew.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintSkew.java new file mode 100644 index 00000000..cd8f4424 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintSkew.java @@ -0,0 +1,201 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure representing a {@code COLR} v1 {@code PaintSkew} paint table. Used for skewing or shearing downstream paints by a given center and angle. + * + *

Layout

+ * + *

+ * struct FT_PaintSkew {
+ *     {@link FT_OpaquePaint FT_OpaquePaintRec} paint;
+ *     FT_Fixed x_skew_angle;
+ *     FT_Fixed y_skew_angle;
+ *     FT_Fixed center_x;
+ *     FT_Fixed center_y;
+ * }
+ */ +public class FT_PaintSkew extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + PAINT, + X_SKEW_ANGLE, + Y_SKEW_ANGLE, + CENTER_X, + CENTER_Y; + + static { + Layout layout = __struct( + __member(FT_OpaquePaint.SIZEOF, FT_OpaquePaint.ALIGNOF), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + PAINT = layout.offsetof(0); + X_SKEW_ANGLE = layout.offsetof(1); + Y_SKEW_ANGLE = layout.offsetof(2); + CENTER_X = layout.offsetof(3); + CENTER_Y = layout.offsetof(4); + } + + protected FT_PaintSkew(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_PaintSkew create(long address, @Nullable ByteBuffer container) { + return new FT_PaintSkew(address, container); + } + + /** + * Creates a {@code FT_PaintSkew} instance at the current position of the specified {@link 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 FT_PaintSkew(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */ + @NativeType("FT_OpaquePaintRec") + public FT_OpaquePaint paint() { return npaint(address()); } + /** @return the value of the {@code x_skew_angle} field. */ + @NativeType("FT_Fixed") + public long x_skew_angle() { return nx_skew_angle(address()); } + /** @return the value of the {@code y_skew_angle} field. */ + @NativeType("FT_Fixed") + public long y_skew_angle() { return ny_skew_angle(address()); } + /** @return the value of the {@code center_x} field. */ + @NativeType("FT_Fixed") + public long center_x() { return ncenter_x(address()); } + /** @return the value of the {@code center_y} field. */ + @NativeType("FT_Fixed") + public long center_y() { return ncenter_y(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_PaintSkew} instance for the specified memory address. */ + public static FT_PaintSkew create(long address) { + return new FT_PaintSkew(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_PaintSkew createSafe(long address) { + return address == NULL ? null : new FT_PaintSkew(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #paint}. */ + public static FT_OpaquePaint npaint(long struct) { return FT_OpaquePaint.create(struct + FT_PaintSkew.PAINT); } + /** Unsafe version of {@link #x_skew_angle}. */ + public static long nx_skew_angle(long struct) { return memGetCLong(struct + FT_PaintSkew.X_SKEW_ANGLE); } + /** Unsafe version of {@link #y_skew_angle}. */ + public static long ny_skew_angle(long struct) { return memGetCLong(struct + FT_PaintSkew.Y_SKEW_ANGLE); } + /** Unsafe version of {@link #center_x}. */ + public static long ncenter_x(long struct) { return memGetCLong(struct + FT_PaintSkew.CENTER_X); } + /** Unsafe version of {@link #center_y}. */ + public static long ncenter_y(long struct) { return memGetCLong(struct + FT_PaintSkew.CENTER_Y); } + + // ----------------------------------- + + /** An array of {@link FT_PaintSkew} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_PaintSkew ELEMENT_FACTORY = FT_PaintSkew.create(-1L); + + /** + * Creates a new {@code FT_PaintSkew.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 {@link FT_PaintSkew#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_PaintSkew getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */ + @NativeType("FT_OpaquePaintRec") + public FT_OpaquePaint paint() { return FT_PaintSkew.npaint(address()); } + /** @return the value of the {@code x_skew_angle} field. */ + @NativeType("FT_Fixed") + public long x_skew_angle() { return FT_PaintSkew.nx_skew_angle(address()); } + /** @return the value of the {@code y_skew_angle} field. */ + @NativeType("FT_Fixed") + public long y_skew_angle() { return FT_PaintSkew.ny_skew_angle(address()); } + /** @return the value of the {@code center_x} field. */ + @NativeType("FT_Fixed") + public long center_x() { return FT_PaintSkew.ncenter_x(address()); } + /** @return the value of the {@code center_y} field. */ + @NativeType("FT_Fixed") + public long center_y() { return FT_PaintSkew.ncenter_y(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintSolid.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintSolid.java new file mode 100644 index 00000000..16fc4126 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintSolid.java @@ -0,0 +1,151 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure representing a {@code PaintSolid} value of the {@code COLR} v1 extensions. + * + *

Layout

+ * + *

+ * struct FT_PaintSolid {
+ *     {@link FT_ColorIndex FT_ColorIndex} color;
+ * }
+ */ +public class FT_PaintSolid extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + COLOR; + + static { + Layout layout = __struct( + __member(FT_ColorIndex.SIZEOF, FT_ColorIndex.ALIGNOF) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + COLOR = layout.offsetof(0); + } + + protected FT_PaintSolid(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_PaintSolid create(long address, @Nullable ByteBuffer container) { + return new FT_PaintSolid(address, container); + } + + /** + * Creates a {@code FT_PaintSolid} instance at the current position of the specified {@link 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 FT_PaintSolid(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_ColorIndex} view of the {@code color} field. */ + public FT_ColorIndex color() { return ncolor(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_PaintSolid} instance for the specified memory address. */ + public static FT_PaintSolid create(long address) { + return new FT_PaintSolid(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_PaintSolid createSafe(long address) { + return address == NULL ? null : new FT_PaintSolid(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #color}. */ + public static FT_ColorIndex ncolor(long struct) { return FT_ColorIndex.create(struct + FT_PaintSolid.COLOR); } + + // ----------------------------------- + + /** An array of {@link FT_PaintSolid} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_PaintSolid ELEMENT_FACTORY = FT_PaintSolid.create(-1L); + + /** + * Creates a new {@code FT_PaintSolid.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 {@link FT_PaintSolid#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_PaintSolid getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_ColorIndex} view of the {@code color} field. */ + public FT_ColorIndex color() { return FT_PaintSolid.ncolor(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintSweepGradient.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintSweepGradient.java new file mode 100644 index 00000000..b95f6b1c --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintSweepGradient.java @@ -0,0 +1,185 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure representing a {@code PaintSweepGradient} value of the {@code COLR} v1 extensions. + * + *

Layout

+ * + *

+ * struct FT_PaintSweepGradient {
+ *     {@link FT_ColorLine FT_ColorLine} colorline;
+ *     {@link FT_Vector FT_Vector} center;
+ *     FT_Fixed start_angle;
+ *     FT_Fixed end_angle;
+ * }
+ */ +public class FT_PaintSweepGradient extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + COLORLINE, + CENTER, + START_ANGLE, + END_ANGLE; + + static { + Layout layout = __struct( + __member(FT_ColorLine.SIZEOF, FT_ColorLine.ALIGNOF), + __member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + COLORLINE = layout.offsetof(0); + CENTER = layout.offsetof(1); + START_ANGLE = layout.offsetof(2); + END_ANGLE = layout.offsetof(3); + } + + protected FT_PaintSweepGradient(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_PaintSweepGradient create(long address, @Nullable ByteBuffer container) { + return new FT_PaintSweepGradient(address, container); + } + + /** + * Creates a {@code FT_PaintSweepGradient} instance at the current position of the specified {@link 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 FT_PaintSweepGradient(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_ColorLine} view of the {@code colorline} field. */ + public FT_ColorLine colorline() { return ncolorline(address()); } + /** @return a {@link FT_Vector} view of the {@code center} field. */ + public FT_Vector center() { return ncenter(address()); } + /** @return the value of the {@code start_angle} field. */ + @NativeType("FT_Fixed") + public long start_angle() { return nstart_angle(address()); } + /** @return the value of the {@code end_angle} field. */ + @NativeType("FT_Fixed") + public long end_angle() { return nend_angle(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_PaintSweepGradient} instance for the specified memory address. */ + public static FT_PaintSweepGradient create(long address) { + return new FT_PaintSweepGradient(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_PaintSweepGradient createSafe(long address) { + return address == NULL ? null : new FT_PaintSweepGradient(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #colorline}. */ + public static FT_ColorLine ncolorline(long struct) { return FT_ColorLine.create(struct + FT_PaintSweepGradient.COLORLINE); } + /** Unsafe version of {@link #center}. */ + public static FT_Vector ncenter(long struct) { return FT_Vector.create(struct + FT_PaintSweepGradient.CENTER); } + /** Unsafe version of {@link #start_angle}. */ + public static long nstart_angle(long struct) { return memGetCLong(struct + FT_PaintSweepGradient.START_ANGLE); } + /** Unsafe version of {@link #end_angle}. */ + public static long nend_angle(long struct) { return memGetCLong(struct + FT_PaintSweepGradient.END_ANGLE); } + + // ----------------------------------- + + /** An array of {@link FT_PaintSweepGradient} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_PaintSweepGradient ELEMENT_FACTORY = FT_PaintSweepGradient.create(-1L); + + /** + * Creates a new {@code FT_PaintSweepGradient.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 {@link FT_PaintSweepGradient#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_PaintSweepGradient getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_ColorLine} view of the {@code colorline} field. */ + public FT_ColorLine colorline() { return FT_PaintSweepGradient.ncolorline(address()); } + /** @return a {@link FT_Vector} view of the {@code center} field. */ + public FT_Vector center() { return FT_PaintSweepGradient.ncenter(address()); } + /** @return the value of the {@code start_angle} field. */ + @NativeType("FT_Fixed") + public long start_angle() { return FT_PaintSweepGradient.nstart_angle(address()); } + /** @return the value of the {@code end_angle} field. */ + @NativeType("FT_Fixed") + public long end_angle() { return FT_PaintSweepGradient.nend_angle(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintTransform.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintTransform.java new file mode 100644 index 00000000..bfffeacf --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintTransform.java @@ -0,0 +1,163 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure representing a {@code COLR} v1 {@code PaintTransform} paint table. + * + *

Layout

+ * + *

+ * struct FT_PaintTransform {
+ *     {@link FT_OpaquePaint FT_OpaquePaintRec} paint;
+ *     {@link FT_Affine23 FT_Affine23} affine;
+ * }
+ */ +public class FT_PaintTransform extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + PAINT, + AFFINE; + + static { + Layout layout = __struct( + __member(FT_OpaquePaint.SIZEOF, FT_OpaquePaint.ALIGNOF), + __member(FT_Affine23.SIZEOF, FT_Affine23.ALIGNOF) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + PAINT = layout.offsetof(0); + AFFINE = layout.offsetof(1); + } + + protected FT_PaintTransform(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_PaintTransform create(long address, @Nullable ByteBuffer container) { + return new FT_PaintTransform(address, container); + } + + /** + * Creates a {@code FT_PaintTransform} instance at the current position of the specified {@link 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 FT_PaintTransform(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */ + @NativeType("FT_OpaquePaintRec") + public FT_OpaquePaint paint() { return npaint(address()); } + /** @return a {@link FT_Affine23} view of the {@code affine} field. */ + public FT_Affine23 affine() { return naffine(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_PaintTransform} instance for the specified memory address. */ + public static FT_PaintTransform create(long address) { + return new FT_PaintTransform(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_PaintTransform createSafe(long address) { + return address == NULL ? null : new FT_PaintTransform(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #paint}. */ + public static FT_OpaquePaint npaint(long struct) { return FT_OpaquePaint.create(struct + FT_PaintTransform.PAINT); } + /** Unsafe version of {@link #affine}. */ + public static FT_Affine23 naffine(long struct) { return FT_Affine23.create(struct + FT_PaintTransform.AFFINE); } + + // ----------------------------------- + + /** An array of {@link FT_PaintTransform} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_PaintTransform ELEMENT_FACTORY = FT_PaintTransform.create(-1L); + + /** + * Creates a new {@code FT_PaintTransform.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 {@link FT_PaintTransform#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_PaintTransform getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */ + @NativeType("FT_OpaquePaintRec") + public FT_OpaquePaint paint() { return FT_PaintTransform.npaint(address()); } + /** @return a {@link FT_Affine23} view of the {@code affine} field. */ + public FT_Affine23 affine() { return FT_PaintTransform.naffine(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintTranslate.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintTranslate.java new file mode 100644 index 00000000..f68064c3 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintTranslate.java @@ -0,0 +1,177 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure representing a {@code COLR} v1 {@code PaintTranslate} paint table. Used for translating downstream paints by a given x and y~delta. + * + *

Layout

+ * + *

+ * struct FT_PaintTranslate {
+ *     {@link FT_OpaquePaint FT_OpaquePaintRec} paint;
+ *     FT_Fixed dx;
+ *     FT_Fixed dy;
+ * }
+ */ +public class FT_PaintTranslate extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + PAINT, + DX, + DY; + + static { + Layout layout = __struct( + __member(FT_OpaquePaint.SIZEOF, FT_OpaquePaint.ALIGNOF), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + PAINT = layout.offsetof(0); + DX = layout.offsetof(1); + DY = layout.offsetof(2); + } + + protected FT_PaintTranslate(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_PaintTranslate create(long address, @Nullable ByteBuffer container) { + return new FT_PaintTranslate(address, container); + } + + /** + * Creates a {@code FT_PaintTranslate} instance at the current position of the specified {@link 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 FT_PaintTranslate(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */ + @NativeType("FT_OpaquePaintRec") + public FT_OpaquePaint paint() { return npaint(address()); } + /** @return the value of the {@code dx} field. */ + @NativeType("FT_Fixed") + public long dx() { return ndx(address()); } + /** @return the value of the {@code dy} field. */ + @NativeType("FT_Fixed") + public long dy() { return ndy(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_PaintTranslate} instance for the specified memory address. */ + public static FT_PaintTranslate create(long address) { + return new FT_PaintTranslate(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_PaintTranslate createSafe(long address) { + return address == NULL ? null : new FT_PaintTranslate(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #paint}. */ + public static FT_OpaquePaint npaint(long struct) { return FT_OpaquePaint.create(struct + FT_PaintTranslate.PAINT); } + /** Unsafe version of {@link #dx}. */ + public static long ndx(long struct) { return memGetCLong(struct + FT_PaintTranslate.DX); } + /** Unsafe version of {@link #dy}. */ + public static long ndy(long struct) { return memGetCLong(struct + FT_PaintTranslate.DY); } + + // ----------------------------------- + + /** An array of {@link FT_PaintTranslate} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_PaintTranslate ELEMENT_FACTORY = FT_PaintTranslate.create(-1L); + + /** + * Creates a new {@code FT_PaintTranslate.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 {@link FT_PaintTranslate#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_PaintTranslate getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */ + @NativeType("FT_OpaquePaintRec") + public FT_OpaquePaint paint() { return FT_PaintTranslate.npaint(address()); } + /** @return the value of the {@code dx} field. */ + @NativeType("FT_Fixed") + public long dx() { return FT_PaintTranslate.ndx(address()); } + /** @return the value of the {@code dy} field. */ + @NativeType("FT_Fixed") + public long dy() { return FT_PaintTranslate.ndy(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Palette_Data.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Palette_Data.java new file mode 100644 index 00000000..399f30bb --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Palette_Data.java @@ -0,0 +1,291 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * This structure holds the data of the {@code CPAL} table. + * + *

Layout

+ * + *

+ * struct FT_Palette_Data {
+ *     FT_UShort num_palettes;
+ *     FT_UShort const * palette_name_ids;
+ *     FT_UShort const * palette_flags;
+ *     FT_UShort num_palette_entries;
+ *     FT_UShort const * palette_entry_name_ids;
+ * }
+ */ +public class FT_Palette_Data extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + NUM_PALETTES, + PALETTE_NAME_IDS, + PALETTE_FLAGS, + NUM_PALETTE_ENTRIES, + PALETTE_ENTRY_NAME_IDS; + + static { + Layout layout = __struct( + __member(2), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(2), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + NUM_PALETTES = layout.offsetof(0); + PALETTE_NAME_IDS = layout.offsetof(1); + PALETTE_FLAGS = layout.offsetof(2); + NUM_PALETTE_ENTRIES = layout.offsetof(3); + PALETTE_ENTRY_NAME_IDS = layout.offsetof(4); + } + + protected FT_Palette_Data(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Palette_Data create(long address, @Nullable ByteBuffer container) { + return new FT_Palette_Data(address, container); + } + + /** + * Creates a {@code FT_Palette_Data} instance at the current position of the specified {@link 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 FT_Palette_Data(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code num_palettes} field. */ + @NativeType("FT_UShort") + public short num_palettes() { return nnum_palettes(address()); } + /** @return a {@link ShortBuffer} view of the data pointed to by the {@code palette_name_ids} field. */ + @Nullable + @NativeType("FT_UShort const *") + public ShortBuffer palette_name_ids() { return npalette_name_ids(address()); } + /** @return a {@link ShortBuffer} view of the data pointed to by the {@code palette_flags} field. */ + @Nullable + @NativeType("FT_UShort const *") + public ShortBuffer palette_flags() { return npalette_flags(address()); } + /** @return the value of the {@code num_palette_entries} field. */ + @NativeType("FT_UShort") + public short num_palette_entries() { return nnum_palette_entries(address()); } + /** @return a {@link ShortBuffer} view of the data pointed to by the {@code palette_entry_name_ids} field. */ + @Nullable + @NativeType("FT_UShort const *") + public ShortBuffer palette_entry_name_ids() { return npalette_entry_name_ids(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Palette_Data} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Palette_Data malloc() { + return new FT_Palette_Data(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Palette_Data} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Palette_Data calloc() { + return new FT_Palette_Data(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Palette_Data} instance allocated with {@link BufferUtils}. */ + public static FT_Palette_Data create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Palette_Data(memAddress(container), container); + } + + /** Returns a new {@code FT_Palette_Data} instance for the specified memory address. */ + public static FT_Palette_Data create(long address) { + return new FT_Palette_Data(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Palette_Data createSafe(long address) { + return address == NULL ? null : new FT_Palette_Data(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Palette_Data} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Palette_Data malloc(MemoryStack stack) { + return new FT_Palette_Data(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Palette_Data} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Palette_Data calloc(MemoryStack stack) { + return new FT_Palette_Data(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #num_palettes}. */ + public static short nnum_palettes(long struct) { return UNSAFE.getShort(null, struct + FT_Palette_Data.NUM_PALETTES); } + /** Unsafe version of {@link #palette_name_ids() palette_name_ids}. */ + @Nullable public static ShortBuffer npalette_name_ids(long struct) { return memShortBufferSafe(memGetAddress(struct + FT_Palette_Data.PALETTE_NAME_IDS), Short.toUnsignedInt(nnum_palettes(struct))); } + /** Unsafe version of {@link #palette_flags() palette_flags}. */ + @Nullable public static ShortBuffer npalette_flags(long struct) { return memShortBufferSafe(memGetAddress(struct + FT_Palette_Data.PALETTE_FLAGS), Short.toUnsignedInt(nnum_palettes(struct))); } + /** Unsafe version of {@link #num_palette_entries}. */ + public static short nnum_palette_entries(long struct) { return UNSAFE.getShort(null, struct + FT_Palette_Data.NUM_PALETTE_ENTRIES); } + /** Unsafe version of {@link #palette_entry_name_ids() palette_entry_name_ids}. */ + @Nullable public static ShortBuffer npalette_entry_name_ids(long struct) { return memShortBufferSafe(memGetAddress(struct + FT_Palette_Data.PALETTE_ENTRY_NAME_IDS), Short.toUnsignedInt(nnum_palette_entries(struct))); } + + // ----------------------------------- + + /** An array of {@link FT_Palette_Data} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Palette_Data ELEMENT_FACTORY = FT_Palette_Data.create(-1L); + + /** + * Creates a new {@code FT_Palette_Data.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 {@link FT_Palette_Data#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Palette_Data getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code num_palettes} field. */ + @NativeType("FT_UShort") + public short num_palettes() { return FT_Palette_Data.nnum_palettes(address()); } + /** @return a {@link ShortBuffer} view of the data pointed to by the {@code palette_name_ids} field. */ + @Nullable + @NativeType("FT_UShort const *") + public ShortBuffer palette_name_ids() { return FT_Palette_Data.npalette_name_ids(address()); } + /** @return a {@link ShortBuffer} view of the data pointed to by the {@code palette_flags} field. */ + @Nullable + @NativeType("FT_UShort const *") + public ShortBuffer palette_flags() { return FT_Palette_Data.npalette_flags(address()); } + /** @return the value of the {@code num_palette_entries} field. */ + @NativeType("FT_UShort") + public short num_palette_entries() { return FT_Palette_Data.nnum_palette_entries(address()); } + /** @return a {@link ShortBuffer} view of the data pointed to by the {@code palette_entry_name_ids} field. */ + @Nullable + @NativeType("FT_UShort const *") + public ShortBuffer palette_entry_name_ids() { return FT_Palette_Data.npalette_entry_name_ids(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Parameter.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Parameter.java new file mode 100644 index 00000000..153604a4 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Parameter.java @@ -0,0 +1,297 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A simple structure to pass more or less generic parameters to {@link FreeType#FT_Open_Face Open_Face} and {@link FreeType#FT_Face_Properties Face_Properties}. + * + *

Layout

+ * + *

+ * struct FT_Parameter {
+ *     FT_ULong tag;
+ *     FT_Pointer data;
+ * }
+ */ +public class FT_Parameter extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TAG, + DATA; + + static { + Layout layout = __struct( + __member(CLONG_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TAG = layout.offsetof(0); + DATA = layout.offsetof(1); + } + + protected FT_Parameter(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Parameter create(long address, @Nullable ByteBuffer container) { + return new FT_Parameter(address, container); + } + + /** + * Creates a {@code FT_Parameter} instance at the current position of the specified {@link 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 FT_Parameter(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code tag} field. */ + @NativeType("FT_ULong") + public long tag() { return ntag(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code data} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("FT_Pointer") + public ByteBuffer data(int capacity) { return ndata(address(), capacity); } + + /** Sets the specified value to the {@code tag} field. */ + public FT_Parameter tag(@NativeType("FT_ULong") long value) { ntag(address(), value); return this; } + /** Sets the address of the specified {@link ByteBuffer} to the {@code data} field. */ + public FT_Parameter data(@Nullable @NativeType("FT_Pointer") ByteBuffer value) { ndata(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_Parameter set( + long tag, + @Nullable ByteBuffer data + ) { + tag(tag); + data(data); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Parameter set(FT_Parameter src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Parameter} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Parameter malloc() { + return new FT_Parameter(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Parameter} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Parameter calloc() { + return new FT_Parameter(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Parameter} instance allocated with {@link BufferUtils}. */ + public static FT_Parameter create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Parameter(memAddress(container), container); + } + + /** Returns a new {@code FT_Parameter} instance for the specified memory address. */ + public static FT_Parameter create(long address) { + return new FT_Parameter(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Parameter createSafe(long address) { + return address == NULL ? null : new FT_Parameter(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Parameter} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Parameter malloc(MemoryStack stack) { + return new FT_Parameter(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Parameter} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Parameter calloc(MemoryStack stack) { + return new FT_Parameter(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #tag}. */ + public static long ntag(long struct) { return memGetCLong(struct + FT_Parameter.TAG); } + /** Unsafe version of {@link #data(int) data}. */ + @Nullable public static ByteBuffer ndata(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + FT_Parameter.DATA), capacity); } + + /** Unsafe version of {@link #tag(long) tag}. */ + public static void ntag(long struct, long value) { memPutCLong(struct + FT_Parameter.TAG, value); } + /** Unsafe version of {@link #data(ByteBuffer) data}. */ + public static void ndata(long struct, @Nullable ByteBuffer value) { memPutAddress(struct + FT_Parameter.DATA, memAddressSafe(value)); } + + // ----------------------------------- + + /** An array of {@link FT_Parameter} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Parameter ELEMENT_FACTORY = FT_Parameter.create(-1L); + + /** + * Creates a new {@code FT_Parameter.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 {@link FT_Parameter#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Parameter getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code tag} field. */ + @NativeType("FT_ULong") + public long tag() { return FT_Parameter.ntag(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code data} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("FT_Pointer") + public ByteBuffer data(int capacity) { return FT_Parameter.ndata(address(), capacity); } + + /** Sets the specified value to the {@code tag} field. */ + public Buffer tag(@NativeType("FT_ULong") long value) { FT_Parameter.ntag(address(), value); return this; } + /** Sets the address of the specified {@link ByteBuffer} to the {@code data} field. */ + public Buffer data(@Nullable @NativeType("FT_Pointer") ByteBuffer value) { FT_Parameter.ndata(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Prop_GlyphToScriptMap.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Prop_GlyphToScriptMap.java new file mode 100644 index 00000000..f497b363 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Prop_GlyphToScriptMap.java @@ -0,0 +1,173 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The data exchange structure for the glyph -to-script-map property. + * + *

Layout

+ * + *

+ * struct FT_Prop_GlyphToScriptMap {
+ *     {@link FT_Face FT_Face} face;
+ *     FT_UShort * map;
+ * }
+ */ +public class FT_Prop_GlyphToScriptMap extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + FACE, + MAP; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + FACE = layout.offsetof(0); + MAP = layout.offsetof(1); + } + + protected FT_Prop_GlyphToScriptMap(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Prop_GlyphToScriptMap create(long address, @Nullable ByteBuffer container) { + return new FT_Prop_GlyphToScriptMap(address, container); + } + + /** + * Creates a {@code FT_Prop_GlyphToScriptMap} instance at the current position of the specified {@link 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 FT_Prop_GlyphToScriptMap(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_Face} view of the struct pointed to by the {@code face} field. */ + public FT_Face face() { return nface(address()); } + /** + * @return a {@link ShortBuffer} view of the data pointed to by the {@code map} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("FT_UShort *") + public ShortBuffer map(int capacity) { return nmap(address(), capacity); } + + // ----------------------------------- + + /** Returns a new {@code FT_Prop_GlyphToScriptMap} instance for the specified memory address. */ + public static FT_Prop_GlyphToScriptMap create(long address) { + return new FT_Prop_GlyphToScriptMap(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Prop_GlyphToScriptMap createSafe(long address) { + return address == NULL ? null : new FT_Prop_GlyphToScriptMap(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #face}. */ + public static FT_Face nface(long struct) { return FT_Face.create(memGetAddress(struct + FT_Prop_GlyphToScriptMap.FACE)); } + /** Unsafe version of {@link #map(int) map}. */ + @Nullable public static ShortBuffer nmap(long struct, int capacity) { return memShortBufferSafe(memGetAddress(struct + FT_Prop_GlyphToScriptMap.MAP), capacity); } + + // ----------------------------------- + + /** An array of {@link FT_Prop_GlyphToScriptMap} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_Prop_GlyphToScriptMap ELEMENT_FACTORY = FT_Prop_GlyphToScriptMap.create(-1L); + + /** + * Creates a new {@code FT_Prop_GlyphToScriptMap.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 {@link FT_Prop_GlyphToScriptMap#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Prop_GlyphToScriptMap getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_Face} view of the struct pointed to by the {@code face} field. */ + public FT_Face face() { return FT_Prop_GlyphToScriptMap.nface(address()); } + /** + * @return a {@link ShortBuffer} view of the data pointed to by the {@code map} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("FT_UShort *") + public ShortBuffer map(int capacity) { return FT_Prop_GlyphToScriptMap.nmap(address(), capacity); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Prop_IncreaseXHeight.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Prop_IncreaseXHeight.java new file mode 100644 index 00000000..a024bb78 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Prop_IncreaseXHeight.java @@ -0,0 +1,163 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The data exchange structure for the {@code increase-x-height} property. + * + *

Layout

+ * + *

+ * struct FT_Prop_IncreaseXHeight {
+ *     {@link FT_Face FT_Face} face;
+ *     FT_UInt limit;
+ * }
+ */ +public class FT_Prop_IncreaseXHeight extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + FACE, + LIMIT; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + FACE = layout.offsetof(0); + LIMIT = layout.offsetof(1); + } + + protected FT_Prop_IncreaseXHeight(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Prop_IncreaseXHeight create(long address, @Nullable ByteBuffer container) { + return new FT_Prop_IncreaseXHeight(address, container); + } + + /** + * Creates a {@code FT_Prop_IncreaseXHeight} instance at the current position of the specified {@link 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 FT_Prop_IncreaseXHeight(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_Face} view of the struct pointed to by the {@code face} field. */ + public FT_Face face() { return nface(address()); } + /** @return the value of the {@code limit} field. */ + @NativeType("FT_UInt") + public int limit$() { return nlimit$(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Prop_IncreaseXHeight} instance for the specified memory address. */ + public static FT_Prop_IncreaseXHeight create(long address) { + return new FT_Prop_IncreaseXHeight(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Prop_IncreaseXHeight createSafe(long address) { + return address == NULL ? null : new FT_Prop_IncreaseXHeight(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #face}. */ + public static FT_Face nface(long struct) { return FT_Face.create(memGetAddress(struct + FT_Prop_IncreaseXHeight.FACE)); } + /** Unsafe version of {@link #limit$}. */ + public static int nlimit$(long struct) { return UNSAFE.getInt(null, struct + FT_Prop_IncreaseXHeight.LIMIT); } + + // ----------------------------------- + + /** An array of {@link FT_Prop_IncreaseXHeight} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_Prop_IncreaseXHeight ELEMENT_FACTORY = FT_Prop_IncreaseXHeight.create(-1L); + + /** + * Creates a new {@code FT_Prop_IncreaseXHeight.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 {@link FT_Prop_IncreaseXHeight#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Prop_IncreaseXHeight getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_Face} view of the struct pointed to by the {@code face} field. */ + public FT_Face face() { return FT_Prop_IncreaseXHeight.nface(address()); } + /** @return the value of the {@code limit} field. */ + @NativeType("FT_UInt") + public int limit$() { return FT_Prop_IncreaseXHeight.nlimit$(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_DoneFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_DoneFunc.java new file mode 100644 index 00000000..8b51a7ad --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_DoneFunc.java @@ -0,0 +1,73 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     FT_Raster raster
+ * )
+ */ +public abstract class FT_Raster_DoneFunc extends Callback implements FT_Raster_DoneFuncI { + + /** + * Creates a {@code FT_Raster_DoneFunc} instance from the specified function pointer. + * + * @return the new {@code FT_Raster_DoneFunc} + */ + public static FT_Raster_DoneFunc create(long functionPointer) { + FT_Raster_DoneFuncI instance = Callback.get(functionPointer); + return instance instanceof FT_Raster_DoneFunc + ? (FT_Raster_DoneFunc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Raster_DoneFunc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Raster_DoneFunc} instance that delegates to the specified {@code FT_Raster_DoneFuncI} instance. */ + public static FT_Raster_DoneFunc create(FT_Raster_DoneFuncI instance) { + return instance instanceof FT_Raster_DoneFunc + ? (FT_Raster_DoneFunc)instance + : new Container(instance.address(), instance); + } + + protected FT_Raster_DoneFunc() { + super(CIF); + } + + FT_Raster_DoneFunc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Raster_DoneFunc { + + private final FT_Raster_DoneFuncI delegate; + + Container(long functionPointer, FT_Raster_DoneFuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long raster) { + delegate.invoke(raster); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_DoneFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_DoneFuncI.java new file mode 100644 index 00000000..830d3109 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_DoneFuncI.java @@ -0,0 +1,46 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     FT_Raster raster
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Raster_DoneFunc") +public interface FT_Raster_DoneFuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_void, + ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + invoke( + memGetAddress(memGetAddress(args)) + ); + } + + /** A function used to destroy a given raster object. */ + void invoke(@NativeType("FT_Raster") long raster); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_Funcs.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_Funcs.java new file mode 100644 index 00000000..e4881cad --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_Funcs.java @@ -0,0 +1,367 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A structure used to describe a given raster class to the library. + * + *

Layout

+ * + *

+ * struct FT_Raster_Funcs {
+ *     FT_Glyph_Format glyph_format;
+ *     {@link FT_Raster_NewFuncI FT_Raster_NewFunc} raster_new;
+ *     {@link FT_Raster_ResetFuncI FT_Raster_ResetFunc} raster_reset;
+ *     {@link FT_Raster_SetModeFuncI FT_Raster_SetModeFunc} raster_set_mode;
+ *     {@link FT_Raster_RenderFuncI FT_Raster_RenderFunc} raster_render;
+ *     {@link FT_Raster_DoneFuncI FT_Raster_DoneFunc} raster_done;
+ * }
+ */ +public class FT_Raster_Funcs extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + GLYPH_FORMAT, + RASTER_NEW, + RASTER_RESET, + RASTER_SET_MODE, + RASTER_RENDER, + RASTER_DONE; + + static { + Layout layout = __struct( + __member(4), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + GLYPH_FORMAT = layout.offsetof(0); + RASTER_NEW = layout.offsetof(1); + RASTER_RESET = layout.offsetof(2); + RASTER_SET_MODE = layout.offsetof(3); + RASTER_RENDER = layout.offsetof(4); + RASTER_DONE = layout.offsetof(5); + } + + protected FT_Raster_Funcs(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Raster_Funcs create(long address, @Nullable ByteBuffer container) { + return new FT_Raster_Funcs(address, container); + } + + /** + * Creates a {@code FT_Raster_Funcs} instance at the current position of the specified {@link 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 FT_Raster_Funcs(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code glyph_format} field. */ + @NativeType("FT_Glyph_Format") + public int glyph_format() { return nglyph_format(address()); } + /** @return the value of the {@code raster_new} field. */ + @Nullable + public FT_Raster_NewFunc raster_new() { return nraster_new(address()); } + /** @return the value of the {@code raster_reset} field. */ + @Nullable + public FT_Raster_ResetFunc raster_reset() { return nraster_reset(address()); } + /** @return the value of the {@code raster_set_mode} field. */ + @Nullable + public FT_Raster_SetModeFunc raster_set_mode() { return nraster_set_mode(address()); } + /** @return the value of the {@code raster_render} field. */ + @Nullable + public FT_Raster_RenderFunc raster_render() { return nraster_render(address()); } + /** @return the value of the {@code raster_done} field. */ + @Nullable + public FT_Raster_DoneFunc raster_done() { return nraster_done(address()); } + + /** Sets the specified value to the {@code glyph_format} field. */ + public FT_Raster_Funcs glyph_format(@NativeType("FT_Glyph_Format") int value) { nglyph_format(address(), value); return this; } + /** Sets the specified value to the {@code raster_new} field. */ + public FT_Raster_Funcs raster_new(@Nullable @NativeType("FT_Raster_NewFunc") FT_Raster_NewFuncI value) { nraster_new(address(), value); return this; } + /** Sets the specified value to the {@code raster_reset} field. */ + public FT_Raster_Funcs raster_reset(@Nullable @NativeType("FT_Raster_ResetFunc") FT_Raster_ResetFuncI value) { nraster_reset(address(), value); return this; } + /** Sets the specified value to the {@code raster_set_mode} field. */ + public FT_Raster_Funcs raster_set_mode(@Nullable @NativeType("FT_Raster_SetModeFunc") FT_Raster_SetModeFuncI value) { nraster_set_mode(address(), value); return this; } + /** Sets the specified value to the {@code raster_render} field. */ + public FT_Raster_Funcs raster_render(@Nullable @NativeType("FT_Raster_RenderFunc") FT_Raster_RenderFuncI value) { nraster_render(address(), value); return this; } + /** Sets the specified value to the {@code raster_done} field. */ + public FT_Raster_Funcs raster_done(@Nullable @NativeType("FT_Raster_DoneFunc") FT_Raster_DoneFuncI value) { nraster_done(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_Raster_Funcs set( + int glyph_format, + FT_Raster_NewFuncI raster_new, + FT_Raster_ResetFuncI raster_reset, + FT_Raster_SetModeFuncI raster_set_mode, + FT_Raster_RenderFuncI raster_render, + FT_Raster_DoneFuncI raster_done + ) { + glyph_format(glyph_format); + raster_new(raster_new); + raster_reset(raster_reset); + raster_set_mode(raster_set_mode); + raster_render(raster_render); + raster_done(raster_done); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Raster_Funcs set(FT_Raster_Funcs src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Raster_Funcs} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Raster_Funcs malloc() { + return new FT_Raster_Funcs(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Raster_Funcs} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Raster_Funcs calloc() { + return new FT_Raster_Funcs(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Raster_Funcs} instance allocated with {@link BufferUtils}. */ + public static FT_Raster_Funcs create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Raster_Funcs(memAddress(container), container); + } + + /** Returns a new {@code FT_Raster_Funcs} instance for the specified memory address. */ + public static FT_Raster_Funcs create(long address) { + return new FT_Raster_Funcs(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Raster_Funcs createSafe(long address) { + return address == NULL ? null : new FT_Raster_Funcs(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Raster_Funcs} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Raster_Funcs malloc(MemoryStack stack) { + return new FT_Raster_Funcs(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Raster_Funcs} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Raster_Funcs calloc(MemoryStack stack) { + return new FT_Raster_Funcs(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #glyph_format}. */ + public static int nglyph_format(long struct) { return UNSAFE.getInt(null, struct + FT_Raster_Funcs.GLYPH_FORMAT); } + /** Unsafe version of {@link #raster_new}. */ + @Nullable public static FT_Raster_NewFunc nraster_new(long struct) { return FT_Raster_NewFunc.createSafe(memGetAddress(struct + FT_Raster_Funcs.RASTER_NEW)); } + /** Unsafe version of {@link #raster_reset}. */ + @Nullable public static FT_Raster_ResetFunc nraster_reset(long struct) { return FT_Raster_ResetFunc.createSafe(memGetAddress(struct + FT_Raster_Funcs.RASTER_RESET)); } + /** Unsafe version of {@link #raster_set_mode}. */ + @Nullable public static FT_Raster_SetModeFunc nraster_set_mode(long struct) { return FT_Raster_SetModeFunc.createSafe(memGetAddress(struct + FT_Raster_Funcs.RASTER_SET_MODE)); } + /** Unsafe version of {@link #raster_render}. */ + @Nullable public static FT_Raster_RenderFunc nraster_render(long struct) { return FT_Raster_RenderFunc.createSafe(memGetAddress(struct + FT_Raster_Funcs.RASTER_RENDER)); } + /** Unsafe version of {@link #raster_done}. */ + @Nullable public static FT_Raster_DoneFunc nraster_done(long struct) { return FT_Raster_DoneFunc.createSafe(memGetAddress(struct + FT_Raster_Funcs.RASTER_DONE)); } + + /** Unsafe version of {@link #glyph_format(int) glyph_format}. */ + public static void nglyph_format(long struct, int value) { UNSAFE.putInt(null, struct + FT_Raster_Funcs.GLYPH_FORMAT, value); } + /** Unsafe version of {@link #raster_new(FT_Raster_NewFuncI) raster_new}. */ + public static void nraster_new(long struct, @Nullable FT_Raster_NewFuncI value) { memPutAddress(struct + FT_Raster_Funcs.RASTER_NEW, memAddressSafe(value)); } + /** Unsafe version of {@link #raster_reset(FT_Raster_ResetFuncI) raster_reset}. */ + public static void nraster_reset(long struct, @Nullable FT_Raster_ResetFuncI value) { memPutAddress(struct + FT_Raster_Funcs.RASTER_RESET, memAddressSafe(value)); } + /** Unsafe version of {@link #raster_set_mode(FT_Raster_SetModeFuncI) raster_set_mode}. */ + public static void nraster_set_mode(long struct, @Nullable FT_Raster_SetModeFuncI value) { memPutAddress(struct + FT_Raster_Funcs.RASTER_SET_MODE, memAddressSafe(value)); } + /** Unsafe version of {@link #raster_render(FT_Raster_RenderFuncI) raster_render}. */ + public static void nraster_render(long struct, @Nullable FT_Raster_RenderFuncI value) { memPutAddress(struct + FT_Raster_Funcs.RASTER_RENDER, memAddressSafe(value)); } + /** Unsafe version of {@link #raster_done(FT_Raster_DoneFuncI) raster_done}. */ + public static void nraster_done(long struct, @Nullable FT_Raster_DoneFuncI value) { memPutAddress(struct + FT_Raster_Funcs.RASTER_DONE, memAddressSafe(value)); } + + // ----------------------------------- + + /** An array of {@link FT_Raster_Funcs} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Raster_Funcs ELEMENT_FACTORY = FT_Raster_Funcs.create(-1L); + + /** + * Creates a new {@code FT_Raster_Funcs.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 {@link FT_Raster_Funcs#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Raster_Funcs getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code glyph_format} field. */ + @NativeType("FT_Glyph_Format") + public int glyph_format() { return FT_Raster_Funcs.nglyph_format(address()); } + /** @return the value of the {@code raster_new} field. */ + @Nullable + public FT_Raster_NewFunc raster_new() { return FT_Raster_Funcs.nraster_new(address()); } + /** @return the value of the {@code raster_reset} field. */ + @Nullable + public FT_Raster_ResetFunc raster_reset() { return FT_Raster_Funcs.nraster_reset(address()); } + /** @return the value of the {@code raster_set_mode} field. */ + @Nullable + public FT_Raster_SetModeFunc raster_set_mode() { return FT_Raster_Funcs.nraster_set_mode(address()); } + /** @return the value of the {@code raster_render} field. */ + @Nullable + public FT_Raster_RenderFunc raster_render() { return FT_Raster_Funcs.nraster_render(address()); } + /** @return the value of the {@code raster_done} field. */ + @Nullable + public FT_Raster_DoneFunc raster_done() { return FT_Raster_Funcs.nraster_done(address()); } + + /** Sets the specified value to the {@code glyph_format} field. */ + public Buffer glyph_format(@NativeType("FT_Glyph_Format") int value) { FT_Raster_Funcs.nglyph_format(address(), value); return this; } + /** Sets the specified value to the {@code raster_new} field. */ + public Buffer raster_new(@Nullable @NativeType("FT_Raster_NewFunc") FT_Raster_NewFuncI value) { FT_Raster_Funcs.nraster_new(address(), value); return this; } + /** Sets the specified value to the {@code raster_reset} field. */ + public Buffer raster_reset(@Nullable @NativeType("FT_Raster_ResetFunc") FT_Raster_ResetFuncI value) { FT_Raster_Funcs.nraster_reset(address(), value); return this; } + /** Sets the specified value to the {@code raster_set_mode} field. */ + public Buffer raster_set_mode(@Nullable @NativeType("FT_Raster_SetModeFunc") FT_Raster_SetModeFuncI value) { FT_Raster_Funcs.nraster_set_mode(address(), value); return this; } + /** Sets the specified value to the {@code raster_render} field. */ + public Buffer raster_render(@Nullable @NativeType("FT_Raster_RenderFunc") FT_Raster_RenderFuncI value) { FT_Raster_Funcs.nraster_render(address(), value); return this; } + /** Sets the specified value to the {@code raster_done} field. */ + public Buffer raster_done(@Nullable @NativeType("FT_Raster_DoneFunc") FT_Raster_DoneFuncI value) { FT_Raster_Funcs.nraster_done(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_NewFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_NewFunc.java new file mode 100644 index 00000000..d033ff5a --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_NewFunc.java @@ -0,0 +1,74 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * int (*{@link #invoke}) (
+ *     void *memory,
+ *     FT_Raster *raster
+ * )
+ */ +public abstract class FT_Raster_NewFunc extends Callback implements FT_Raster_NewFuncI { + + /** + * Creates a {@code FT_Raster_NewFunc} instance from the specified function pointer. + * + * @return the new {@code FT_Raster_NewFunc} + */ + public static FT_Raster_NewFunc create(long functionPointer) { + FT_Raster_NewFuncI instance = Callback.get(functionPointer); + return instance instanceof FT_Raster_NewFunc + ? (FT_Raster_NewFunc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Raster_NewFunc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Raster_NewFunc} instance that delegates to the specified {@code FT_Raster_NewFuncI} instance. */ + public static FT_Raster_NewFunc create(FT_Raster_NewFuncI instance) { + return instance instanceof FT_Raster_NewFunc + ? (FT_Raster_NewFunc)instance + : new Container(instance.address(), instance); + } + + protected FT_Raster_NewFunc() { + super(CIF); + } + + FT_Raster_NewFunc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Raster_NewFunc { + + private final FT_Raster_NewFuncI delegate; + + Container(long functionPointer, FT_Raster_NewFuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public int invoke(long memory, long raster) { + return delegate.invoke(memory, raster); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_NewFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_NewFuncI.java new file mode 100644 index 00000000..7b89f11c --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_NewFuncI.java @@ -0,0 +1,49 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * int (*{@link #invoke}) (
+ *     void *memory,
+ *     FT_Raster *raster
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Raster_NewFunc") +public interface FT_Raster_NewFuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_sint32, + ffi_type_pointer, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + int __result = invoke( + memGetAddress(memGetAddress(args)), + memGetAddress(memGetAddress(args + POINTER_SIZE)) + ); + apiClosureRet(ret, __result); + } + + /** A function used to create a new raster object. */ + int invoke(@NativeType("void *") long memory, @NativeType("FT_Raster *") long raster); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_Params.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_Params.java new file mode 100644 index 00000000..2f918945 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_Params.java @@ -0,0 +1,397 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A structure to hold the parameters used by a raster's render function, passed as an argument to {@link FreeType#FT_Outline_Render Outline_Render}. + * + *

Layout

+ * + *

+ * struct FT_Raster_Params {
+ *     {@link FT_Bitmap FT_Bitmap} const * target;
+ *     void const * source;
+ *     int flags;
+ *     {@link FT_SpanFuncI FT_SpanFunc} gray_spans;
+ *     {@link FT_SpanFuncI FT_SpanFunc} black_spans;
+ *     FT_Raster_BitTest_Func bit_test;
+ *     FT_Raster_BitTest_Func bit_set;
+ *     void * user;
+ *     {@link FT_BBox FT_BBox} clip_box;
+ * }
+ */ +public class FT_Raster_Params extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TARGET, + SOURCE, + FLAGS, + GRAY_SPANS, + BLACK_SPANS, + BIT_TEST, + BIT_SET, + USER, + CLIP_BOX; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(FT_BBox.SIZEOF, FT_BBox.ALIGNOF) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TARGET = layout.offsetof(0); + SOURCE = layout.offsetof(1); + FLAGS = layout.offsetof(2); + GRAY_SPANS = layout.offsetof(3); + BLACK_SPANS = layout.offsetof(4); + BIT_TEST = layout.offsetof(5); + BIT_SET = layout.offsetof(6); + USER = layout.offsetof(7); + CLIP_BOX = layout.offsetof(8); + } + + protected FT_Raster_Params(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Raster_Params create(long address, @Nullable ByteBuffer container) { + return new FT_Raster_Params(address, container); + } + + /** + * Creates a {@code FT_Raster_Params} instance at the current position of the specified {@link 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 FT_Raster_Params(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_Bitmap} view of the struct pointed to by the {@code target} field. */ + @Nullable + @NativeType("FT_Bitmap const *") + public FT_Bitmap target() { return ntarget(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code source} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void const *") + public ByteBuffer source(int capacity) { return nsource(address(), capacity); } + /** @return the value of the {@code flags} field. */ + public int flags() { return nflags(address()); } + /** @return the value of the {@code gray_spans} field. */ + @Nullable + public FT_SpanFunc gray_spans() { return ngray_spans(address()); } + /** @return the value of the {@code user} field. */ + @NativeType("void *") + public long user() { return nuser(address()); } + /** @return a {@link FT_BBox} view of the {@code clip_box} field. */ + public FT_BBox clip_box() { return nclip_box(address()); } + + /** Sets the address of the specified {@link FT_Bitmap} to the {@code target} field. */ + public FT_Raster_Params target(@Nullable @NativeType("FT_Bitmap const *") FT_Bitmap value) { ntarget(address(), value); return this; } + /** Sets the address of the specified {@link ByteBuffer} to the {@code source} field. */ + public FT_Raster_Params source(@Nullable @NativeType("void const *") ByteBuffer value) { nsource(address(), value); return this; } + /** Sets the specified value to the {@code flags} field. */ + public FT_Raster_Params flags(int value) { nflags(address(), value); return this; } + /** Sets the specified value to the {@code gray_spans} field. */ + public FT_Raster_Params gray_spans(@Nullable @NativeType("FT_SpanFunc") FT_SpanFuncI value) { ngray_spans(address(), value); return this; } + /** Sets the specified value to the {@code user} field. */ + public FT_Raster_Params user(@NativeType("void *") long value) { nuser(address(), value); return this; } + /** Copies the specified {@link FT_BBox} to the {@code clip_box} field. */ + public FT_Raster_Params clip_box(FT_BBox value) { nclip_box(address(), value); return this; } + /** Passes the {@code clip_box} field to the specified {@link java.util.function.Consumer Consumer}. */ + public FT_Raster_Params clip_box(java.util.function.Consumer consumer) { consumer.accept(clip_box()); return this; } + + /** Initializes this struct with the specified values. */ + public FT_Raster_Params set( + @Nullable FT_Bitmap target, + @Nullable ByteBuffer source, + int flags, + @Nullable FT_SpanFuncI gray_spans, + long user, + FT_BBox clip_box + ) { + target(target); + source(source); + flags(flags); + gray_spans(gray_spans); + user(user); + clip_box(clip_box); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Raster_Params set(FT_Raster_Params src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Raster_Params} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Raster_Params malloc() { + return new FT_Raster_Params(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Raster_Params} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Raster_Params calloc() { + return new FT_Raster_Params(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Raster_Params} instance allocated with {@link BufferUtils}. */ + public static FT_Raster_Params create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Raster_Params(memAddress(container), container); + } + + /** Returns a new {@code FT_Raster_Params} instance for the specified memory address. */ + public static FT_Raster_Params create(long address) { + return new FT_Raster_Params(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Raster_Params createSafe(long address) { + return address == NULL ? null : new FT_Raster_Params(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Raster_Params} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Raster_Params malloc(MemoryStack stack) { + return new FT_Raster_Params(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Raster_Params} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Raster_Params calloc(MemoryStack stack) { + return new FT_Raster_Params(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #target}. */ + @Nullable public static FT_Bitmap ntarget(long struct) { return FT_Bitmap.createSafe(memGetAddress(struct + FT_Raster_Params.TARGET)); } + /** Unsafe version of {@link #source(int) source}. */ + @Nullable public static ByteBuffer nsource(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + FT_Raster_Params.SOURCE), capacity); } + /** Unsafe version of {@link #flags}. */ + public static int nflags(long struct) { return UNSAFE.getInt(null, struct + FT_Raster_Params.FLAGS); } + /** Unsafe version of {@link #gray_spans}. */ + @Nullable public static FT_SpanFunc ngray_spans(long struct) { return FT_SpanFunc.createSafe(memGetAddress(struct + FT_Raster_Params.GRAY_SPANS)); } + @Nullable public static FT_SpanFunc nblack_spans(long struct) { return FT_SpanFunc.createSafe(memGetAddress(struct + FT_Raster_Params.BLACK_SPANS)); } + public static long nbit_test(long struct) { return memGetAddress(struct + FT_Raster_Params.BIT_TEST); } + public static long nbit_set(long struct) { return memGetAddress(struct + FT_Raster_Params.BIT_SET); } + /** Unsafe version of {@link #user}. */ + public static long nuser(long struct) { return memGetAddress(struct + FT_Raster_Params.USER); } + /** Unsafe version of {@link #clip_box}. */ + public static FT_BBox nclip_box(long struct) { return FT_BBox.create(struct + FT_Raster_Params.CLIP_BOX); } + + /** Unsafe version of {@link #target(FT_Bitmap) target}. */ + public static void ntarget(long struct, @Nullable FT_Bitmap value) { memPutAddress(struct + FT_Raster_Params.TARGET, memAddressSafe(value)); } + /** Unsafe version of {@link #source(ByteBuffer) source}. */ + public static void nsource(long struct, @Nullable ByteBuffer value) { memPutAddress(struct + FT_Raster_Params.SOURCE, memAddressSafe(value)); } + /** Unsafe version of {@link #flags(int) flags}. */ + public static void nflags(long struct, int value) { UNSAFE.putInt(null, struct + FT_Raster_Params.FLAGS, value); } + /** Unsafe version of {@link #gray_spans(FT_SpanFuncI) gray_spans}. */ + public static void ngray_spans(long struct, @Nullable FT_SpanFuncI value) { memPutAddress(struct + FT_Raster_Params.GRAY_SPANS, memAddressSafe(value)); } + public static void nblack_spans(long struct, @Nullable FT_SpanFuncI value) { memPutAddress(struct + FT_Raster_Params.BLACK_SPANS, memAddressSafe(value)); } + public static void nbit_test(long struct, long value) { memPutAddress(struct + FT_Raster_Params.BIT_TEST, value); } + public static void nbit_set(long struct, long value) { memPutAddress(struct + FT_Raster_Params.BIT_SET, value); } + /** Unsafe version of {@link #user(long) user}. */ + public static void nuser(long struct, long value) { memPutAddress(struct + FT_Raster_Params.USER, value); } + /** Unsafe version of {@link #clip_box(FT_BBox) clip_box}. */ + public static void nclip_box(long struct, FT_BBox value) { memCopy(value.address(), struct + FT_Raster_Params.CLIP_BOX, FT_BBox.SIZEOF); } + + // ----------------------------------- + + /** An array of {@link FT_Raster_Params} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Raster_Params ELEMENT_FACTORY = FT_Raster_Params.create(-1L); + + /** + * Creates a new {@code FT_Raster_Params.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 {@link FT_Raster_Params#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Raster_Params getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_Bitmap} view of the struct pointed to by the {@code target} field. */ + @Nullable + @NativeType("FT_Bitmap const *") + public FT_Bitmap target() { return FT_Raster_Params.ntarget(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code source} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void const *") + public ByteBuffer source(int capacity) { return FT_Raster_Params.nsource(address(), capacity); } + /** @return the value of the {@code flags} field. */ + public int flags() { return FT_Raster_Params.nflags(address()); } + /** @return the value of the {@code gray_spans} field. */ + @Nullable + public FT_SpanFunc gray_spans() { return FT_Raster_Params.ngray_spans(address()); } + /** @return the value of the {@code user} field. */ + @NativeType("void *") + public long user() { return FT_Raster_Params.nuser(address()); } + /** @return a {@link FT_BBox} view of the {@code clip_box} field. */ + public FT_BBox clip_box() { return FT_Raster_Params.nclip_box(address()); } + + /** Sets the address of the specified {@link FT_Bitmap} to the {@code target} field. */ + public Buffer target(@Nullable @NativeType("FT_Bitmap const *") FT_Bitmap value) { FT_Raster_Params.ntarget(address(), value); return this; } + /** Sets the address of the specified {@link ByteBuffer} to the {@code source} field. */ + public Buffer source(@Nullable @NativeType("void const *") ByteBuffer value) { FT_Raster_Params.nsource(address(), value); return this; } + /** Sets the specified value to the {@code flags} field. */ + public Buffer flags(int value) { FT_Raster_Params.nflags(address(), value); return this; } + /** Sets the specified value to the {@code gray_spans} field. */ + public Buffer gray_spans(@Nullable @NativeType("FT_SpanFunc") FT_SpanFuncI value) { FT_Raster_Params.ngray_spans(address(), value); return this; } + /** Sets the specified value to the {@code user} field. */ + public Buffer user(@NativeType("void *") long value) { FT_Raster_Params.nuser(address(), value); return this; } + /** Copies the specified {@link FT_BBox} to the {@code clip_box} field. */ + public Buffer clip_box(FT_BBox value) { FT_Raster_Params.nclip_box(address(), value); return this; } + /** Passes the {@code clip_box} field to the specified {@link java.util.function.Consumer Consumer}. */ + public Buffer clip_box(java.util.function.Consumer consumer) { consumer.accept(clip_box()); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_RenderFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_RenderFunc.java new file mode 100644 index 00000000..fb5a7840 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_RenderFunc.java @@ -0,0 +1,74 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * int (*{@link #invoke}) (
+ *     FT_Raster raster,
+ *     FT_Raster_Params const *params
+ * )
+ */ +public abstract class FT_Raster_RenderFunc extends Callback implements FT_Raster_RenderFuncI { + + /** + * Creates a {@code FT_Raster_RenderFunc} instance from the specified function pointer. + * + * @return the new {@code FT_Raster_RenderFunc} + */ + public static FT_Raster_RenderFunc create(long functionPointer) { + FT_Raster_RenderFuncI instance = Callback.get(functionPointer); + return instance instanceof FT_Raster_RenderFunc + ? (FT_Raster_RenderFunc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Raster_RenderFunc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Raster_RenderFunc} instance that delegates to the specified {@code FT_Raster_RenderFuncI} instance. */ + public static FT_Raster_RenderFunc create(FT_Raster_RenderFuncI instance) { + return instance instanceof FT_Raster_RenderFunc + ? (FT_Raster_RenderFunc)instance + : new Container(instance.address(), instance); + } + + protected FT_Raster_RenderFunc() { + super(CIF); + } + + FT_Raster_RenderFunc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Raster_RenderFunc { + + private final FT_Raster_RenderFuncI delegate; + + Container(long functionPointer, FT_Raster_RenderFuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public int invoke(long raster, long params) { + return delegate.invoke(raster, params); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_RenderFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_RenderFuncI.java new file mode 100644 index 00000000..144db4fa --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_RenderFuncI.java @@ -0,0 +1,49 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * int (*{@link #invoke}) (
+ *     FT_Raster raster,
+ *     FT_Raster_Params const *params
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Raster_RenderFunc") +public interface FT_Raster_RenderFuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_sint32, + ffi_type_pointer, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + int __result = invoke( + memGetAddress(memGetAddress(args)), + memGetAddress(memGetAddress(args + POINTER_SIZE)) + ); + apiClosureRet(ret, __result); + } + + /** Invoke a given raster to scan-convert a given glyph image into a target bitmap. */ + int invoke(@NativeType("FT_Raster") long raster, @NativeType("FT_Raster_Params const *") long params); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_ResetFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_ResetFunc.java new file mode 100644 index 00000000..59d7dc3e --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_ResetFunc.java @@ -0,0 +1,75 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     FT_Raster raster,
+ *     unsigned char *pool_base,
+ *     unsigned long pool_size
+ * )
+ */ +public abstract class FT_Raster_ResetFunc extends Callback implements FT_Raster_ResetFuncI { + + /** + * Creates a {@code FT_Raster_ResetFunc} instance from the specified function pointer. + * + * @return the new {@code FT_Raster_ResetFunc} + */ + public static FT_Raster_ResetFunc create(long functionPointer) { + FT_Raster_ResetFuncI instance = Callback.get(functionPointer); + return instance instanceof FT_Raster_ResetFunc + ? (FT_Raster_ResetFunc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Raster_ResetFunc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Raster_ResetFunc} instance that delegates to the specified {@code FT_Raster_ResetFuncI} instance. */ + public static FT_Raster_ResetFunc create(FT_Raster_ResetFuncI instance) { + return instance instanceof FT_Raster_ResetFunc + ? (FT_Raster_ResetFunc)instance + : new Container(instance.address(), instance); + } + + protected FT_Raster_ResetFunc() { + super(CIF); + } + + FT_Raster_ResetFunc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Raster_ResetFunc { + + private final FT_Raster_ResetFuncI delegate; + + Container(long functionPointer, FT_Raster_ResetFuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long raster, long pool_base, long pool_size) { + delegate.invoke(raster, pool_base, pool_size); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_ResetFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_ResetFuncI.java new file mode 100644 index 00000000..ff0ab45d --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_ResetFuncI.java @@ -0,0 +1,55 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     FT_Raster raster,
+ *     unsigned char *pool_base,
+ *     unsigned long pool_size
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Raster_ResetFunc") +public interface FT_Raster_ResetFuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_void, + ffi_type_pointer, ffi_type_pointer, ffi_type_ulong + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + invoke( + memGetAddress(memGetAddress(args)), + memGetAddress(memGetAddress(args + POINTER_SIZE)), + memGetCLong(memGetAddress(args + 2 * POINTER_SIZE)) + ); + } + + /** + * FreeType used to provide an area of memory called the 'render pool' available to all registered rasterizers. This was not thread safe, however, and now + * FreeType never allocates this pool. + * + *

This function is called after a new raster object is created.

+ */ + void invoke(@NativeType("FT_Raster") long raster, @NativeType("unsigned char *") long pool_base, @NativeType("unsigned long") long pool_size); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_SetModeFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_SetModeFunc.java new file mode 100644 index 00000000..f987583c --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_SetModeFunc.java @@ -0,0 +1,75 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * int (*{@link #invoke}) (
+ *     FT_Raster raster,
+ *     unsigned long mode,
+ *     void *args
+ * )
+ */ +public abstract class FT_Raster_SetModeFunc extends Callback implements FT_Raster_SetModeFuncI { + + /** + * Creates a {@code FT_Raster_SetModeFunc} instance from the specified function pointer. + * + * @return the new {@code FT_Raster_SetModeFunc} + */ + public static FT_Raster_SetModeFunc create(long functionPointer) { + FT_Raster_SetModeFuncI instance = Callback.get(functionPointer); + return instance instanceof FT_Raster_SetModeFunc + ? (FT_Raster_SetModeFunc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Raster_SetModeFunc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Raster_SetModeFunc} instance that delegates to the specified {@code FT_Raster_SetModeFuncI} instance. */ + public static FT_Raster_SetModeFunc create(FT_Raster_SetModeFuncI instance) { + return instance instanceof FT_Raster_SetModeFunc + ? (FT_Raster_SetModeFunc)instance + : new Container(instance.address(), instance); + } + + protected FT_Raster_SetModeFunc() { + super(CIF); + } + + FT_Raster_SetModeFunc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Raster_SetModeFunc { + + private final FT_Raster_SetModeFuncI delegate; + + Container(long functionPointer, FT_Raster_SetModeFuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public int invoke(long raster, long mode, long args) { + return delegate.invoke(raster, mode, args); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_SetModeFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_SetModeFuncI.java new file mode 100644 index 00000000..d8a031c7 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_SetModeFuncI.java @@ -0,0 +1,54 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * int (*{@link #invoke}) (
+ *     FT_Raster raster,
+ *     unsigned long mode,
+ *     void *args
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Raster_SetModeFunc") +public interface FT_Raster_SetModeFuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_sint32, + ffi_type_pointer, ffi_type_ulong, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + int __result = invoke( + memGetAddress(memGetAddress(args)), + memGetCLong(memGetAddress(args + POINTER_SIZE)), + memGetAddress(memGetAddress(args + 2 * POINTER_SIZE)) + ); + apiClosureRet(ret, __result); + } + + /** + * This function is a generic facility to change modes or attributes in a given raster. This can be used for debugging purposes, or simply + * to allow implementation-specific 'features' in a given raster module. + */ + int invoke(@NativeType("FT_Raster") long raster, @NativeType("unsigned long") long mode, @NativeType("void *") long args); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Realloc_Func.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Realloc_Func.java new file mode 100644 index 00000000..dc4ed70f --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Realloc_Func.java @@ -0,0 +1,76 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * void * (*{@link #invoke}) (
+ *     FT_Memory memory,
+ *     long cur_size,
+ *     long new_size,
+ *     void *block
+ * )
+ */ +public abstract class FT_Realloc_Func extends Callback implements FT_Realloc_FuncI { + + /** + * Creates a {@code FT_Realloc_Func} instance from the specified function pointer. + * + * @return the new {@code FT_Realloc_Func} + */ + public static FT_Realloc_Func create(long functionPointer) { + FT_Realloc_FuncI instance = Callback.get(functionPointer); + return instance instanceof FT_Realloc_Func + ? (FT_Realloc_Func)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Realloc_Func createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Realloc_Func} instance that delegates to the specified {@code FT_Realloc_FuncI} instance. */ + public static FT_Realloc_Func create(FT_Realloc_FuncI instance) { + return instance instanceof FT_Realloc_Func + ? (FT_Realloc_Func)instance + : new Container(instance.address(), instance); + } + + protected FT_Realloc_Func() { + super(CIF); + } + + FT_Realloc_Func(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Realloc_Func { + + private final FT_Realloc_FuncI delegate; + + Container(long functionPointer, FT_Realloc_FuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public long invoke(long memory, long cur_size, long new_size, long block) { + return delegate.invoke(memory, cur_size, new_size, block); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Realloc_FuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Realloc_FuncI.java new file mode 100644 index 00000000..ae94e191 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Realloc_FuncI.java @@ -0,0 +1,53 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * void * (*{@link #invoke}) (
+ *     FT_Memory memory,
+ *     long cur_size,
+ *     long new_size,
+ *     void *block
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Realloc_Func") +public interface FT_Realloc_FuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_pointer, + ffi_type_pointer, ffi_type_slong, ffi_type_slong, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + long __result = invoke( + memGetAddress(memGetAddress(args)), + memGetCLong(memGetAddress(args + POINTER_SIZE)), + memGetCLong(memGetAddress(args + 2 * POINTER_SIZE)), + memGetAddress(memGetAddress(args + 3 * POINTER_SIZE)) + ); + apiClosureRetP(ret, __result); + } + + /** A function used to re-allocate a given block of memory. */ + @NativeType("void *") long invoke(@NativeType("FT_Memory") long memory, long cur_size, long new_size, @NativeType("void *") long block); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SVG_Document.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SVG_Document.java new file mode 100644 index 00000000..c4f22acf --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SVG_Document.java @@ -0,0 +1,232 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure that models one SVG document. + * + *

Layout

+ * + *

+ * struct FT_SVG_DocumentRec {
+ *     FT_Byte * svg_document;
+ *     FT_ULong svg_document_length;
+ *     {@link FT_Size_Metrics FT_Size_Metrics} metrics;
+ *     FT_UShort units_per_EM;
+ *     FT_UShort start_glyph_id;
+ *     FT_UShort end_glyph_id;
+ *     {@link FT_Matrix FT_Matrix} transform;
+ *     {@link FT_Vector FT_Vector} delta;
+ * }
+ */ +@NativeType("struct FT_SVG_DocumentRec") +public class FT_SVG_Document extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + SVG_DOCUMENT, + SVG_DOCUMENT_LENGTH, + METRICS, + UNITS_PER_EM, + START_GLYPH_ID, + END_GLYPH_ID, + TRANSFORM, + DELTA; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(FT_Size_Metrics.SIZEOF, FT_Size_Metrics.ALIGNOF), + __member(2), + __member(2), + __member(2), + __member(FT_Matrix.SIZEOF, FT_Matrix.ALIGNOF), + __member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + SVG_DOCUMENT = layout.offsetof(0); + SVG_DOCUMENT_LENGTH = layout.offsetof(1); + METRICS = layout.offsetof(2); + UNITS_PER_EM = layout.offsetof(3); + START_GLYPH_ID = layout.offsetof(4); + END_GLYPH_ID = layout.offsetof(5); + TRANSFORM = layout.offsetof(6); + DELTA = layout.offsetof(7); + } + + protected FT_SVG_Document(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_SVG_Document create(long address, @Nullable ByteBuffer container) { + return new FT_SVG_Document(address, container); + } + + /** + * Creates a {@code FT_SVG_Document} instance at the current position of the specified {@link 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 FT_SVG_Document(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code svg_document} field. */ + @NativeType("FT_Byte *") + public ByteBuffer svg_document() { return nsvg_document(address()); } + /** @return the value of the {@code svg_document_length} field. */ + @NativeType("FT_ULong") + public long svg_document_length() { return nsvg_document_length(address()); } + /** @return a {@link FT_Size_Metrics} view of the {@code metrics} field. */ + public FT_Size_Metrics metrics() { return nmetrics(address()); } + /** @return the value of the {@code units_per_EM} field. */ + @NativeType("FT_UShort") + public short units_per_EM() { return nunits_per_EM(address()); } + /** @return the value of the {@code start_glyph_id} field. */ + @NativeType("FT_UShort") + public short start_glyph_id() { return nstart_glyph_id(address()); } + /** @return the value of the {@code end_glyph_id} field. */ + @NativeType("FT_UShort") + public short end_glyph_id() { return nend_glyph_id(address()); } + /** @return a {@link FT_Matrix} view of the {@code transform} field. */ + public FT_Matrix transform() { return ntransform(address()); } + /** @return a {@link FT_Vector} view of the {@code delta} field. */ + public FT_Vector delta() { return ndelta(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_SVG_Document} instance for the specified memory address. */ + public static FT_SVG_Document create(long address) { + return new FT_SVG_Document(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_SVG_Document createSafe(long address) { + return address == NULL ? null : new FT_SVG_Document(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #svg_document() svg_document}. */ + public static ByteBuffer nsvg_document(long struct) { return memByteBuffer(memGetAddress(struct + FT_SVG_Document.SVG_DOCUMENT), (int)nsvg_document_length(struct)); } + /** Unsafe version of {@link #svg_document_length}. */ + public static long nsvg_document_length(long struct) { return memGetCLong(struct + FT_SVG_Document.SVG_DOCUMENT_LENGTH); } + /** Unsafe version of {@link #metrics}. */ + public static FT_Size_Metrics nmetrics(long struct) { return FT_Size_Metrics.create(struct + FT_SVG_Document.METRICS); } + /** Unsafe version of {@link #units_per_EM}. */ + public static short nunits_per_EM(long struct) { return UNSAFE.getShort(null, struct + FT_SVG_Document.UNITS_PER_EM); } + /** Unsafe version of {@link #start_glyph_id}. */ + public static short nstart_glyph_id(long struct) { return UNSAFE.getShort(null, struct + FT_SVG_Document.START_GLYPH_ID); } + /** Unsafe version of {@link #end_glyph_id}. */ + public static short nend_glyph_id(long struct) { return UNSAFE.getShort(null, struct + FT_SVG_Document.END_GLYPH_ID); } + /** Unsafe version of {@link #transform}. */ + public static FT_Matrix ntransform(long struct) { return FT_Matrix.create(struct + FT_SVG_Document.TRANSFORM); } + /** Unsafe version of {@link #delta}. */ + public static FT_Vector ndelta(long struct) { return FT_Vector.create(struct + FT_SVG_Document.DELTA); } + + // ----------------------------------- + + /** An array of {@link FT_SVG_Document} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_SVG_Document ELEMENT_FACTORY = FT_SVG_Document.create(-1L); + + /** + * Creates a new {@code FT_SVG_Document.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 {@link FT_SVG_Document#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_SVG_Document getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code svg_document} field. */ + @NativeType("FT_Byte *") + public ByteBuffer svg_document() { return FT_SVG_Document.nsvg_document(address()); } + /** @return the value of the {@code svg_document_length} field. */ + @NativeType("FT_ULong") + public long svg_document_length() { return FT_SVG_Document.nsvg_document_length(address()); } + /** @return a {@link FT_Size_Metrics} view of the {@code metrics} field. */ + public FT_Size_Metrics metrics() { return FT_SVG_Document.nmetrics(address()); } + /** @return the value of the {@code units_per_EM} field. */ + @NativeType("FT_UShort") + public short units_per_EM() { return FT_SVG_Document.nunits_per_EM(address()); } + /** @return the value of the {@code start_glyph_id} field. */ + @NativeType("FT_UShort") + public short start_glyph_id() { return FT_SVG_Document.nstart_glyph_id(address()); } + /** @return the value of the {@code end_glyph_id} field. */ + @NativeType("FT_UShort") + public short end_glyph_id() { return FT_SVG_Document.nend_glyph_id(address()); } + /** @return a {@link FT_Matrix} view of the {@code transform} field. */ + public FT_Matrix transform() { return FT_SVG_Document.ntransform(address()); } + /** @return a {@link FT_Vector} view of the {@code delta} field. */ + public FT_Vector delta() { return FT_SVG_Document.ndelta(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SfntLangTag.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SfntLangTag.java new file mode 100644 index 00000000..636bc77a --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SfntLangTag.java @@ -0,0 +1,247 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Layout

+ * + *

+ * struct FT_SfntLangTag {
+ *     FT_Byte * string;
+ *     FT_UInt string_len;
+ * }
+ */ +public class FT_SfntLangTag extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + STRING, + STRING_LEN; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + STRING = layout.offsetof(0); + STRING_LEN = layout.offsetof(1); + } + + protected FT_SfntLangTag(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_SfntLangTag create(long address, @Nullable ByteBuffer container) { + return new FT_SfntLangTag(address, container); + } + + /** + * Creates a {@code FT_SfntLangTag} instance at the current position of the specified {@link 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 FT_SfntLangTag(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code string} field. */ + @NativeType("FT_Byte *") + public ByteBuffer string() { return nstring(address()); } + /** @return the value of the {@code string_len} field. */ + @NativeType("FT_UInt") + public int string_len() { return nstring_len(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_SfntLangTag} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_SfntLangTag malloc() { + return new FT_SfntLangTag(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_SfntLangTag} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_SfntLangTag calloc() { + return new FT_SfntLangTag(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_SfntLangTag} instance allocated with {@link BufferUtils}. */ + public static FT_SfntLangTag create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_SfntLangTag(memAddress(container), container); + } + + /** Returns a new {@code FT_SfntLangTag} instance for the specified memory address. */ + public static FT_SfntLangTag create(long address) { + return new FT_SfntLangTag(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_SfntLangTag createSafe(long address) { + return address == NULL ? null : new FT_SfntLangTag(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_SfntLangTag} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_SfntLangTag malloc(MemoryStack stack) { + return new FT_SfntLangTag(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_SfntLangTag} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_SfntLangTag calloc(MemoryStack stack) { + return new FT_SfntLangTag(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #string() string}. */ + public static ByteBuffer nstring(long struct) { return memByteBuffer(memGetAddress(struct + FT_SfntLangTag.STRING), nstring_len(struct)); } + /** Unsafe version of {@link #string_len}. */ + public static int nstring_len(long struct) { return UNSAFE.getInt(null, struct + FT_SfntLangTag.STRING_LEN); } + + // ----------------------------------- + + /** An array of {@link FT_SfntLangTag} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_SfntLangTag ELEMENT_FACTORY = FT_SfntLangTag.create(-1L); + + /** + * Creates a new {@code FT_SfntLangTag.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 {@link FT_SfntLangTag#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_SfntLangTag getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code string} field. */ + @NativeType("FT_Byte *") + public ByteBuffer string() { return FT_SfntLangTag.nstring(address()); } + /** @return the value of the {@code string_len} field. */ + @NativeType("FT_UInt") + public int string_len() { return FT_SfntLangTag.nstring_len(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SfntName.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SfntName.java new file mode 100644 index 00000000..eb26b887 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SfntName.java @@ -0,0 +1,295 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Layout

+ * + *

+ * struct FT_SfntName {
+ *     FT_UShort platform_id;
+ *     FT_UShort encoding_id;
+ *     FT_UShort language_id;
+ *     FT_UShort name_id;
+ *     FT_Byte * string;
+ *     FT_UInt string_len;
+ * }
+ */ +public class FT_SfntName extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + PLATFORM_ID, + ENCODING_ID, + LANGUAGE_ID, + NAME_ID, + STRING, + STRING_LEN; + + static { + Layout layout = __struct( + __member(2), + __member(2), + __member(2), + __member(2), + __member(POINTER_SIZE), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + PLATFORM_ID = layout.offsetof(0); + ENCODING_ID = layout.offsetof(1); + LANGUAGE_ID = layout.offsetof(2); + NAME_ID = layout.offsetof(3); + STRING = layout.offsetof(4); + STRING_LEN = layout.offsetof(5); + } + + protected FT_SfntName(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_SfntName create(long address, @Nullable ByteBuffer container) { + return new FT_SfntName(address, container); + } + + /** + * Creates a {@code FT_SfntName} instance at the current position of the specified {@link 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 FT_SfntName(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code platform_id} field. */ + @NativeType("FT_UShort") + public short platform_id() { return nplatform_id(address()); } + /** @return the value of the {@code encoding_id} field. */ + @NativeType("FT_UShort") + public short encoding_id() { return nencoding_id(address()); } + /** @return the value of the {@code language_id} field. */ + @NativeType("FT_UShort") + public short language_id() { return nlanguage_id(address()); } + /** @return the value of the {@code name_id} field. */ + @NativeType("FT_UShort") + public short name_id() { return nname_id(address()); } + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code string} field. */ + @NativeType("FT_Byte *") + public ByteBuffer string() { return nstring(address()); } + /** @return the value of the {@code string_len} field. */ + @NativeType("FT_UInt") + public int string_len() { return nstring_len(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_SfntName} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_SfntName malloc() { + return new FT_SfntName(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_SfntName} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_SfntName calloc() { + return new FT_SfntName(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_SfntName} instance allocated with {@link BufferUtils}. */ + public static FT_SfntName create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_SfntName(memAddress(container), container); + } + + /** Returns a new {@code FT_SfntName} instance for the specified memory address. */ + public static FT_SfntName create(long address) { + return new FT_SfntName(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_SfntName createSafe(long address) { + return address == NULL ? null : new FT_SfntName(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_SfntName} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_SfntName malloc(MemoryStack stack) { + return new FT_SfntName(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_SfntName} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_SfntName calloc(MemoryStack stack) { + return new FT_SfntName(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #platform_id}. */ + public static short nplatform_id(long struct) { return UNSAFE.getShort(null, struct + FT_SfntName.PLATFORM_ID); } + /** Unsafe version of {@link #encoding_id}. */ + public static short nencoding_id(long struct) { return UNSAFE.getShort(null, struct + FT_SfntName.ENCODING_ID); } + /** Unsafe version of {@link #language_id}. */ + public static short nlanguage_id(long struct) { return UNSAFE.getShort(null, struct + FT_SfntName.LANGUAGE_ID); } + /** Unsafe version of {@link #name_id}. */ + public static short nname_id(long struct) { return UNSAFE.getShort(null, struct + FT_SfntName.NAME_ID); } + /** Unsafe version of {@link #string() string}. */ + public static ByteBuffer nstring(long struct) { return memByteBuffer(memGetAddress(struct + FT_SfntName.STRING), nstring_len(struct)); } + /** Unsafe version of {@link #string_len}. */ + public static int nstring_len(long struct) { return UNSAFE.getInt(null, struct + FT_SfntName.STRING_LEN); } + + // ----------------------------------- + + /** An array of {@link FT_SfntName} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_SfntName ELEMENT_FACTORY = FT_SfntName.create(-1L); + + /** + * Creates a new {@code FT_SfntName.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 {@link FT_SfntName#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_SfntName getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code platform_id} field. */ + @NativeType("FT_UShort") + public short platform_id() { return FT_SfntName.nplatform_id(address()); } + /** @return the value of the {@code encoding_id} field. */ + @NativeType("FT_UShort") + public short encoding_id() { return FT_SfntName.nencoding_id(address()); } + /** @return the value of the {@code language_id} field. */ + @NativeType("FT_UShort") + public short language_id() { return FT_SfntName.nlanguage_id(address()); } + /** @return the value of the {@code name_id} field. */ + @NativeType("FT_UShort") + public short name_id() { return FT_SfntName.nname_id(address()); } + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code string} field. */ + @NativeType("FT_Byte *") + public ByteBuffer string() { return FT_SfntName.nstring(address()); } + /** @return the value of the {@code string_len} field. */ + @NativeType("FT_UInt") + public int string_len() { return FT_SfntName.nstring_len(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size.java new file mode 100644 index 00000000..bc76589c --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size.java @@ -0,0 +1,323 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * FreeType root size class structure. A size object models a face object at a given size. + * + *

Layout

+ * + *

+ * struct FT_SizeRec {
+ *     {@link FT_Face FT_Face} {@link #face};
+ *     {@link FT_Generic FT_Generic} {@link #generic};
+ *     {@link FT_Size_Metrics FT_Size_Metrics} {@link #metrics};
+ *     {@link FT_Size_Internal FT_Size_Internal} * internal;
+ * }
+ */ +@NativeType("struct FT_SizeRec") +public class FT_Size extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + FACE, + GENERIC, + METRICS, + INTERNAL; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(FT_Generic.SIZEOF, FT_Generic.ALIGNOF), + __member(FT_Size_Metrics.SIZEOF, FT_Size_Metrics.ALIGNOF), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + FACE = layout.offsetof(0); + GENERIC = layout.offsetof(1); + METRICS = layout.offsetof(2); + INTERNAL = layout.offsetof(3); + } + + protected FT_Size(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Size create(long address, @Nullable ByteBuffer container) { + return new FT_Size(address, container); + } + + /** + * Creates a {@code FT_Size} instance at the current position of the specified {@link 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 FT_Size(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** parent face object */ + public FT_Face face() { return nface(address()); } + /** generic pointer for client uses */ + public FT_Generic generic() { return ngeneric(address()); } + /** size metrics */ + public FT_Size_Metrics metrics() { return nmetrics(address()); } + + /** Sets the address of the specified {@link FT_Face} to the {@link #face} field. */ + public FT_Size face(FT_Face value) { nface(address(), value); return this; } + /** Copies the specified {@link FT_Generic} to the {@link #generic} field. */ + public FT_Size generic(FT_Generic value) { ngeneric(address(), value); return this; } + /** Passes the {@link #generic} field to the specified {@link java.util.function.Consumer Consumer}. */ + public FT_Size generic(java.util.function.Consumer consumer) { consumer.accept(generic()); return this; } + /** Copies the specified {@link FT_Size_Metrics} to the {@link #metrics} field. */ + public FT_Size metrics(FT_Size_Metrics value) { nmetrics(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_Size set( + FT_Face face, + FT_Generic generic, + FT_Size_Metrics metrics + ) { + face(face); + generic(generic); + metrics(metrics); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Size set(FT_Size src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Size} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Size malloc() { + return new FT_Size(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Size} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Size calloc() { + return new FT_Size(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Size} instance allocated with {@link BufferUtils}. */ + public static FT_Size create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Size(memAddress(container), container); + } + + /** Returns a new {@code FT_Size} instance for the specified memory address. */ + public static FT_Size create(long address) { + return new FT_Size(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Size createSafe(long address) { + return address == NULL ? null : new FT_Size(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Size} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Size malloc(MemoryStack stack) { + return new FT_Size(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Size} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Size calloc(MemoryStack stack) { + return new FT_Size(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #face}. */ + public static FT_Face nface(long struct) { return FT_Face.create(memGetAddress(struct + FT_Size.FACE)); } + /** Unsafe version of {@link #generic}. */ + public static FT_Generic ngeneric(long struct) { return FT_Generic.create(struct + FT_Size.GENERIC); } + /** Unsafe version of {@link #metrics}. */ + public static FT_Size_Metrics nmetrics(long struct) { return FT_Size_Metrics.create(struct + FT_Size.METRICS); } + public static FT_Size_Internal ninternal(long struct) { return FT_Size_Internal.create(memGetAddress(struct + FT_Size.INTERNAL)); } + + /** Unsafe version of {@link #face(FT_Face) face}. */ + public static void nface(long struct, FT_Face value) { memPutAddress(struct + FT_Size.FACE, value.address()); } + /** Unsafe version of {@link #generic(FT_Generic) generic}. */ + public static void ngeneric(long struct, FT_Generic value) { memCopy(value.address(), struct + FT_Size.GENERIC, FT_Generic.SIZEOF); } + /** Unsafe version of {@link #metrics(FT_Size_Metrics) metrics}. */ + public static void nmetrics(long struct, FT_Size_Metrics value) { memCopy(value.address(), struct + FT_Size.METRICS, FT_Size_Metrics.SIZEOF); } + public static void ninternal(long struct, FT_Size_Internal value) { memPutAddress(struct + FT_Size.INTERNAL, value.address()); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + FT_Size.FACE)); + FT_Generic.validate(struct + FT_Size.GENERIC); + } + + // ----------------------------------- + + /** An array of {@link FT_Size} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Size ELEMENT_FACTORY = FT_Size.create(-1L); + + /** + * Creates a new {@code FT_Size.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 {@link FT_Size#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Size getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_Face} view of the struct pointed to by the {@link FT_Size#face} field. */ + public FT_Face face() { return FT_Size.nface(address()); } + /** @return a {@link FT_Generic} view of the {@link FT_Size#generic} field. */ + public FT_Generic generic() { return FT_Size.ngeneric(address()); } + /** @return a {@link FT_Size_Metrics} view of the {@link FT_Size#metrics} field. */ + public FT_Size_Metrics metrics() { return FT_Size.nmetrics(address()); } + + /** Sets the address of the specified {@link FT_Face} to the {@link FT_Size#face} field. */ + public Buffer face(FT_Face value) { FT_Size.nface(address(), value); return this; } + /** Copies the specified {@link FT_Generic} to the {@link FT_Size#generic} field. */ + public Buffer generic(FT_Generic value) { FT_Size.ngeneric(address(), value); return this; } + /** Passes the {@link FT_Size#generic} field to the specified {@link java.util.function.Consumer Consumer}. */ + public Buffer generic(java.util.function.Consumer consumer) { consumer.accept(generic()); return this; } + /** Copies the specified {@link FT_Size_Metrics} to the {@link FT_Size#metrics} field. */ + public Buffer metrics(FT_Size_Metrics value) { FT_Size.nmetrics(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size_Internal.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size_Internal.java new file mode 100644 index 00000000..922b88c0 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size_Internal.java @@ -0,0 +1,173 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Layout

+ * + *

+ * struct FT_Size_Internal {
+ *     void * module_data;
+ *     FT_Render_Mode autohint_mode;
+ *     {@link FT_Size_Metrics FT_Size_Metrics} autohint_metrics;
+ * }
+ */ +public class FT_Size_Internal extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + MODULE_DATA, + AUTOHINT_MODE, + AUTOHINT_METRICS; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(4), + __member(FT_Size_Metrics.SIZEOF, FT_Size_Metrics.ALIGNOF) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + MODULE_DATA = layout.offsetof(0); + AUTOHINT_MODE = layout.offsetof(1); + AUTOHINT_METRICS = layout.offsetof(2); + } + + protected FT_Size_Internal(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Size_Internal create(long address, @Nullable ByteBuffer container) { + return new FT_Size_Internal(address, container); + } + + /** + * Creates a {@code FT_Size_Internal} instance at the current position of the specified {@link 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 FT_Size_Internal(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code module_data} field. */ + @NativeType("void *") + public long module_data() { return nmodule_data(address()); } + /** @return the value of the {@code autohint_mode} field. */ + @NativeType("FT_Render_Mode") + public int autohint_mode() { return nautohint_mode(address()); } + /** @return a {@link FT_Size_Metrics} view of the {@code autohint_metrics} field. */ + public FT_Size_Metrics autohint_metrics() { return nautohint_metrics(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Size_Internal} instance for the specified memory address. */ + public static FT_Size_Internal create(long address) { + return new FT_Size_Internal(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Size_Internal createSafe(long address) { + return address == NULL ? null : new FT_Size_Internal(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #module_data}. */ + public static long nmodule_data(long struct) { return memGetAddress(struct + FT_Size_Internal.MODULE_DATA); } + /** Unsafe version of {@link #autohint_mode}. */ + public static int nautohint_mode(long struct) { return UNSAFE.getInt(null, struct + FT_Size_Internal.AUTOHINT_MODE); } + /** Unsafe version of {@link #autohint_metrics}. */ + public static FT_Size_Metrics nautohint_metrics(long struct) { return FT_Size_Metrics.create(struct + FT_Size_Internal.AUTOHINT_METRICS); } + + // ----------------------------------- + + /** An array of {@link FT_Size_Internal} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_Size_Internal ELEMENT_FACTORY = FT_Size_Internal.create(-1L); + + /** + * Creates a new {@code FT_Size_Internal.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 {@link FT_Size_Internal#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Size_Internal getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code module_data} field. */ + @NativeType("void *") + public long module_data() { return FT_Size_Internal.nmodule_data(address()); } + /** @return the value of the {@code autohint_mode} field. */ + @NativeType("FT_Render_Mode") + public int autohint_mode() { return FT_Size_Internal.nautohint_mode(address()); } + /** @return a {@link FT_Size_Metrics} view of the {@code autohint_metrics} field. */ + public FT_Size_Metrics autohint_metrics() { return FT_Size_Internal.nautohint_metrics(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size_Metrics.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size_Metrics.java new file mode 100644 index 00000000..5317bf62 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size_Metrics.java @@ -0,0 +1,237 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The size metrics structure gives the metrics of a size object. + * + *

Layout

+ * + *

+ * struct FT_Size_Metrics {
+ *     FT_UShort {@link #x_ppem};
+ *     FT_UShort {@link #y_ppem};
+ *     FT_Fixed {@link #x_scale};
+ *     FT_Fixed {@link #y_scale};
+ *     FT_Pos {@link #ascender};
+ *     FT_Pos {@link #descender};
+ *     FT_Pos {@link #height};
+ *     FT_Pos {@link #max_advance};
+ * }
+ */ +public class FT_Size_Metrics extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + X_PPEM, + Y_PPEM, + X_SCALE, + Y_SCALE, + ASCENDER, + DESCENDER, + HEIGHT, + MAX_ADVANCE; + + static { + Layout layout = __struct( + __member(2), + __member(2), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + X_PPEM = layout.offsetof(0); + Y_PPEM = layout.offsetof(1); + X_SCALE = layout.offsetof(2); + Y_SCALE = layout.offsetof(3); + ASCENDER = layout.offsetof(4); + DESCENDER = layout.offsetof(5); + HEIGHT = layout.offsetof(6); + MAX_ADVANCE = layout.offsetof(7); + } + + protected FT_Size_Metrics(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Size_Metrics create(long address, @Nullable ByteBuffer container) { + return new FT_Size_Metrics(address, container); + } + + /** + * Creates a {@code FT_Size_Metrics} instance at the current position of the specified {@link 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 FT_Size_Metrics(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** horizontal pixels per EM */ + @NativeType("FT_UShort") + public short x_ppem() { return nx_ppem(address()); } + /** vertical pixels per EM */ + @NativeType("FT_UShort") + public short y_ppem() { return ny_ppem(address()); } + /** scaling values used to convert font */ + @NativeType("FT_Fixed") + public long x_scale() { return nx_scale(address()); } + /** units to 26.6 fractional pixels */ + @NativeType("FT_Fixed") + public long y_scale() { return ny_scale(address()); } + /** ascender in 26.6 frac. pixels */ + @NativeType("FT_Pos") + public long ascender() { return nascender(address()); } + /** descender in 26.6 frac. pixels */ + @NativeType("FT_Pos") + public long descender() { return ndescender(address()); } + /** text height in 26.6 frac. pixels */ + @NativeType("FT_Pos") + public long height() { return nheight(address()); } + /** max horizontal advance, in 26.6 pixels */ + @NativeType("FT_Pos") + public long max_advance() { return nmax_advance(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Size_Metrics} instance for the specified memory address. */ + public static FT_Size_Metrics create(long address) { + return new FT_Size_Metrics(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Size_Metrics createSafe(long address) { + return address == NULL ? null : new FT_Size_Metrics(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #x_ppem}. */ + public static short nx_ppem(long struct) { return UNSAFE.getShort(null, struct + FT_Size_Metrics.X_PPEM); } + /** Unsafe version of {@link #y_ppem}. */ + public static short ny_ppem(long struct) { return UNSAFE.getShort(null, struct + FT_Size_Metrics.Y_PPEM); } + /** Unsafe version of {@link #x_scale}. */ + public static long nx_scale(long struct) { return memGetCLong(struct + FT_Size_Metrics.X_SCALE); } + /** Unsafe version of {@link #y_scale}. */ + public static long ny_scale(long struct) { return memGetCLong(struct + FT_Size_Metrics.Y_SCALE); } + /** Unsafe version of {@link #ascender}. */ + public static long nascender(long struct) { return memGetCLong(struct + FT_Size_Metrics.ASCENDER); } + /** Unsafe version of {@link #descender}. */ + public static long ndescender(long struct) { return memGetCLong(struct + FT_Size_Metrics.DESCENDER); } + /** Unsafe version of {@link #height}. */ + public static long nheight(long struct) { return memGetCLong(struct + FT_Size_Metrics.HEIGHT); } + /** Unsafe version of {@link #max_advance}. */ + public static long nmax_advance(long struct) { return memGetCLong(struct + FT_Size_Metrics.MAX_ADVANCE); } + + // ----------------------------------- + + /** An array of {@link FT_Size_Metrics} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_Size_Metrics ELEMENT_FACTORY = FT_Size_Metrics.create(-1L); + + /** + * Creates a new {@code FT_Size_Metrics.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 {@link FT_Size_Metrics#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Size_Metrics getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@link FT_Size_Metrics#x_ppem} field. */ + @NativeType("FT_UShort") + public short x_ppem() { return FT_Size_Metrics.nx_ppem(address()); } + /** @return the value of the {@link FT_Size_Metrics#y_ppem} field. */ + @NativeType("FT_UShort") + public short y_ppem() { return FT_Size_Metrics.ny_ppem(address()); } + /** @return the value of the {@link FT_Size_Metrics#x_scale} field. */ + @NativeType("FT_Fixed") + public long x_scale() { return FT_Size_Metrics.nx_scale(address()); } + /** @return the value of the {@link FT_Size_Metrics#y_scale} field. */ + @NativeType("FT_Fixed") + public long y_scale() { return FT_Size_Metrics.ny_scale(address()); } + /** @return the value of the {@link FT_Size_Metrics#ascender} field. */ + @NativeType("FT_Pos") + public long ascender() { return FT_Size_Metrics.nascender(address()); } + /** @return the value of the {@link FT_Size_Metrics#descender} field. */ + @NativeType("FT_Pos") + public long descender() { return FT_Size_Metrics.ndescender(address()); } + /** @return the value of the {@link FT_Size_Metrics#height} field. */ + @NativeType("FT_Pos") + public long height() { return FT_Size_Metrics.nheight(address()); } + /** @return the value of the {@link FT_Size_Metrics#max_advance} field. */ + @NativeType("FT_Pos") + public long max_advance() { return FT_Size_Metrics.nmax_advance(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size_Request.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size_Request.java new file mode 100644 index 00000000..6b98a129 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size_Request.java @@ -0,0 +1,348 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A structure to model a size request. + * + *

Layout

+ * + *

+ * struct FT_Size_RequestRec {
+ *     FT_Size_Request_Type type;
+ *     FT_Long width;
+ *     FT_Long height;
+ *     FT_UInt horiResolution;
+ *     FT_UInt vertResolution;
+ * }
+ */ +@NativeType("struct FT_Size_RequestRec") +public class FT_Size_Request extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + WIDTH, + HEIGHT, + HORIRESOLUTION, + VERTRESOLUTION; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + WIDTH = layout.offsetof(1); + HEIGHT = layout.offsetof(2); + HORIRESOLUTION = layout.offsetof(3); + VERTRESOLUTION = layout.offsetof(4); + } + + protected FT_Size_Request(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Size_Request create(long address, @Nullable ByteBuffer container) { + return new FT_Size_Request(address, container); + } + + /** + * Creates a {@code FT_Size_Request} instance at the current position of the specified {@link 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 FT_Size_Request(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code type} field. */ + @NativeType("FT_Size_Request_Type") + public int type() { return ntype(address()); } + /** @return the value of the {@code width} field. */ + @NativeType("FT_Long") + public long width() { return nwidth(address()); } + /** @return the value of the {@code height} field. */ + @NativeType("FT_Long") + public long height() { return nheight(address()); } + /** @return the value of the {@code horiResolution} field. */ + @NativeType("FT_UInt") + public int horiResolution() { return nhoriResolution(address()); } + /** @return the value of the {@code vertResolution} field. */ + @NativeType("FT_UInt") + public int vertResolution() { return nvertResolution(address()); } + + /** Sets the specified value to the {@code type} field. */ + public FT_Size_Request type(@NativeType("FT_Size_Request_Type") int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code width} field. */ + public FT_Size_Request width(@NativeType("FT_Long") long value) { nwidth(address(), value); return this; } + /** Sets the specified value to the {@code height} field. */ + public FT_Size_Request height(@NativeType("FT_Long") long value) { nheight(address(), value); return this; } + /** Sets the specified value to the {@code horiResolution} field. */ + public FT_Size_Request horiResolution(@NativeType("FT_UInt") int value) { nhoriResolution(address(), value); return this; } + /** Sets the specified value to the {@code vertResolution} field. */ + public FT_Size_Request vertResolution(@NativeType("FT_UInt") int value) { nvertResolution(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_Size_Request set( + int type, + long width, + long height, + int horiResolution, + int vertResolution + ) { + type(type); + width(width); + height(height); + horiResolution(horiResolution); + vertResolution(vertResolution); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Size_Request set(FT_Size_Request src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Size_Request} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Size_Request malloc() { + return new FT_Size_Request(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Size_Request} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Size_Request calloc() { + return new FT_Size_Request(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Size_Request} instance allocated with {@link BufferUtils}. */ + public static FT_Size_Request create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Size_Request(memAddress(container), container); + } + + /** Returns a new {@code FT_Size_Request} instance for the specified memory address. */ + public static FT_Size_Request create(long address) { + return new FT_Size_Request(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Size_Request createSafe(long address) { + return address == NULL ? null : new FT_Size_Request(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Size_Request} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Size_Request malloc(MemoryStack stack) { + return new FT_Size_Request(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Size_Request} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Size_Request calloc(MemoryStack stack) { + return new FT_Size_Request(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + FT_Size_Request.TYPE); } + /** Unsafe version of {@link #width}. */ + public static long nwidth(long struct) { return memGetCLong(struct + FT_Size_Request.WIDTH); } + /** Unsafe version of {@link #height}. */ + public static long nheight(long struct) { return memGetCLong(struct + FT_Size_Request.HEIGHT); } + /** Unsafe version of {@link #horiResolution}. */ + public static int nhoriResolution(long struct) { return UNSAFE.getInt(null, struct + FT_Size_Request.HORIRESOLUTION); } + /** Unsafe version of {@link #vertResolution}. */ + public static int nvertResolution(long struct) { return UNSAFE.getInt(null, struct + FT_Size_Request.VERTRESOLUTION); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + FT_Size_Request.TYPE, value); } + /** Unsafe version of {@link #width(long) width}. */ + public static void nwidth(long struct, long value) { memPutCLong(struct + FT_Size_Request.WIDTH, value); } + /** Unsafe version of {@link #height(long) height}. */ + public static void nheight(long struct, long value) { memPutCLong(struct + FT_Size_Request.HEIGHT, value); } + /** Unsafe version of {@link #horiResolution(int) horiResolution}. */ + public static void nhoriResolution(long struct, int value) { UNSAFE.putInt(null, struct + FT_Size_Request.HORIRESOLUTION, value); } + /** Unsafe version of {@link #vertResolution(int) vertResolution}. */ + public static void nvertResolution(long struct, int value) { UNSAFE.putInt(null, struct + FT_Size_Request.VERTRESOLUTION, value); } + + // ----------------------------------- + + /** An array of {@link FT_Size_Request} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Size_Request ELEMENT_FACTORY = FT_Size_Request.create(-1L); + + /** + * Creates a new {@code FT_Size_Request.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 {@link FT_Size_Request#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Size_Request getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code type} field. */ + @NativeType("FT_Size_Request_Type") + public int type() { return FT_Size_Request.ntype(address()); } + /** @return the value of the {@code width} field. */ + @NativeType("FT_Long") + public long width() { return FT_Size_Request.nwidth(address()); } + /** @return the value of the {@code height} field. */ + @NativeType("FT_Long") + public long height() { return FT_Size_Request.nheight(address()); } + /** @return the value of the {@code horiResolution} field. */ + @NativeType("FT_UInt") + public int horiResolution() { return FT_Size_Request.nhoriResolution(address()); } + /** @return the value of the {@code vertResolution} field. */ + @NativeType("FT_UInt") + public int vertResolution() { return FT_Size_Request.nvertResolution(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(@NativeType("FT_Size_Request_Type") int value) { FT_Size_Request.ntype(address(), value); return this; } + /** Sets the specified value to the {@code width} field. */ + public Buffer width(@NativeType("FT_Long") long value) { FT_Size_Request.nwidth(address(), value); return this; } + /** Sets the specified value to the {@code height} field. */ + public Buffer height(@NativeType("FT_Long") long value) { FT_Size_Request.nheight(address(), value); return this; } + /** Sets the specified value to the {@code horiResolution} field. */ + public Buffer horiResolution(@NativeType("FT_UInt") int value) { FT_Size_Request.nhoriResolution(address(), value); return this; } + /** Sets the specified value to the {@code vertResolution} field. */ + public Buffer vertResolution(@NativeType("FT_UInt") int value) { FT_Size_Request.nvertResolution(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Span.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Span.java new file mode 100644 index 00000000..625e57e8 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Span.java @@ -0,0 +1,175 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure to model a single span of consecutive pixels when rendering an anti-aliased bitmap. + * + *

Layout

+ * + *

+ * struct FT_Span {
+ *     short x;
+ *     unsigned short len;
+ *     unsigned char coverage;
+ * }
+ */ +public class FT_Span extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + X, + LEN, + COVERAGE; + + static { + Layout layout = __struct( + __member(2), + __member(2), + __member(1) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + X = layout.offsetof(0); + LEN = layout.offsetof(1); + COVERAGE = layout.offsetof(2); + } + + protected FT_Span(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Span create(long address, @Nullable ByteBuffer container) { + return new FT_Span(address, container); + } + + /** + * Creates a {@code FT_Span} instance at the current position of the specified {@link 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 FT_Span(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code x} field. */ + public short x() { return nx(address()); } + /** @return the value of the {@code len} field. */ + @NativeType("unsigned short") + public short len() { return nlen(address()); } + /** @return the value of the {@code coverage} field. */ + @NativeType("unsigned char") + public byte coverage() { return ncoverage(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Span} instance for the specified memory address. */ + public static FT_Span create(long address) { + return new FT_Span(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Span createSafe(long address) { + return address == NULL ? null : new FT_Span(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #x}. */ + public static short nx(long struct) { return UNSAFE.getShort(null, struct + FT_Span.X); } + /** Unsafe version of {@link #len}. */ + public static short nlen(long struct) { return UNSAFE.getShort(null, struct + FT_Span.LEN); } + /** Unsafe version of {@link #coverage}. */ + public static byte ncoverage(long struct) { return UNSAFE.getByte(null, struct + FT_Span.COVERAGE); } + + // ----------------------------------- + + /** An array of {@link FT_Span} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_Span ELEMENT_FACTORY = FT_Span.create(-1L); + + /** + * Creates a new {@code FT_Span.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 {@link FT_Span#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Span getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code x} field. */ + public short x() { return FT_Span.nx(address()); } + /** @return the value of the {@code len} field. */ + @NativeType("unsigned short") + public short len() { return FT_Span.nlen(address()); } + /** @return the value of the {@code coverage} field. */ + @NativeType("unsigned char") + public byte coverage() { return FT_Span.ncoverage(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SpanFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SpanFunc.java new file mode 100644 index 00000000..708a1dea --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SpanFunc.java @@ -0,0 +1,76 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     int y,
+ *     int count,
+ *     FT_Span const *spans,
+ *     void *user
+ * )
+ */ +public abstract class FT_SpanFunc extends Callback implements FT_SpanFuncI { + + /** + * Creates a {@code FT_SpanFunc} instance from the specified function pointer. + * + * @return the new {@code FT_SpanFunc} + */ + public static FT_SpanFunc create(long functionPointer) { + FT_SpanFuncI instance = Callback.get(functionPointer); + return instance instanceof FT_SpanFunc + ? (FT_SpanFunc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_SpanFunc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_SpanFunc} instance that delegates to the specified {@code FT_SpanFuncI} instance. */ + public static FT_SpanFunc create(FT_SpanFuncI instance) { + return instance instanceof FT_SpanFunc + ? (FT_SpanFunc)instance + : new Container(instance.address(), instance); + } + + protected FT_SpanFunc() { + super(CIF); + } + + FT_SpanFunc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_SpanFunc { + + private final FT_SpanFuncI delegate; + + Container(long functionPointer, FT_SpanFuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(int y, int count, long spans, long user) { + delegate.invoke(y, count, spans, user); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SpanFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SpanFuncI.java new file mode 100644 index 00000000..37a84bf6 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SpanFuncI.java @@ -0,0 +1,52 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     int y,
+ *     int count,
+ *     FT_Span const *spans,
+ *     void *user
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_SpanFunc") +public interface FT_SpanFuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_void, + ffi_type_sint32, ffi_type_sint32, ffi_type_pointer, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + invoke( + memGetInt(memGetAddress(args)), + memGetInt(memGetAddress(args + POINTER_SIZE)), + memGetAddress(memGetAddress(args + 2 * POINTER_SIZE)), + memGetAddress(memGetAddress(args + 3 * POINTER_SIZE)) + ); + } + + /** A function used as a call-back by the anti-aliased renderer in order to let client applications draw themselves the pixel spans on each scan line. */ + void invoke(int y, int count, @NativeType("FT_Span const *") long spans, @NativeType("void *") long user); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream.java new file mode 100644 index 00000000..3ca7208b --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream.java @@ -0,0 +1,412 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A structure used to describe an input stream. + * + *

Layout

+ * + *

+ * struct FT_StreamRec {
+ *     unsigned char * base;
+ *     unsigned long size;
+ *     unsigned long pos;
+ *     {@link FT_StreamDesc FT_StreamDesc} descriptor;
+ *     {@link FT_StreamDesc FT_StreamDesc} pathname;
+ *     {@link FT_Stream_IoFuncI FT_Stream_IoFunc} read;
+ *     {@link FT_Stream_CloseFuncI FT_Stream_CloseFunc} close;
+ *     FT_Memory memory;
+ *     unsigned char * cursor;
+ *     unsigned char * limit;
+ * }
+ */ +@NativeType("struct FT_StreamRec") +public class FT_Stream extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + BASE, + SIZE, + POS, + DESCRIPTOR, + PATHNAME, + READ, + CLOSE, + MEMORY, + CURSOR, + LIMIT; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(FT_StreamDesc.SIZEOF, FT_StreamDesc.ALIGNOF), + __member(FT_StreamDesc.SIZEOF, FT_StreamDesc.ALIGNOF), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + BASE = layout.offsetof(0); + SIZE = layout.offsetof(1); + POS = layout.offsetof(2); + DESCRIPTOR = layout.offsetof(3); + PATHNAME = layout.offsetof(4); + READ = layout.offsetof(5); + CLOSE = layout.offsetof(6); + MEMORY = layout.offsetof(7); + CURSOR = layout.offsetof(8); + LIMIT = layout.offsetof(9); + } + + protected FT_Stream(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Stream create(long address, @Nullable ByteBuffer container) { + return new FT_Stream(address, container); + } + + /** + * Creates a {@code FT_Stream} instance at the current position of the specified {@link 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 FT_Stream(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code base} field. */ + @Nullable + @NativeType("unsigned char *") + public ByteBuffer base() { return nbase(address()); } + /** @return the value of the {@code size} field. */ + @NativeType("unsigned long") + public long size() { return nsize(address()); } + /** @return the value of the {@code pos} field. */ + @NativeType("unsigned long") + public long pos() { return npos(address()); } + /** @return a {@link FT_StreamDesc} view of the {@code descriptor} field. */ + public FT_StreamDesc descriptor() { return ndescriptor(address()); } + /** @return a {@link FT_StreamDesc} view of the {@code pathname} field. */ + public FT_StreamDesc pathname() { return npathname(address()); } + /** @return the value of the {@code read} field. */ + @Nullable + public FT_Stream_IoFunc read() { return nread(address()); } + /** @return the value of the {@code close} field. */ + @Nullable + public FT_Stream_CloseFunc close$() { return nclose$(address()); } + + /** Sets the address of the specified {@link ByteBuffer} to the {@code base} field. */ + public FT_Stream base(@Nullable @NativeType("unsigned char *") ByteBuffer value) { nbase(address(), value); return this; } + /** Sets the specified value to the {@code size} field. */ + public FT_Stream size(@NativeType("unsigned long") long value) { nsize(address(), value); return this; } + /** Sets the specified value to the {@code pos} field. */ + public FT_Stream pos(@NativeType("unsigned long") long value) { npos(address(), value); return this; } + /** Copies the specified {@link FT_StreamDesc} to the {@code descriptor} field. */ + public FT_Stream descriptor(FT_StreamDesc value) { ndescriptor(address(), value); return this; } + /** Passes the {@code descriptor} field to the specified {@link java.util.function.Consumer Consumer}. */ + public FT_Stream descriptor(java.util.function.Consumer consumer) { consumer.accept(descriptor()); return this; } + /** Copies the specified {@link FT_StreamDesc} to the {@code pathname} field. */ + public FT_Stream pathname(FT_StreamDesc value) { npathname(address(), value); return this; } + /** Passes the {@code pathname} field to the specified {@link java.util.function.Consumer Consumer}. */ + public FT_Stream pathname(java.util.function.Consumer consumer) { consumer.accept(pathname()); return this; } + /** Sets the specified value to the {@code read} field. */ + public FT_Stream read(@Nullable @NativeType("FT_Stream_IoFunc") FT_Stream_IoFuncI value) { nread(address(), value); return this; } + /** Sets the specified value to the {@code close} field. */ + public FT_Stream close$(@Nullable @NativeType("FT_Stream_CloseFunc") FT_Stream_CloseFuncI value) { nclose$(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_Stream set( + @Nullable ByteBuffer base, + long size, + long pos, + FT_StreamDesc descriptor, + FT_StreamDesc pathname, + @Nullable FT_Stream_IoFuncI read, + @Nullable FT_Stream_CloseFuncI close$ + ) { + base(base); + size(size); + pos(pos); + descriptor(descriptor); + pathname(pathname); + read(read); + close$(close$); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Stream set(FT_Stream src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Stream} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Stream malloc() { + return new FT_Stream(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Stream} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Stream calloc() { + return new FT_Stream(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Stream} instance allocated with {@link BufferUtils}. */ + public static FT_Stream create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Stream(memAddress(container), container); + } + + /** Returns a new {@code FT_Stream} instance for the specified memory address. */ + public static FT_Stream create(long address) { + return new FT_Stream(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Stream createSafe(long address) { + return address == NULL ? null : new FT_Stream(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Stream} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Stream malloc(MemoryStack stack) { + return new FT_Stream(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Stream} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Stream calloc(MemoryStack stack) { + return new FT_Stream(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #base() base}. */ + @Nullable public static ByteBuffer nbase(long struct) { return memByteBufferSafe(memGetAddress(struct + FT_Stream.BASE), (int)nsize(struct)); } + /** Unsafe version of {@link #size}. */ + public static long nsize(long struct) { return memGetCLong(struct + FT_Stream.SIZE); } + /** Unsafe version of {@link #pos}. */ + public static long npos(long struct) { return memGetCLong(struct + FT_Stream.POS); } + /** Unsafe version of {@link #descriptor}. */ + public static FT_StreamDesc ndescriptor(long struct) { return FT_StreamDesc.create(struct + FT_Stream.DESCRIPTOR); } + /** Unsafe version of {@link #pathname}. */ + public static FT_StreamDesc npathname(long struct) { return FT_StreamDesc.create(struct + FT_Stream.PATHNAME); } + /** Unsafe version of {@link #read}. */ + @Nullable public static FT_Stream_IoFunc nread(long struct) { return FT_Stream_IoFunc.createSafe(memGetAddress(struct + FT_Stream.READ)); } + /** Unsafe version of {@link #close$}. */ + @Nullable public static FT_Stream_CloseFunc nclose$(long struct) { return FT_Stream_CloseFunc.createSafe(memGetAddress(struct + FT_Stream.CLOSE)); } + @Nullable public static FT_Memory nmemory(long struct) { return FT_Memory.createSafe(memGetAddress(struct + FT_Stream.MEMORY)); } + @Nullable public static ByteBuffer ncursor(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + FT_Stream.CURSOR), capacity); } + @Nullable public static ByteBuffer nlimit$(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + FT_Stream.LIMIT), capacity); } + + /** Unsafe version of {@link #base(ByteBuffer) base}. */ + public static void nbase(long struct, @Nullable ByteBuffer value) { memPutAddress(struct + FT_Stream.BASE, memAddressSafe(value)); nsize(struct, value == null ? 0 : value.remaining()); } + /** Sets the specified value to the {@code size} field of the specified {@code struct}. */ + public static void nsize(long struct, long value) { memPutCLong(struct + FT_Stream.SIZE, value); } + /** Unsafe version of {@link #pos(long) pos}. */ + public static void npos(long struct, long value) { memPutCLong(struct + FT_Stream.POS, value); } + /** Unsafe version of {@link #descriptor(FT_StreamDesc) descriptor}. */ + public static void ndescriptor(long struct, FT_StreamDesc value) { memCopy(value.address(), struct + FT_Stream.DESCRIPTOR, FT_StreamDesc.SIZEOF); } + /** Unsafe version of {@link #pathname(FT_StreamDesc) pathname}. */ + public static void npathname(long struct, FT_StreamDesc value) { memCopy(value.address(), struct + FT_Stream.PATHNAME, FT_StreamDesc.SIZEOF); } + /** Unsafe version of {@link #read(FT_Stream_IoFuncI) read}. */ + public static void nread(long struct, @Nullable FT_Stream_IoFuncI value) { memPutAddress(struct + FT_Stream.READ, memAddressSafe(value)); } + /** Unsafe version of {@link #close$(FT_Stream_CloseFuncI) close$}. */ + public static void nclose$(long struct, @Nullable FT_Stream_CloseFuncI value) { memPutAddress(struct + FT_Stream.CLOSE, memAddressSafe(value)); } + public static void nmemory(long struct, @Nullable FT_Memory value) { memPutAddress(struct + FT_Stream.MEMORY, memAddressSafe(value)); } + public static void ncursor(long struct, @Nullable ByteBuffer value) { memPutAddress(struct + FT_Stream.CURSOR, memAddressSafe(value)); } + public static void nlimit$(long struct, @Nullable ByteBuffer value) { memPutAddress(struct + FT_Stream.LIMIT, memAddressSafe(value)); } + + // ----------------------------------- + + /** An array of {@link FT_Stream} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Stream ELEMENT_FACTORY = FT_Stream.create(-1L); + + /** + * Creates a new {@code FT_Stream.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 {@link FT_Stream#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Stream getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code base} field. */ + @Nullable + @NativeType("unsigned char *") + public ByteBuffer base() { return FT_Stream.nbase(address()); } + /** @return the value of the {@code size} field. */ + @NativeType("unsigned long") + public long size() { return FT_Stream.nsize(address()); } + /** @return the value of the {@code pos} field. */ + @NativeType("unsigned long") + public long pos() { return FT_Stream.npos(address()); } + /** @return a {@link FT_StreamDesc} view of the {@code descriptor} field. */ + public FT_StreamDesc descriptor() { return FT_Stream.ndescriptor(address()); } + /** @return a {@link FT_StreamDesc} view of the {@code pathname} field. */ + public FT_StreamDesc pathname() { return FT_Stream.npathname(address()); } + /** @return the value of the {@code read} field. */ + @Nullable + public FT_Stream_IoFunc read() { return FT_Stream.nread(address()); } + /** @return the value of the {@code close} field. */ + @Nullable + public FT_Stream_CloseFunc close$() { return FT_Stream.nclose$(address()); } + + /** Sets the address of the specified {@link ByteBuffer} to the {@code base} field. */ + public Buffer base(@Nullable @NativeType("unsigned char *") ByteBuffer value) { FT_Stream.nbase(address(), value); return this; } + /** Sets the specified value to the {@code size} field. */ + public Buffer size(@NativeType("unsigned long") long value) { FT_Stream.nsize(address(), value); return this; } + /** Sets the specified value to the {@code pos} field. */ + public Buffer pos(@NativeType("unsigned long") long value) { FT_Stream.npos(address(), value); return this; } + /** Copies the specified {@link FT_StreamDesc} to the {@code descriptor} field. */ + public Buffer descriptor(FT_StreamDesc value) { FT_Stream.ndescriptor(address(), value); return this; } + /** Passes the {@code descriptor} field to the specified {@link java.util.function.Consumer Consumer}. */ + public Buffer descriptor(java.util.function.Consumer consumer) { consumer.accept(descriptor()); return this; } + /** Copies the specified {@link FT_StreamDesc} to the {@code pathname} field. */ + public Buffer pathname(FT_StreamDesc value) { FT_Stream.npathname(address(), value); return this; } + /** Passes the {@code pathname} field to the specified {@link java.util.function.Consumer Consumer}. */ + public Buffer pathname(java.util.function.Consumer consumer) { consumer.accept(pathname()); return this; } + /** Sets the specified value to the {@code read} field. */ + public Buffer read(@Nullable @NativeType("FT_Stream_IoFunc") FT_Stream_IoFuncI value) { FT_Stream.nread(address(), value); return this; } + /** Sets the specified value to the {@code close} field. */ + public Buffer close$(@Nullable @NativeType("FT_Stream_CloseFunc") FT_Stream_CloseFuncI value) { FT_Stream.nclose$(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_StreamDesc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_StreamDesc.java new file mode 100644 index 00000000..8065aa54 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_StreamDesc.java @@ -0,0 +1,274 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A union type used to store either a long or a pointer. This is used to store a file descriptor or a {@code FILE*} in an input stream. + * + *

Layout

+ * + *

+ * union FT_StreamDesc {
+ *     long value;
+ *     void * pointer;
+ * }
+ */ +public class FT_StreamDesc extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + VALUE, + POINTER; + + static { + Layout layout = __union( + __member(CLONG_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + VALUE = layout.offsetof(0); + POINTER = layout.offsetof(1); + } + + protected FT_StreamDesc(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_StreamDesc create(long address, @Nullable ByteBuffer container) { + return new FT_StreamDesc(address, container); + } + + /** + * Creates a {@code FT_StreamDesc} instance at the current position of the specified {@link 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 FT_StreamDesc(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code value} field. */ + public long value() { return nvalue(address()); } + /** @return the value of the {@code pointer} field. */ + @NativeType("void *") + public long pointer() { return npointer(address()); } + + /** Sets the specified value to the {@code value} field. */ + public FT_StreamDesc value(long value) { nvalue(address(), value); return this; } + /** Sets the specified value to the {@code pointer} field. */ + public FT_StreamDesc pointer(@NativeType("void *") long value) { npointer(address(), value); return this; } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_StreamDesc set(FT_StreamDesc src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_StreamDesc} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_StreamDesc malloc() { + return new FT_StreamDesc(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_StreamDesc} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_StreamDesc calloc() { + return new FT_StreamDesc(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_StreamDesc} instance allocated with {@link BufferUtils}. */ + public static FT_StreamDesc create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_StreamDesc(memAddress(container), container); + } + + /** Returns a new {@code FT_StreamDesc} instance for the specified memory address. */ + public static FT_StreamDesc create(long address) { + return new FT_StreamDesc(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_StreamDesc createSafe(long address) { + return address == NULL ? null : new FT_StreamDesc(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_StreamDesc} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_StreamDesc malloc(MemoryStack stack) { + return new FT_StreamDesc(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_StreamDesc} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_StreamDesc calloc(MemoryStack stack) { + return new FT_StreamDesc(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #value}. */ + public static long nvalue(long struct) { return memGetCLong(struct + FT_StreamDesc.VALUE); } + /** Unsafe version of {@link #pointer}. */ + public static long npointer(long struct) { return memGetAddress(struct + FT_StreamDesc.POINTER); } + + /** Unsafe version of {@link #value(long) value}. */ + public static void nvalue(long struct, long value) { memPutCLong(struct + FT_StreamDesc.VALUE, value); } + /** Unsafe version of {@link #pointer(long) pointer}. */ + public static void npointer(long struct, long value) { memPutAddress(struct + FT_StreamDesc.POINTER, value); } + + // ----------------------------------- + + /** An array of {@link FT_StreamDesc} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_StreamDesc ELEMENT_FACTORY = FT_StreamDesc.create(-1L); + + /** + * Creates a new {@code FT_StreamDesc.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 {@link FT_StreamDesc#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_StreamDesc getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code value} field. */ + public long value() { return FT_StreamDesc.nvalue(address()); } + /** @return the value of the {@code pointer} field. */ + @NativeType("void *") + public long pointer() { return FT_StreamDesc.npointer(address()); } + + /** Sets the specified value to the {@code value} field. */ + public Buffer value(long value) { FT_StreamDesc.nvalue(address(), value); return this; } + /** Sets the specified value to the {@code pointer} field. */ + public Buffer pointer(@NativeType("void *") long value) { FT_StreamDesc.npointer(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_CloseFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_CloseFunc.java new file mode 100644 index 00000000..d683aac6 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_CloseFunc.java @@ -0,0 +1,73 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     FT_Stream stream
+ * )
+ */ +public abstract class FT_Stream_CloseFunc extends Callback implements FT_Stream_CloseFuncI { + + /** + * Creates a {@code FT_Stream_CloseFunc} instance from the specified function pointer. + * + * @return the new {@code FT_Stream_CloseFunc} + */ + public static FT_Stream_CloseFunc create(long functionPointer) { + FT_Stream_CloseFuncI instance = Callback.get(functionPointer); + return instance instanceof FT_Stream_CloseFunc + ? (FT_Stream_CloseFunc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Stream_CloseFunc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Stream_CloseFunc} instance that delegates to the specified {@code FT_Stream_CloseFuncI} instance. */ + public static FT_Stream_CloseFunc create(FT_Stream_CloseFuncI instance) { + return instance instanceof FT_Stream_CloseFunc + ? (FT_Stream_CloseFunc)instance + : new Container(instance.address(), instance); + } + + protected FT_Stream_CloseFunc() { + super(CIF); + } + + FT_Stream_CloseFunc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Stream_CloseFunc { + + private final FT_Stream_CloseFuncI delegate; + + Container(long functionPointer, FT_Stream_CloseFuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long stream) { + delegate.invoke(stream); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_CloseFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_CloseFuncI.java new file mode 100644 index 00000000..3f23c139 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_CloseFuncI.java @@ -0,0 +1,45 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     FT_Stream stream
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Stream_CloseFunc") +public interface FT_Stream_CloseFuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_void, + ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + invoke( + memGetAddress(memGetAddress(args)) + ); + } + + void invoke(@NativeType("FT_Stream") long stream); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_IoFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_IoFunc.java new file mode 100644 index 00000000..47155dac --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_IoFunc.java @@ -0,0 +1,76 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * unsigned long (*{@link #invoke}) (
+ *     FT_Stream stream,
+ *     unsigned long offset,
+ *     unsigned char *buffer,
+ *     unsigned long count
+ * )
+ */ +public abstract class FT_Stream_IoFunc extends Callback implements FT_Stream_IoFuncI { + + /** + * Creates a {@code FT_Stream_IoFunc} instance from the specified function pointer. + * + * @return the new {@code FT_Stream_IoFunc} + */ + public static FT_Stream_IoFunc create(long functionPointer) { + FT_Stream_IoFuncI instance = Callback.get(functionPointer); + return instance instanceof FT_Stream_IoFunc + ? (FT_Stream_IoFunc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static FT_Stream_IoFunc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code FT_Stream_IoFunc} instance that delegates to the specified {@code FT_Stream_IoFuncI} instance. */ + public static FT_Stream_IoFunc create(FT_Stream_IoFuncI instance) { + return instance instanceof FT_Stream_IoFunc + ? (FT_Stream_IoFunc)instance + : new Container(instance.address(), instance); + } + + protected FT_Stream_IoFunc() { + super(CIF); + } + + FT_Stream_IoFunc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends FT_Stream_IoFunc { + + private final FT_Stream_IoFuncI delegate; + + Container(long functionPointer, FT_Stream_IoFuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public long invoke(long stream, long offset, long buffer, long count) { + return delegate.invoke(stream, offset, buffer, count); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_IoFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_IoFuncI.java new file mode 100644 index 00000000..0a57b71c --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_IoFuncI.java @@ -0,0 +1,53 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * unsigned long (*{@link #invoke}) (
+ *     FT_Stream stream,
+ *     unsigned long offset,
+ *     unsigned char *buffer,
+ *     unsigned long count
+ * )
+ */ +@FunctionalInterface +@NativeType("FT_Stream_IoFunc") +public interface FT_Stream_IoFuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_ulong, + ffi_type_pointer, ffi_type_ulong, ffi_type_pointer, ffi_type_ulong + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + long __result = invoke( + memGetAddress(memGetAddress(args)), + memGetCLong(memGetAddress(args + POINTER_SIZE)), + memGetAddress(memGetAddress(args + 2 * POINTER_SIZE)), + memGetCLong(memGetAddress(args + 3 * POINTER_SIZE)) + ); + apiClosureRet(ret, __result); + } + + /** A function used to seek and read data from a given input stream. */ + @NativeType("unsigned long") long invoke(@NativeType("FT_Stream") long stream, @NativeType("unsigned long") long offset, @NativeType("unsigned char *") long buffer, @NativeType("unsigned long") long count); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SvgGlyph.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SvgGlyph.java new file mode 100644 index 00000000..4193955e --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SvgGlyph.java @@ -0,0 +1,256 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure used for OT-SVG glyphs. This is a 'sub-class' of {@link FT_Glyph}. + * + *

Layout

+ * + *

+ * struct FT_SvgGlyphRec {
+ *     {@link FT_Glyph FT_GlyphRec} root;
+ *     FT_Byte * svg_document;
+ *     FT_ULong svg_document_length;
+ *     FT_UInt glyph_index;
+ *     {@link FT_Size_Metrics FT_Size_Metrics} metrics;
+ *     FT_UShort units_per_EM;
+ *     FT_UShort start_glyph_id;
+ *     FT_UShort end_glyph_id;
+ *     {@link FT_Matrix FT_Matrix} transform;
+ *     {@link FT_Vector FT_Vector} delta;
+ * }
+ */ +@NativeType("struct FT_SvgGlyphRec") +public class FT_SvgGlyph extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + ROOT, + SVG_DOCUMENT, + SVG_DOCUMENT_LENGTH, + GLYPH_INDEX, + METRICS, + UNITS_PER_EM, + START_GLYPH_ID, + END_GLYPH_ID, + TRANSFORM, + DELTA; + + static { + Layout layout = __struct( + __member(FT_Glyph.SIZEOF, FT_Glyph.ALIGNOF), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(FT_Size_Metrics.SIZEOF, FT_Size_Metrics.ALIGNOF), + __member(2), + __member(2), + __member(2), + __member(FT_Matrix.SIZEOF, FT_Matrix.ALIGNOF), + __member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + ROOT = layout.offsetof(0); + SVG_DOCUMENT = layout.offsetof(1); + SVG_DOCUMENT_LENGTH = layout.offsetof(2); + GLYPH_INDEX = layout.offsetof(3); + METRICS = layout.offsetof(4); + UNITS_PER_EM = layout.offsetof(5); + START_GLYPH_ID = layout.offsetof(6); + END_GLYPH_ID = layout.offsetof(7); + TRANSFORM = layout.offsetof(8); + DELTA = layout.offsetof(9); + } + + protected FT_SvgGlyph(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_SvgGlyph create(long address, @Nullable ByteBuffer container) { + return new FT_SvgGlyph(address, container); + } + + /** + * Creates a {@code FT_SvgGlyph} instance at the current position of the specified {@link 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 FT_SvgGlyph(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_Glyph} view of the {@code root} field. */ + @NativeType("FT_GlyphRec") + public FT_Glyph root() { return nroot(address()); } + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code svg_document} field. */ + @NativeType("FT_Byte *") + public ByteBuffer svg_document() { return nsvg_document(address()); } + /** @return the value of the {@code svg_document_length} field. */ + @NativeType("FT_ULong") + public long svg_document_length() { return nsvg_document_length(address()); } + /** @return the value of the {@code glyph_index} field. */ + @NativeType("FT_UInt") + public int glyph_index() { return nglyph_index(address()); } + /** @return a {@link FT_Size_Metrics} view of the {@code metrics} field. */ + public FT_Size_Metrics metrics() { return nmetrics(address()); } + /** @return the value of the {@code units_per_EM} field. */ + @NativeType("FT_UShort") + public short units_per_EM() { return nunits_per_EM(address()); } + /** @return the value of the {@code start_glyph_id} field. */ + @NativeType("FT_UShort") + public short start_glyph_id() { return nstart_glyph_id(address()); } + /** @return the value of the {@code end_glyph_id} field. */ + @NativeType("FT_UShort") + public short end_glyph_id() { return nend_glyph_id(address()); } + /** @return a {@link FT_Matrix} view of the {@code transform} field. */ + public FT_Matrix transform() { return ntransform(address()); } + /** @return a {@link FT_Vector} view of the {@code delta} field. */ + public FT_Vector delta() { return ndelta(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_SvgGlyph} instance for the specified memory address. */ + public static FT_SvgGlyph create(long address) { + return new FT_SvgGlyph(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_SvgGlyph createSafe(long address) { + return address == NULL ? null : new FT_SvgGlyph(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #root}. */ + public static FT_Glyph nroot(long struct) { return FT_Glyph.create(struct + FT_SvgGlyph.ROOT); } + /** Unsafe version of {@link #svg_document() svg_document}. */ + public static ByteBuffer nsvg_document(long struct) { return memByteBuffer(memGetAddress(struct + FT_SvgGlyph.SVG_DOCUMENT), (int)nsvg_document_length(struct)); } + /** Unsafe version of {@link #svg_document_length}. */ + public static long nsvg_document_length(long struct) { return memGetCLong(struct + FT_SvgGlyph.SVG_DOCUMENT_LENGTH); } + /** Unsafe version of {@link #glyph_index}. */ + public static int nglyph_index(long struct) { return UNSAFE.getInt(null, struct + FT_SvgGlyph.GLYPH_INDEX); } + /** Unsafe version of {@link #metrics}. */ + public static FT_Size_Metrics nmetrics(long struct) { return FT_Size_Metrics.create(struct + FT_SvgGlyph.METRICS); } + /** Unsafe version of {@link #units_per_EM}. */ + public static short nunits_per_EM(long struct) { return UNSAFE.getShort(null, struct + FT_SvgGlyph.UNITS_PER_EM); } + /** Unsafe version of {@link #start_glyph_id}. */ + public static short nstart_glyph_id(long struct) { return UNSAFE.getShort(null, struct + FT_SvgGlyph.START_GLYPH_ID); } + /** Unsafe version of {@link #end_glyph_id}. */ + public static short nend_glyph_id(long struct) { return UNSAFE.getShort(null, struct + FT_SvgGlyph.END_GLYPH_ID); } + /** Unsafe version of {@link #transform}. */ + public static FT_Matrix ntransform(long struct) { return FT_Matrix.create(struct + FT_SvgGlyph.TRANSFORM); } + /** Unsafe version of {@link #delta}. */ + public static FT_Vector ndelta(long struct) { return FT_Vector.create(struct + FT_SvgGlyph.DELTA); } + + // ----------------------------------- + + /** An array of {@link FT_SvgGlyph} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_SvgGlyph ELEMENT_FACTORY = FT_SvgGlyph.create(-1L); + + /** + * Creates a new {@code FT_SvgGlyph.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 {@link FT_SvgGlyph#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_SvgGlyph getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_Glyph} view of the {@code root} field. */ + @NativeType("FT_GlyphRec") + public FT_Glyph root() { return FT_SvgGlyph.nroot(address()); } + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code svg_document} field. */ + @NativeType("FT_Byte *") + public ByteBuffer svg_document() { return FT_SvgGlyph.nsvg_document(address()); } + /** @return the value of the {@code svg_document_length} field. */ + @NativeType("FT_ULong") + public long svg_document_length() { return FT_SvgGlyph.nsvg_document_length(address()); } + /** @return the value of the {@code glyph_index} field. */ + @NativeType("FT_UInt") + public int glyph_index() { return FT_SvgGlyph.nglyph_index(address()); } + /** @return a {@link FT_Size_Metrics} view of the {@code metrics} field. */ + public FT_Size_Metrics metrics() { return FT_SvgGlyph.nmetrics(address()); } + /** @return the value of the {@code units_per_EM} field. */ + @NativeType("FT_UShort") + public short units_per_EM() { return FT_SvgGlyph.nunits_per_EM(address()); } + /** @return the value of the {@code start_glyph_id} field. */ + @NativeType("FT_UShort") + public short start_glyph_id() { return FT_SvgGlyph.nstart_glyph_id(address()); } + /** @return the value of the {@code end_glyph_id} field. */ + @NativeType("FT_UShort") + public short end_glyph_id() { return FT_SvgGlyph.nend_glyph_id(address()); } + /** @return a {@link FT_Matrix} view of the {@code transform} field. */ + public FT_Matrix transform() { return FT_SvgGlyph.ntransform(address()); } + /** @return a {@link FT_Vector} view of the {@code delta} field. */ + public FT_Vector delta() { return FT_SvgGlyph.ndelta(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_UnitVector.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_UnitVector.java new file mode 100644 index 00000000..b1496741 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_UnitVector.java @@ -0,0 +1,287 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A simple structure used to store a 2D vector unit vector. Uses {@code FT_F2Dot14} types. + * + *

Layout

+ * + *

+ * struct FT_UnitVector {
+ *     FT_F2Dot14 x;
+ *     FT_F2Dot14 y;
+ * }
+ */ +public class FT_UnitVector extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + X, + Y; + + static { + Layout layout = __struct( + __member(2), + __member(2) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + X = layout.offsetof(0); + Y = layout.offsetof(1); + } + + protected FT_UnitVector(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_UnitVector create(long address, @Nullable ByteBuffer container) { + return new FT_UnitVector(address, container); + } + + /** + * Creates a {@code FT_UnitVector} instance at the current position of the specified {@link 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 FT_UnitVector(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code x} field. */ + @NativeType("FT_F2Dot14") + public short x() { return nx(address()); } + /** @return the value of the {@code y} field. */ + @NativeType("FT_F2Dot14") + public short y() { return ny(address()); } + + /** Sets the specified value to the {@code x} field. */ + public FT_UnitVector x(@NativeType("FT_F2Dot14") short value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public FT_UnitVector y(@NativeType("FT_F2Dot14") short value) { ny(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_UnitVector set( + short x, + short y + ) { + x(x); + y(y); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_UnitVector set(FT_UnitVector src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_UnitVector} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_UnitVector malloc() { + return new FT_UnitVector(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_UnitVector} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_UnitVector calloc() { + return new FT_UnitVector(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_UnitVector} instance allocated with {@link BufferUtils}. */ + public static FT_UnitVector create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_UnitVector(memAddress(container), container); + } + + /** Returns a new {@code FT_UnitVector} instance for the specified memory address. */ + public static FT_UnitVector create(long address) { + return new FT_UnitVector(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_UnitVector createSafe(long address) { + return address == NULL ? null : new FT_UnitVector(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_UnitVector} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_UnitVector malloc(MemoryStack stack) { + return new FT_UnitVector(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_UnitVector} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_UnitVector calloc(MemoryStack stack) { + return new FT_UnitVector(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #x}. */ + public static short nx(long struct) { return UNSAFE.getShort(null, struct + FT_UnitVector.X); } + /** Unsafe version of {@link #y}. */ + public static short ny(long struct) { return UNSAFE.getShort(null, struct + FT_UnitVector.Y); } + + /** Unsafe version of {@link #x(short) x}. */ + public static void nx(long struct, short value) { UNSAFE.putShort(null, struct + FT_UnitVector.X, value); } + /** Unsafe version of {@link #y(short) y}. */ + public static void ny(long struct, short value) { UNSAFE.putShort(null, struct + FT_UnitVector.Y, value); } + + // ----------------------------------- + + /** An array of {@link FT_UnitVector} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_UnitVector ELEMENT_FACTORY = FT_UnitVector.create(-1L); + + /** + * Creates a new {@code FT_UnitVector.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 {@link FT_UnitVector#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_UnitVector getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code x} field. */ + @NativeType("FT_F2Dot14") + public short x() { return FT_UnitVector.nx(address()); } + /** @return the value of the {@code y} field. */ + @NativeType("FT_F2Dot14") + public short y() { return FT_UnitVector.ny(address()); } + + /** Sets the specified value to the {@code x} field. */ + public Buffer x(@NativeType("FT_F2Dot14") short value) { FT_UnitVector.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(@NativeType("FT_F2Dot14") short value) { FT_UnitVector.ny(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Var_Axis.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Var_Axis.java new file mode 100644 index 00000000..fcae9a71 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Var_Axis.java @@ -0,0 +1,221 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure to model a given axis in design space for Multiple Masters, TrueType GX, and OpenType variation fonts. + * + *

Layout

+ * + *

+ * struct FT_Var_Axis {
+ *     FT_String * name;
+ *     FT_Fixed minimum;
+ *     FT_Fixed def;
+ *     FT_Fixed maximum;
+ *     FT_ULong tag;
+ *     FT_UInt strid;
+ * }
+ */ +public class FT_Var_Axis extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + NAME, + MINIMUM, + DEF, + MAXIMUM, + TAG, + STRID; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + NAME = layout.offsetof(0); + MINIMUM = layout.offsetof(1); + DEF = layout.offsetof(2); + MAXIMUM = layout.offsetof(3); + TAG = layout.offsetof(4); + STRID = layout.offsetof(5); + } + + protected FT_Var_Axis(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Var_Axis create(long address, @Nullable ByteBuffer container) { + return new FT_Var_Axis(address, container); + } + + /** + * Creates a {@code FT_Var_Axis} instance at the current position of the specified {@link 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 FT_Var_Axis(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code name} field. */ + @NativeType("FT_String *") + public ByteBuffer name() { return nname(address()); } + /** @return the null-terminated string pointed to by the {@code name} field. */ + @NativeType("FT_String *") + public String nameString() { return nnameString(address()); } + /** @return the value of the {@code minimum} field. */ + @NativeType("FT_Fixed") + public long minimum() { return nminimum(address()); } + /** @return the value of the {@code def} field. */ + @NativeType("FT_Fixed") + public long def() { return ndef(address()); } + /** @return the value of the {@code maximum} field. */ + @NativeType("FT_Fixed") + public long maximum() { return nmaximum(address()); } + /** @return the value of the {@code tag} field. */ + @NativeType("FT_ULong") + public long tag() { return ntag(address()); } + /** @return the value of the {@code strid} field. */ + @NativeType("FT_UInt") + public int strid() { return nstrid(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Var_Axis} instance for the specified memory address. */ + public static FT_Var_Axis create(long address) { + return new FT_Var_Axis(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Var_Axis createSafe(long address) { + return address == NULL ? null : new FT_Var_Axis(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #name}. */ + public static ByteBuffer nname(long struct) { return memByteBufferNT1(memGetAddress(struct + FT_Var_Axis.NAME)); } + /** Unsafe version of {@link #nameString}. */ + public static String nnameString(long struct) { return memUTF8(memGetAddress(struct + FT_Var_Axis.NAME)); } + /** Unsafe version of {@link #minimum}. */ + public static long nminimum(long struct) { return memGetCLong(struct + FT_Var_Axis.MINIMUM); } + /** Unsafe version of {@link #def}. */ + public static long ndef(long struct) { return memGetCLong(struct + FT_Var_Axis.DEF); } + /** Unsafe version of {@link #maximum}. */ + public static long nmaximum(long struct) { return memGetCLong(struct + FT_Var_Axis.MAXIMUM); } + /** Unsafe version of {@link #tag}. */ + public static long ntag(long struct) { return memGetCLong(struct + FT_Var_Axis.TAG); } + /** Unsafe version of {@link #strid}. */ + public static int nstrid(long struct) { return UNSAFE.getInt(null, struct + FT_Var_Axis.STRID); } + + // ----------------------------------- + + /** An array of {@link FT_Var_Axis} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_Var_Axis ELEMENT_FACTORY = FT_Var_Axis.create(-1L); + + /** + * Creates a new {@code FT_Var_Axis.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 {@link FT_Var_Axis#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Var_Axis getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code name} field. */ + @NativeType("FT_String *") + public ByteBuffer name() { return FT_Var_Axis.nname(address()); } + /** @return the null-terminated string pointed to by the {@code name} field. */ + @NativeType("FT_String *") + public String nameString() { return FT_Var_Axis.nnameString(address()); } + /** @return the value of the {@code minimum} field. */ + @NativeType("FT_Fixed") + public long minimum() { return FT_Var_Axis.nminimum(address()); } + /** @return the value of the {@code def} field. */ + @NativeType("FT_Fixed") + public long def() { return FT_Var_Axis.ndef(address()); } + /** @return the value of the {@code maximum} field. */ + @NativeType("FT_Fixed") + public long maximum() { return FT_Var_Axis.nmaximum(address()); } + /** @return the value of the {@code tag} field. */ + @NativeType("FT_ULong") + public long tag() { return FT_Var_Axis.ntag(address()); } + /** @return the value of the {@code strid} field. */ + @NativeType("FT_UInt") + public int strid() { return FT_Var_Axis.nstrid(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Var_Named_Style.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Var_Named_Style.java new file mode 100644 index 00000000..9df3cd2f --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Var_Named_Style.java @@ -0,0 +1,186 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure to model a named instance in a TrueType GX or OpenType variation font. + * + *

Layout

+ * + *

+ * struct FT_Var_Named_Style {
+ *     FT_Fixed * coords;
+ *     FT_UInt strid;
+ *     FT_UInt psid;
+ * }
+ */ +public class FT_Var_Named_Style extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + COORDS, + STRID, + PSID; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + COORDS = layout.offsetof(0); + STRID = layout.offsetof(1); + PSID = layout.offsetof(2); + } + + protected FT_Var_Named_Style(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Var_Named_Style create(long address, @Nullable ByteBuffer container) { + return new FT_Var_Named_Style(address, container); + } + + /** + * Creates a {@code FT_Var_Named_Style} instance at the current position of the specified {@link 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 FT_Var_Named_Style(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** + * @return a {@link CLongBuffer} view of the data pointed to by the {@code coords} field. + * + * @param capacity the number of elements in the returned buffer + */ + @NativeType("FT_Fixed *") + public CLongBuffer coords(int capacity) { return ncoords(address(), capacity); } + /** @return the value of the {@code strid} field. */ + @NativeType("FT_UInt") + public int strid() { return nstrid(address()); } + /** @return the value of the {@code psid} field. */ + @NativeType("FT_UInt") + public int psid() { return npsid(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Var_Named_Style} instance for the specified memory address. */ + public static FT_Var_Named_Style create(long address) { + return new FT_Var_Named_Style(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Var_Named_Style createSafe(long address) { + return address == NULL ? null : new FT_Var_Named_Style(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #coords(int) coords}. */ + public static CLongBuffer ncoords(long struct, int capacity) { return memCLongBuffer(memGetAddress(struct + FT_Var_Named_Style.COORDS), capacity); } + /** Unsafe version of {@link #strid}. */ + public static int nstrid(long struct) { return UNSAFE.getInt(null, struct + FT_Var_Named_Style.STRID); } + /** Unsafe version of {@link #psid}. */ + public static int npsid(long struct) { return UNSAFE.getInt(null, struct + FT_Var_Named_Style.PSID); } + + // ----------------------------------- + + /** An array of {@link FT_Var_Named_Style} structs. */ + public static class Buffer extends StructBuffer { + + private static final FT_Var_Named_Style ELEMENT_FACTORY = FT_Var_Named_Style.create(-1L); + + /** + * Creates a new {@code FT_Var_Named_Style.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 {@link FT_Var_Named_Style#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Var_Named_Style getElementFactory() { + return ELEMENT_FACTORY; + } + + /** + * @return a {@link CLongBuffer} view of the data pointed to by the {@code coords} field. + * + * @param capacity the number of elements in the returned buffer + */ + @NativeType("FT_Fixed *") + public CLongBuffer coords(int capacity) { return FT_Var_Named_Style.ncoords(address(), capacity); } + /** @return the value of the {@code strid} field. */ + @NativeType("FT_UInt") + public int strid() { return FT_Var_Named_Style.nstrid(address()); } + /** @return the value of the {@code psid} field. */ + @NativeType("FT_UInt") + public int psid() { return FT_Var_Named_Style.npsid(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Vector.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Vector.java new file mode 100644 index 00000000..a54e26f6 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Vector.java @@ -0,0 +1,287 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A simple structure used to store a 2D vector; coordinates are of the {@code FT_Pos} type. + * + *

Layout

+ * + *

+ * struct FT_Vector {
+ *     FT_Pos x;
+ *     FT_Pos y;
+ * }
+ */ +public class FT_Vector extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + X, + Y; + + static { + Layout layout = __struct( + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + X = layout.offsetof(0); + Y = layout.offsetof(1); + } + + protected FT_Vector(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected FT_Vector create(long address, @Nullable ByteBuffer container) { + return new FT_Vector(address, container); + } + + /** + * Creates a {@code FT_Vector} instance at the current position of the specified {@link 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 FT_Vector(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code x} field. */ + @NativeType("FT_Pos") + public long x() { return nx(address()); } + /** @return the value of the {@code y} field. */ + @NativeType("FT_Pos") + public long y() { return ny(address()); } + + /** Sets the specified value to the {@code x} field. */ + public FT_Vector x(@NativeType("FT_Pos") long value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public FT_Vector y(@NativeType("FT_Pos") long value) { ny(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_Vector set( + long x, + long y + ) { + x(x); + y(y); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Vector set(FT_Vector src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Vector} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Vector malloc() { + return new FT_Vector(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Vector} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Vector calloc() { + return new FT_Vector(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Vector} instance allocated with {@link BufferUtils}. */ + public static FT_Vector create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Vector(memAddress(container), container); + } + + /** Returns a new {@code FT_Vector} instance for the specified memory address. */ + public static FT_Vector create(long address) { + return new FT_Vector(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Vector createSafe(long address) { + return address == NULL ? null : new FT_Vector(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code FT_Vector} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Vector malloc(MemoryStack stack) { + return new FT_Vector(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Vector} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static FT_Vector calloc(MemoryStack stack) { + return new FT_Vector(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #x}. */ + public static long nx(long struct) { return memGetCLong(struct + FT_Vector.X); } + /** Unsafe version of {@link #y}. */ + public static long ny(long struct) { return memGetCLong(struct + FT_Vector.Y); } + + /** Unsafe version of {@link #x(long) x}. */ + public static void nx(long struct, long value) { memPutCLong(struct + FT_Vector.X, value); } + /** Unsafe version of {@link #y(long) y}. */ + public static void ny(long struct, long value) { memPutCLong(struct + FT_Vector.Y, value); } + + // ----------------------------------- + + /** An array of {@link FT_Vector} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final FT_Vector ELEMENT_FACTORY = FT_Vector.create(-1L); + + /** + * Creates a new {@code FT_Vector.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 {@link FT_Vector#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected FT_Vector getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code x} field. */ + @NativeType("FT_Pos") + public long x() { return FT_Vector.nx(address()); } + /** @return the value of the {@code y} field. */ + @NativeType("FT_Pos") + public long y() { return FT_Vector.ny(address()); } + + /** Sets the specified value to the {@code x} field. */ + public Buffer x(@NativeType("FT_Pos") long value) { FT_Vector.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(@NativeType("FT_Pos") long value) { FT_Vector.ny(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FreeType.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FreeType.java new file mode 100644 index 00000000..da644f07 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FreeType.java @@ -0,0 +1,5951 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.libffi.LibFFI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to FreeType, a freely available software library to render fonts. + * + *

It is written in C, designed to be small, efficient, highly customizable, and portable while capable of producing high-quality output (glyph images) of + * most vector and bitmap font formats.

+ * + *

FreeType is a library that provides access to glyphs in font files. It scales the glyph images and their metrics to a requested size, and it rasterizes + * the glyph images to produce pixel or subpixel alpha coverage bitmaps.

+ * + *

Note that FreeType is not a text layout engine. You have to use higher-level libraries like HarfBuzz, Pango, or ICU for that.

+ * + *

Note also that FreeType does not perform alpha blending or compositing the resulting bitmaps or pixmaps by itself. Use your favourite graphics + * library (for example, Cairo or Skia) to further process FreeType's output.

+ * + *

HarfBuzz interop

+ * + *

The default LWJGL FreeType build includes HarfBuzz and exports its full API. See the HarfBuzz bindings for more information.

+ */ +public class FreeType { + + private static final SharedLibrary FREETYPE = Library.loadNative(FreeType.class, "org.lwjgl.freetype", Configuration.FREETYPE_LIBRARY_NAME.get(Platform.mapLibraryNameBundled("freetype")), true); + + /** Contains the function pointers loaded from the freetype {@link SharedLibrary}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + Init_FreeType = apiGetFunctionAddress(FREETYPE, "FT_Init_FreeType"), + Done_FreeType = apiGetFunctionAddress(FREETYPE, "FT_Done_FreeType"), + New_Face = apiGetFunctionAddress(FREETYPE, "FT_New_Face"), + New_Memory_Face = apiGetFunctionAddress(FREETYPE, "FT_New_Memory_Face"), + Open_Face = apiGetFunctionAddress(FREETYPE, "FT_Open_Face"), + Attach_File = apiGetFunctionAddress(FREETYPE, "FT_Attach_File"), + Attach_Stream = apiGetFunctionAddress(FREETYPE, "FT_Attach_Stream"), + Reference_Face = apiGetFunctionAddress(FREETYPE, "FT_Reference_Face"), + Done_Face = apiGetFunctionAddress(FREETYPE, "FT_Done_Face"), + Select_Size = apiGetFunctionAddress(FREETYPE, "FT_Select_Size"), + Request_Size = apiGetFunctionAddress(FREETYPE, "FT_Request_Size"), + Set_Char_Size = apiGetFunctionAddress(FREETYPE, "FT_Set_Char_Size"), + Set_Pixel_Sizes = apiGetFunctionAddress(FREETYPE, "FT_Set_Pixel_Sizes"), + Load_Glyph = apiGetFunctionAddress(FREETYPE, "FT_Load_Glyph"), + Load_Char = apiGetFunctionAddress(FREETYPE, "FT_Load_Char"), + Set_Transform = apiGetFunctionAddress(FREETYPE, "FT_Set_Transform"), + Get_Transform = apiGetFunctionAddress(FREETYPE, "FT_Get_Transform"), + Render_Glyph = apiGetFunctionAddress(FREETYPE, "FT_Render_Glyph"), + Get_Kerning = apiGetFunctionAddress(FREETYPE, "FT_Get_Kerning"), + Get_Track_Kerning = apiGetFunctionAddress(FREETYPE, "FT_Get_Track_Kerning"), + Select_Charmap = apiGetFunctionAddress(FREETYPE, "FT_Select_Charmap"), + Set_Charmap = apiGetFunctionAddress(FREETYPE, "FT_Set_Charmap"), + Get_Charmap_Index = apiGetFunctionAddress(FREETYPE, "FT_Get_Charmap_Index"), + Get_Char_Index = apiGetFunctionAddress(FREETYPE, "FT_Get_Char_Index"), + Get_First_Char = apiGetFunctionAddress(FREETYPE, "FT_Get_First_Char"), + Get_Next_Char = apiGetFunctionAddress(FREETYPE, "FT_Get_Next_Char"), + Face_Properties = apiGetFunctionAddress(FREETYPE, "FT_Face_Properties"), + Get_Name_Index = apiGetFunctionAddress(FREETYPE, "FT_Get_Name_Index"), + Get_Glyph_Name = apiGetFunctionAddress(FREETYPE, "FT_Get_Glyph_Name"), + Get_Postscript_Name = apiGetFunctionAddress(FREETYPE, "FT_Get_Postscript_Name"), + Get_SubGlyph_Info = apiGetFunctionAddress(FREETYPE, "FT_Get_SubGlyph_Info"), + Get_FSType_Flags = apiGetFunctionAddress(FREETYPE, "FT_Get_FSType_Flags"), + Face_GetCharVariantIndex = apiGetFunctionAddress(FREETYPE, "FT_Face_GetCharVariantIndex"), + Face_GetCharVariantIsDefault = apiGetFunctionAddress(FREETYPE, "FT_Face_GetCharVariantIsDefault"), + Face_GetVariantSelectors = apiGetFunctionAddress(FREETYPE, "FT_Face_GetVariantSelectors"), + Face_GetVariantsOfChar = apiGetFunctionAddress(FREETYPE, "FT_Face_GetVariantsOfChar"), + Face_GetCharsOfVariant = apiGetFunctionAddress(FREETYPE, "FT_Face_GetCharsOfVariant"), + MulDiv = apiGetFunctionAddress(FREETYPE, "FT_MulDiv"), + MulFix = apiGetFunctionAddress(FREETYPE, "FT_MulFix"), + DivFix = apiGetFunctionAddress(FREETYPE, "FT_DivFix"), + RoundFix = apiGetFunctionAddress(FREETYPE, "FT_RoundFix"), + CeilFix = apiGetFunctionAddress(FREETYPE, "FT_CeilFix"), + FloorFix = apiGetFunctionAddress(FREETYPE, "FT_FloorFix"), + Vector_Transform = apiGetFunctionAddress(FREETYPE, "FT_Vector_Transform"), + Library_Version = apiGetFunctionAddress(FREETYPE, "FT_Library_Version"), + Face_CheckTrueTypePatents = apiGetFunctionAddress(FREETYPE, "FT_Face_CheckTrueTypePatents"), + Face_SetUnpatentedHinting = apiGetFunctionAddress(FREETYPE, "FT_Face_SetUnpatentedHinting"), + Get_Advance = apiGetFunctionAddress(FREETYPE, "FT_Get_Advance"), + Get_Advances = apiGetFunctionAddress(FREETYPE, "FT_Get_Advances"), + Outline_Get_BBox = apiGetFunctionAddress(FREETYPE, "FT_Outline_Get_BBox"), + Get_BDF_Charset_ID = apiGetFunctionAddress(FREETYPE, "FT_Get_BDF_Charset_ID"), + Get_BDF_Property = apiGetFunctionAddress(FREETYPE, "FT_Get_BDF_Property"), + Bitmap_Init = apiGetFunctionAddress(FREETYPE, "FT_Bitmap_Init"), + Bitmap_Copy = apiGetFunctionAddress(FREETYPE, "FT_Bitmap_Copy"), + Bitmap_Embolden = apiGetFunctionAddress(FREETYPE, "FT_Bitmap_Embolden"), + Bitmap_Convert = apiGetFunctionAddress(FREETYPE, "FT_Bitmap_Convert"), + Bitmap_Blend = apiGetFunctionAddress(FREETYPE, "FT_Bitmap_Blend"), + GlyphSlot_Own_Bitmap = apiGetFunctionAddress(FREETYPE, "FT_GlyphSlot_Own_Bitmap"), + Bitmap_Done = apiGetFunctionAddress(FREETYPE, "FT_Bitmap_Done"), + Stream_OpenBzip2 = apiGetFunctionAddressOptional(FREETYPE, "FT_Stream_OpenBzip2"), + FTC_Manager_New = apiGetFunctionAddress(FREETYPE, "FTC_Manager_New"), + FTC_Manager_Reset = apiGetFunctionAddress(FREETYPE, "FTC_Manager_Reset"), + FTC_Manager_Done = apiGetFunctionAddress(FREETYPE, "FTC_Manager_Done"), + FTC_Manager_LookupFace = apiGetFunctionAddress(FREETYPE, "FTC_Manager_LookupFace"), + FTC_Manager_LookupSize = apiGetFunctionAddress(FREETYPE, "FTC_Manager_LookupSize"), + FTC_Node_Unref = apiGetFunctionAddress(FREETYPE, "FTC_Node_Unref"), + FTC_Manager_RemoveFaceID = apiGetFunctionAddress(FREETYPE, "FTC_Manager_RemoveFaceID"), + FTC_CMapCache_New = apiGetFunctionAddress(FREETYPE, "FTC_CMapCache_New"), + FTC_CMapCache_Lookup = apiGetFunctionAddress(FREETYPE, "FTC_CMapCache_Lookup"), + FTC_ImageCache_New = apiGetFunctionAddress(FREETYPE, "FTC_ImageCache_New"), + FTC_ImageCache_Lookup = apiGetFunctionAddress(FREETYPE, "FTC_ImageCache_Lookup"), + FTC_ImageCache_LookupScaler = apiGetFunctionAddress(FREETYPE, "FTC_ImageCache_LookupScaler"), + FTC_SBitCache_New = apiGetFunctionAddress(FREETYPE, "FTC_SBitCache_New"), + FTC_SBitCache_Lookup = apiGetFunctionAddress(FREETYPE, "FTC_SBitCache_Lookup"), + FTC_SBitCache_LookupScaler = apiGetFunctionAddress(FREETYPE, "FTC_SBitCache_LookupScaler"), + Get_CID_Registry_Ordering_Supplement = apiGetFunctionAddress(FREETYPE, "FT_Get_CID_Registry_Ordering_Supplement"), + Get_CID_Is_Internally_CID_Keyed = apiGetFunctionAddress(FREETYPE, "FT_Get_CID_Is_Internally_CID_Keyed"), + Get_CID_From_Glyph_Index = apiGetFunctionAddress(FREETYPE, "FT_Get_CID_From_Glyph_Index"), + Palette_Data_Get = apiGetFunctionAddress(FREETYPE, "FT_Palette_Data_Get"), + Palette_Select = apiGetFunctionAddress(FREETYPE, "FT_Palette_Select"), + Palette_Set_Foreground_Color = apiGetFunctionAddress(FREETYPE, "FT_Palette_Set_Foreground_Color"), + Get_Color_Glyph_Layer = apiGetFunctionAddress(FREETYPE, "FT_Get_Color_Glyph_Layer"), + Get_Color_Glyph_Paint = apiGetFunctionAddress(FREETYPE, "FT_Get_Color_Glyph_Paint"), + Get_Color_Glyph_ClipBox = apiGetFunctionAddress(FREETYPE, "FT_Get_Color_Glyph_ClipBox"), + Get_Paint_Layers = apiGetFunctionAddress(FREETYPE, "FT_Get_Paint_Layers"), + Get_Colorline_Stops = apiGetFunctionAddress(FREETYPE, "FT_Get_Colorline_Stops"), + Get_Paint = apiGetFunctionAddress(FREETYPE, "FT_Get_Paint"), + Error_String = apiGetFunctionAddress(FREETYPE, "FT_Error_String"), + Get_Font_Format = apiGetFunctionAddress(FREETYPE, "FT_Get_Font_Format"), + Get_Gasp = apiGetFunctionAddress(FREETYPE, "FT_Get_Gasp"), + New_Glyph = apiGetFunctionAddress(FREETYPE, "FT_New_Glyph"), + Get_Glyph = apiGetFunctionAddress(FREETYPE, "FT_Get_Glyph"), + Glyph_Copy = apiGetFunctionAddress(FREETYPE, "FT_Glyph_Copy"), + Glyph_Transform = apiGetFunctionAddress(FREETYPE, "FT_Glyph_Transform"), + Glyph_Get_CBox = apiGetFunctionAddress(FREETYPE, "FT_Glyph_Get_CBox"), + Glyph_To_Bitmap = apiGetFunctionAddress(FREETYPE, "FT_Glyph_To_Bitmap"), + Done_Glyph = apiGetFunctionAddress(FREETYPE, "FT_Done_Glyph"), + Matrix_Multiply = apiGetFunctionAddress(FREETYPE, "FT_Matrix_Multiply"), + Matrix_Invert = apiGetFunctionAddress(FREETYPE, "FT_Matrix_Invert"), + TrueTypeGX_Validate = apiGetFunctionAddress(FREETYPE, "FT_TrueTypeGX_Validate"), + TrueTypeGX_Free = apiGetFunctionAddress(FREETYPE, "FT_TrueTypeGX_Free"), + ClassicKern_Validate = apiGetFunctionAddress(FREETYPE, "FT_ClassicKern_Validate"), + ClassicKern_Free = apiGetFunctionAddress(FREETYPE, "FT_ClassicKern_Free"), + Stream_OpenGzip = apiGetFunctionAddress(FREETYPE, "FT_Stream_OpenGzip"), + Gzip_Uncompress = apiGetFunctionAddress(FREETYPE, "FT_Gzip_Uncompress"), + Library_SetLcdFilter = apiGetFunctionAddress(FREETYPE, "FT_Library_SetLcdFilter"), + Library_SetLcdFilterWeights = apiGetFunctionAddress(FREETYPE, "FT_Library_SetLcdFilterWeights"), + Library_SetLcdGeometry = apiGetFunctionAddress(FREETYPE, "FT_Library_SetLcdGeometry"), + List_Find = apiGetFunctionAddress(FREETYPE, "FT_List_Find"), + List_Add = apiGetFunctionAddress(FREETYPE, "FT_List_Add"), + List_Insert = apiGetFunctionAddress(FREETYPE, "FT_List_Insert"), + List_Remove = apiGetFunctionAddress(FREETYPE, "FT_List_Remove"), + List_Up = apiGetFunctionAddress(FREETYPE, "FT_List_Up"), + List_Iterate = apiGetFunctionAddress(FREETYPE, "FT_List_Iterate"), + List_Finalize = apiGetFunctionAddress(FREETYPE, "FT_List_Finalize"), + Stream_OpenLZW = apiGetFunctionAddress(FREETYPE, "FT_Stream_OpenLZW"), + Get_Multi_Master = apiGetFunctionAddress(FREETYPE, "FT_Get_Multi_Master"), + Get_MM_Var = apiGetFunctionAddress(FREETYPE, "FT_Get_MM_Var"), + Done_MM_Var = apiGetFunctionAddress(FREETYPE, "FT_Done_MM_Var"), + Set_MM_Design_Coordinates = apiGetFunctionAddress(FREETYPE, "FT_Set_MM_Design_Coordinates"), + Set_Var_Design_Coordinates = apiGetFunctionAddress(FREETYPE, "FT_Set_Var_Design_Coordinates"), + Get_Var_Design_Coordinates = apiGetFunctionAddress(FREETYPE, "FT_Get_Var_Design_Coordinates"), + Set_MM_Blend_Coordinates = apiGetFunctionAddress(FREETYPE, "FT_Set_MM_Blend_Coordinates"), + Get_MM_Blend_Coordinates = apiGetFunctionAddress(FREETYPE, "FT_Get_MM_Blend_Coordinates"), + Set_Var_Blend_Coordinates = apiGetFunctionAddress(FREETYPE, "FT_Set_Var_Blend_Coordinates"), + Get_Var_Blend_Coordinates = apiGetFunctionAddress(FREETYPE, "FT_Get_Var_Blend_Coordinates"), + Set_MM_WeightVector = apiGetFunctionAddress(FREETYPE, "FT_Set_MM_WeightVector"), + Get_MM_WeightVector = apiGetFunctionAddress(FREETYPE, "FT_Get_MM_WeightVector"), + Get_Var_Axis_Flags = apiGetFunctionAddress(FREETYPE, "FT_Get_Var_Axis_Flags"), + Set_Named_Instance = apiGetFunctionAddress(FREETYPE, "FT_Set_Named_Instance"), + Get_Default_Named_Instance = apiGetFunctionAddress(FREETYPE, "FT_Get_Default_Named_Instance"), + Add_Module = apiGetFunctionAddress(FREETYPE, "FT_Add_Module"), + Get_Module = apiGetFunctionAddress(FREETYPE, "FT_Get_Module"), + Remove_Module = apiGetFunctionAddress(FREETYPE, "FT_Remove_Module"), + Property_Set = apiGetFunctionAddress(FREETYPE, "FT_Property_Set"), + Property_Get = apiGetFunctionAddress(FREETYPE, "FT_Property_Get"), + Set_Default_Properties = apiGetFunctionAddress(FREETYPE, "FT_Set_Default_Properties"), + Reference_Library = apiGetFunctionAddress(FREETYPE, "FT_Reference_Library"), + New_Library = apiGetFunctionAddress(FREETYPE, "FT_New_Library"), + Done_Library = apiGetFunctionAddress(FREETYPE, "FT_Done_Library"), + Set_Debug_Hook = apiGetFunctionAddress(FREETYPE, "FT_Set_Debug_Hook"), + Add_Default_Modules = apiGetFunctionAddress(FREETYPE, "FT_Add_Default_Modules"), + Get_TrueType_Engine_Type = apiGetFunctionAddress(FREETYPE, "FT_Get_TrueType_Engine_Type"), + OpenType_Validate = apiGetFunctionAddress(FREETYPE, "FT_OpenType_Validate"), + OpenType_Free = apiGetFunctionAddress(FREETYPE, "FT_OpenType_Free"), + Outline_Decompose = apiGetFunctionAddress(FREETYPE, "FT_Outline_Decompose"), + Outline_New = apiGetFunctionAddress(FREETYPE, "FT_Outline_New"), + Outline_Done = apiGetFunctionAddress(FREETYPE, "FT_Outline_Done"), + Outline_Check = apiGetFunctionAddress(FREETYPE, "FT_Outline_Check"), + Outline_Get_CBox = apiGetFunctionAddress(FREETYPE, "FT_Outline_Get_CBox"), + Outline_Translate = apiGetFunctionAddress(FREETYPE, "FT_Outline_Translate"), + Outline_Copy = apiGetFunctionAddress(FREETYPE, "FT_Outline_Copy"), + Outline_Transform = apiGetFunctionAddress(FREETYPE, "FT_Outline_Transform"), + Outline_Embolden = apiGetFunctionAddress(FREETYPE, "FT_Outline_Embolden"), + Outline_EmboldenXY = apiGetFunctionAddress(FREETYPE, "FT_Outline_EmboldenXY"), + Outline_Reverse = apiGetFunctionAddress(FREETYPE, "FT_Outline_Reverse"), + Outline_Get_Bitmap = apiGetFunctionAddress(FREETYPE, "FT_Outline_Get_Bitmap"), + Outline_Render = apiGetFunctionAddress(FREETYPE, "FT_Outline_Render"), + Outline_Get_Orientation = apiGetFunctionAddress(FREETYPE, "FT_Outline_Get_Orientation"), + Get_PFR_Metrics = apiGetFunctionAddress(FREETYPE, "FT_Get_PFR_Metrics"), + Get_PFR_Kerning = apiGetFunctionAddress(FREETYPE, "FT_Get_PFR_Kerning"), + Get_PFR_Advance = apiGetFunctionAddress(FREETYPE, "FT_Get_PFR_Advance"), + Get_Renderer = apiGetFunctionAddress(FREETYPE, "FT_Get_Renderer"), + Set_Renderer = apiGetFunctionAddress(FREETYPE, "FT_Set_Renderer"), + New_Size = apiGetFunctionAddress(FREETYPE, "FT_New_Size"), + Done_Size = apiGetFunctionAddress(FREETYPE, "FT_Done_Size"), + Activate_Size = apiGetFunctionAddress(FREETYPE, "FT_Activate_Size"), + Get_Sfnt_Name_Count = apiGetFunctionAddress(FREETYPE, "FT_Get_Sfnt_Name_Count"), + Get_Sfnt_Name = apiGetFunctionAddress(FREETYPE, "FT_Get_Sfnt_Name"), + Get_Sfnt_LangTag = apiGetFunctionAddress(FREETYPE, "FT_Get_Sfnt_LangTag"), + Outline_GetInsideBorder = apiGetFunctionAddress(FREETYPE, "FT_Outline_GetInsideBorder"), + Outline_GetOutsideBorder = apiGetFunctionAddress(FREETYPE, "FT_Outline_GetOutsideBorder"), + Stroker_New = apiGetFunctionAddress(FREETYPE, "FT_Stroker_New"), + Stroker_Set = apiGetFunctionAddress(FREETYPE, "FT_Stroker_Set"), + Stroker_Rewind = apiGetFunctionAddress(FREETYPE, "FT_Stroker_Rewind"), + Stroker_ParseOutline = apiGetFunctionAddress(FREETYPE, "FT_Stroker_ParseOutline"), + Stroker_BeginSubPath = apiGetFunctionAddress(FREETYPE, "FT_Stroker_BeginSubPath"), + Stroker_EndSubPath = apiGetFunctionAddress(FREETYPE, "FT_Stroker_EndSubPath"), + Stroker_LineTo = apiGetFunctionAddress(FREETYPE, "FT_Stroker_LineTo"), + Stroker_ConicTo = apiGetFunctionAddress(FREETYPE, "FT_Stroker_ConicTo"), + Stroker_CubicTo = apiGetFunctionAddress(FREETYPE, "FT_Stroker_CubicTo"), + Stroker_GetBorderCounts = apiGetFunctionAddress(FREETYPE, "FT_Stroker_GetBorderCounts"), + Stroker_ExportBorder = apiGetFunctionAddress(FREETYPE, "FT_Stroker_ExportBorder"), + Stroker_GetCounts = apiGetFunctionAddress(FREETYPE, "FT_Stroker_GetCounts"), + Stroker_Export = apiGetFunctionAddress(FREETYPE, "FT_Stroker_Export"), + Stroker_Done = apiGetFunctionAddress(FREETYPE, "FT_Stroker_Done"), + Glyph_Stroke = apiGetFunctionAddress(FREETYPE, "FT_Glyph_Stroke"), + Glyph_StrokeBorder = apiGetFunctionAddress(FREETYPE, "FT_Glyph_StrokeBorder"), + GlyphSlot_Embolden = apiGetFunctionAddress(FREETYPE, "FT_GlyphSlot_Embolden"), + GlyphSlot_AdjustWeight = apiGetFunctionAddress(FREETYPE, "FT_GlyphSlot_AdjustWeight"), + GlyphSlot_Oblique = apiGetFunctionAddress(FREETYPE, "FT_GlyphSlot_Oblique"), + GlyphSlot_Slant = apiGetFunctionAddress(FREETYPE, "FT_GlyphSlot_Slant"), + Sin = apiGetFunctionAddress(FREETYPE, "FT_Sin"), + Cos = apiGetFunctionAddress(FREETYPE, "FT_Cos"), + Tan = apiGetFunctionAddress(FREETYPE, "FT_Tan"), + Atan2 = apiGetFunctionAddress(FREETYPE, "FT_Atan2"), + Angle_Diff = apiGetFunctionAddress(FREETYPE, "FT_Angle_Diff"), + Vector_Unit = apiGetFunctionAddress(FREETYPE, "FT_Vector_Unit"), + Vector_Rotate = apiGetFunctionAddress(FREETYPE, "FT_Vector_Rotate"), + Vector_Length = apiGetFunctionAddress(FREETYPE, "FT_Vector_Length"), + Vector_Polarize = apiGetFunctionAddress(FREETYPE, "FT_Vector_Polarize"), + Vector_From_Polar = apiGetFunctionAddress(FREETYPE, "FT_Vector_From_Polar"), + Has_PS_Glyph_Names = apiGetFunctionAddress(FREETYPE, "FT_Has_PS_Glyph_Names"), + Get_PS_Font_Info = apiGetFunctionAddress(FREETYPE, "FT_Get_PS_Font_Info"), + Get_PS_Font_Private = apiGetFunctionAddress(FREETYPE, "FT_Get_PS_Font_Private"), + Get_PS_Font_Value = apiGetFunctionAddress(FREETYPE, "FT_Get_PS_Font_Value"), + Get_Sfnt_Table = apiGetFunctionAddress(FREETYPE, "FT_Get_Sfnt_Table"), + Load_Sfnt_Table = apiGetFunctionAddress(FREETYPE, "FT_Load_Sfnt_Table"), + Sfnt_Table_Info = apiGetFunctionAddress(FREETYPE, "FT_Sfnt_Table_Info"), + Get_CMap_Language_ID = apiGetFunctionAddress(FREETYPE, "FT_Get_CMap_Language_ID"), + Get_CMap_Format = apiGetFunctionAddress(FREETYPE, "FT_Get_CMap_Format"); + + } + + /** Returns the freetype {@link SharedLibrary}. */ + public static SharedLibrary getLibrary() { + return FREETYPE; + } + + /** + * {@code FT_Encoding} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_ENCODING_NONE ENCODING_NONE}
  • + *
  • {@link #FT_ENCODING_MS_SYMBOL ENCODING_MS_SYMBOL}
  • + *
  • {@link #FT_ENCODING_UNICODE ENCODING_UNICODE}
  • + *
  • {@link #FT_ENCODING_SJIS ENCODING_SJIS}
  • + *
  • {@link #FT_ENCODING_PRC ENCODING_PRC}
  • + *
  • {@link #FT_ENCODING_BIG5 ENCODING_BIG5}
  • + *
  • {@link #FT_ENCODING_WANSUNG ENCODING_WANSUNG}
  • + *
  • {@link #FT_ENCODING_JOHAB ENCODING_JOHAB}
  • + *
  • {@link #FT_ENCODING_GB2312 ENCODING_GB2312} - for backward compatibility
  • + *
  • {@link #FT_ENCODING_MS_SJIS ENCODING_MS_SJIS} - for backward compatibility
  • + *
  • {@link #FT_ENCODING_MS_GB2312 ENCODING_MS_GB2312} - for backward compatibility
  • + *
  • {@link #FT_ENCODING_MS_BIG5 ENCODING_MS_BIG5} - for backward compatibility
  • + *
  • {@link #FT_ENCODING_MS_WANSUNG ENCODING_MS_WANSUNG} - for backward compatibility
  • + *
  • {@link #FT_ENCODING_MS_JOHAB ENCODING_MS_JOHAB} - for backward compatibility
  • + *
  • {@link #FT_ENCODING_ADOBE_STANDARD ENCODING_ADOBE_STANDARD}
  • + *
  • {@link #FT_ENCODING_ADOBE_EXPERT ENCODING_ADOBE_EXPERT}
  • + *
  • {@link #FT_ENCODING_ADOBE_CUSTOM ENCODING_ADOBE_CUSTOM}
  • + *
  • {@link #FT_ENCODING_ADOBE_LATIN_1 ENCODING_ADOBE_LATIN_1}
  • + *
  • {@link #FT_ENCODING_OLD_LATIN_2 ENCODING_OLD_LATIN_2}
  • + *
  • {@link #FT_ENCODING_APPLE_ROMAN ENCODING_APPLE_ROMAN}
  • + *
+ */ + public static final int + FT_ENCODING_NONE = FT_ENC_TAG( 0, 0, 0, 0 ), + FT_ENCODING_MS_SYMBOL = FT_ENC_TAG( 's', 'y', 'm', 'b' ), + FT_ENCODING_UNICODE = FT_ENC_TAG( 'u', 'n', 'i', 'c' ), + FT_ENCODING_SJIS = FT_ENC_TAG( 's', 'j', 'i', 's' ), + FT_ENCODING_PRC = FT_ENC_TAG( 'g', 'b', ' ', ' ' ), + FT_ENCODING_BIG5 = FT_ENC_TAG( 'b', 'i', 'g', '5' ), + FT_ENCODING_WANSUNG = FT_ENC_TAG( 'w', 'a', 'n', 's' ), + FT_ENCODING_JOHAB = FT_ENC_TAG( 'j', 'o', 'h', 'a' ), + FT_ENCODING_GB2312 = FT_ENCODING_PRC, + FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS, + FT_ENCODING_MS_GB2312 = FT_ENCODING_PRC, + FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5, + FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG, + FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB, + FT_ENCODING_ADOBE_STANDARD = FT_ENC_TAG( 'A', 'D', 'O', 'B' ), + FT_ENCODING_ADOBE_EXPERT = FT_ENC_TAG( 'A', 'D', 'B', 'E' ), + FT_ENCODING_ADOBE_CUSTOM = FT_ENC_TAG( 'A', 'D', 'B', 'C' ), + FT_ENCODING_ADOBE_LATIN_1 = FT_ENC_TAG( 'l', 'a', 't', '1' ), + FT_ENCODING_OLD_LATIN_2 = FT_ENC_TAG( 'l', 'a', 't', '2' ), + FT_ENCODING_APPLE_ROMAN = FT_ENC_TAG( 'a', 'r', 'm', 'n' ); + + /** + * {@code FT_FACE_FLAG_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_FACE_FLAG_SCALABLE FACE_FLAG_SCALABLE}
  • + *
  • {@link #FT_FACE_FLAG_FIXED_SIZES FACE_FLAG_FIXED_SIZES}
  • + *
  • {@link #FT_FACE_FLAG_FIXED_WIDTH FACE_FLAG_FIXED_WIDTH}
  • + *
  • {@link #FT_FACE_FLAG_SFNT FACE_FLAG_SFNT}
  • + *
  • {@link #FT_FACE_FLAG_HORIZONTAL FACE_FLAG_HORIZONTAL}
  • + *
  • {@link #FT_FACE_FLAG_VERTICAL FACE_FLAG_VERTICAL}
  • + *
  • {@link #FT_FACE_FLAG_KERNING FACE_FLAG_KERNING}
  • + *
  • {@link #FT_FACE_FLAG_FAST_GLYPHS FACE_FLAG_FAST_GLYPHS}
  • + *
  • {@link #FT_FACE_FLAG_MULTIPLE_MASTERS FACE_FLAG_MULTIPLE_MASTERS}
  • + *
  • {@link #FT_FACE_FLAG_GLYPH_NAMES FACE_FLAG_GLYPH_NAMES}
  • + *
  • {@link #FT_FACE_FLAG_EXTERNAL_STREAM FACE_FLAG_EXTERNAL_STREAM}
  • + *
  • {@link #FT_FACE_FLAG_HINTER FACE_FLAG_HINTER}
  • + *
  • {@link #FT_FACE_FLAG_CID_KEYED FACE_FLAG_CID_KEYED}
  • + *
  • {@link #FT_FACE_FLAG_TRICKY FACE_FLAG_TRICKY}
  • + *
  • {@link #FT_FACE_FLAG_COLOR FACE_FLAG_COLOR}
  • + *
  • {@link #FT_FACE_FLAG_VARIATION FACE_FLAG_VARIATION}
  • + *
  • {@link #FT_FACE_FLAG_SVG FACE_FLAG_SVG}
  • + *
  • {@link #FT_FACE_FLAG_SBIX FACE_FLAG_SBIX}
  • + *
  • {@link #FT_FACE_FLAG_SBIX_OVERLAY FACE_FLAG_SBIX_OVERLAY}
  • + *
+ */ + public static final int + FT_FACE_FLAG_SCALABLE = 1 << 0, + FT_FACE_FLAG_FIXED_SIZES = 1 << 1, + FT_FACE_FLAG_FIXED_WIDTH = 1 << 2, + FT_FACE_FLAG_SFNT = 1 << 3, + FT_FACE_FLAG_HORIZONTAL = 1 << 4, + FT_FACE_FLAG_VERTICAL = 1 << 5, + FT_FACE_FLAG_KERNING = 1 << 6, + FT_FACE_FLAG_FAST_GLYPHS = 1 << 7, + FT_FACE_FLAG_MULTIPLE_MASTERS = 1 << 8, + FT_FACE_FLAG_GLYPH_NAMES = 1 << 9, + FT_FACE_FLAG_EXTERNAL_STREAM = 1 << 10, + FT_FACE_FLAG_HINTER = 1 << 11, + FT_FACE_FLAG_CID_KEYED = 1 << 12, + FT_FACE_FLAG_TRICKY = 1 << 13, + FT_FACE_FLAG_COLOR = 1 << 14, + FT_FACE_FLAG_VARIATION = 1 << 15, + FT_FACE_FLAG_SVG = 1 << 16, + FT_FACE_FLAG_SBIX = 1 << 17, + FT_FACE_FLAG_SBIX_OVERLAY = 1 << 18; + + /** + * {@code FT_STYLE_FLAG_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_STYLE_FLAG_ITALIC STYLE_FLAG_ITALIC}
  • + *
  • {@link #FT_STYLE_FLAG_BOLD STYLE_FLAG_BOLD}
  • + *
+ */ + public static final int + FT_STYLE_FLAG_ITALIC = 1 << 0, + FT_STYLE_FLAG_BOLD = 1 << 1; + + /** + * {@code FT_FFT_OPEN_XXXACE_FLAG_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_OPEN_MEMORY OPEN_MEMORY}
  • + *
  • {@link #FT_OPEN_STREAM OPEN_STREAM}
  • + *
  • {@link #FT_OPEN_PATHNAME OPEN_PATHNAME}
  • + *
  • {@link #FT_OPEN_DRIVER OPEN_DRIVER}
  • + *
  • {@link #FT_OPEN_PARAMS OPEN_PARAMS}
  • + *
+ */ + public static final int + FT_OPEN_MEMORY = 0x1, + FT_OPEN_STREAM = 0x2, + FT_OPEN_PATHNAME = 0x4, + FT_OPEN_DRIVER = 0x8, + FT_OPEN_PARAMS = 0x10; + + /** + * {@code FT_Size_Request_Type} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_SIZE_REQUEST_TYPE_NOMINAL SIZE_REQUEST_TYPE_NOMINAL}
  • + *
  • {@link #FT_SIZE_REQUEST_TYPE_REAL_DIM SIZE_REQUEST_TYPE_REAL_DIM}
  • + *
  • {@link #FT_SIZE_REQUEST_TYPE_BBOX SIZE_REQUEST_TYPE_BBOX}
  • + *
  • {@link #FT_SIZE_REQUEST_TYPE_CELL SIZE_REQUEST_TYPE_CELL}
  • + *
  • {@link #FT_SIZE_REQUEST_TYPE_SCALES SIZE_REQUEST_TYPE_SCALES}
  • + *
  • {@link #FT_SIZE_REQUEST_TYPE_MAX SIZE_REQUEST_TYPE_MAX}
  • + *
+ */ + public static final int + FT_SIZE_REQUEST_TYPE_NOMINAL = 0, + FT_SIZE_REQUEST_TYPE_REAL_DIM = 1, + FT_SIZE_REQUEST_TYPE_BBOX = 2, + FT_SIZE_REQUEST_TYPE_CELL = 3, + FT_SIZE_REQUEST_TYPE_SCALES = 4, + FT_SIZE_REQUEST_TYPE_MAX = 5; + + /** + * {@code FT_LOAD_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_LOAD_DEFAULT LOAD_DEFAULT}
  • + *
  • {@link #FT_LOAD_NO_SCALE LOAD_NO_SCALE}
  • + *
  • {@link #FT_LOAD_NO_HINTING LOAD_NO_HINTING}
  • + *
  • {@link #FT_LOAD_RENDER LOAD_RENDER}
  • + *
  • {@link #FT_LOAD_NO_BITMAP LOAD_NO_BITMAP}
  • + *
  • {@link #FT_LOAD_VERTICAL_LAYOUT LOAD_VERTICAL_LAYOUT}
  • + *
  • {@link #FT_LOAD_FORCE_AUTOHINT LOAD_FORCE_AUTOHINT}
  • + *
  • {@link #FT_LOAD_CROP_BITMAP LOAD_CROP_BITMAP}
  • + *
  • {@link #FT_LOAD_PEDANTIC LOAD_PEDANTIC}
  • + *
  • {@link #FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH}
  • + *
  • {@link #FT_LOAD_NO_RECURSE LOAD_NO_RECURSE}
  • + *
  • {@link #FT_LOAD_IGNORE_TRANSFORM LOAD_IGNORE_TRANSFORM}
  • + *
  • {@link #FT_LOAD_MONOCHROME LOAD_MONOCHROME}
  • + *
  • {@link #FT_LOAD_LINEAR_DESIGN LOAD_LINEAR_DESIGN}
  • + *
  • {@link #FT_LOAD_SBITS_ONLY LOAD_SBITS_ONLY}
  • + *
  • {@link #FT_LOAD_NO_AUTOHINT LOAD_NO_AUTOHINT}
  • + *
  • {@link #FT_LOAD_COLOR LOAD_COLOR}
  • + *
  • {@link #FT_LOAD_COMPUTE_METRICS LOAD_COMPUTE_METRICS}
  • + *
  • {@link #FT_LOAD_BITMAP_METRICS_ONLY LOAD_BITMAP_METRICS_ONLY}
  • + *
  • {@link #FT_LOAD_NO_SVG LOAD_NO_SVG}
  • + *
  • {@link #FT_LOAD_ADVANCE_ONLY LOAD_ADVANCE_ONLY}
  • + *
  • {@link #FT_LOAD_SVG_ONLY LOAD_SVG_ONLY}
  • + *
+ */ + public static final int + FT_LOAD_DEFAULT = 0x0, + FT_LOAD_NO_SCALE = 1 << 0, + FT_LOAD_NO_HINTING = 1 << 1, + FT_LOAD_RENDER = 1 << 2, + FT_LOAD_NO_BITMAP = 1 << 3, + FT_LOAD_VERTICAL_LAYOUT = 1 << 4, + FT_LOAD_FORCE_AUTOHINT = 1 << 5, + FT_LOAD_CROP_BITMAP = 1 << 6, + FT_LOAD_PEDANTIC = 1 << 7, + FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH = 1 << 9, + FT_LOAD_NO_RECURSE = 1 << 10, + FT_LOAD_IGNORE_TRANSFORM = 1 << 11, + FT_LOAD_MONOCHROME = 1 << 12, + FT_LOAD_LINEAR_DESIGN = 1 << 13, + FT_LOAD_SBITS_ONLY = 1 << 14, + FT_LOAD_NO_AUTOHINT = 1 << 15, + FT_LOAD_COLOR = 1 << 20, + FT_LOAD_COMPUTE_METRICS = 1 << 21, + FT_LOAD_BITMAP_METRICS_ONLY = 1 << 22, + FT_LOAD_NO_SVG = 1 << 24, + FT_LOAD_ADVANCE_ONLY = 1 << 8, + FT_LOAD_SVG_ONLY = 1 << 23; + + /** + * {@code FT_Render_Mode} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_RENDER_MODE_NORMAL RENDER_MODE_NORMAL}
  • + *
  • {@link #FT_RENDER_MODE_LIGHT RENDER_MODE_LIGHT}
  • + *
  • {@link #FT_RENDER_MODE_MONO RENDER_MODE_MONO}
  • + *
  • {@link #FT_RENDER_MODE_LCD RENDER_MODE_LCD}
  • + *
  • {@link #FT_RENDER_MODE_LCD_V RENDER_MODE_LCD_V}
  • + *
  • {@link #FT_RENDER_MODE_SDF RENDER_MODE_SDF}
  • + *
  • {@link #FT_RENDER_MODE_MAX RENDER_MODE_MAX}
  • + *
+ */ + public static final int + FT_RENDER_MODE_NORMAL = 0, + FT_RENDER_MODE_LIGHT = 1, + FT_RENDER_MODE_MONO = 2, + FT_RENDER_MODE_LCD = 3, + FT_RENDER_MODE_LCD_V = 4, + FT_RENDER_MODE_SDF = 5, + FT_RENDER_MODE_MAX = 6; + + /** + * {@code FT_LOAD_TARGET_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_NORMAL}
  • + *
  • {@link #FT_FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_LIGHT}
  • + *
  • {@link #FT_FT_LOAD_TARGET_MONO FT_LOAD_TARGET_MONO}
  • + *
  • {@link #FT_FT_LOAD_TARGET_LCD FT_LOAD_TARGET_LCD}
  • + *
  • {@link #FT_FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_LCD_V}
  • + *
+ */ + public static final int + FT_FT_LOAD_TARGET_NORMAL = FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL ), + FT_FT_LOAD_TARGET_LIGHT = FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT ), + FT_FT_LOAD_TARGET_MONO = FT_LOAD_TARGET_( FT_RENDER_MODE_MONO ), + FT_FT_LOAD_TARGET_LCD = FT_LOAD_TARGET_( FT_RENDER_MODE_LCD ), + FT_FT_LOAD_TARGET_LCD_V = FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V ); + + /** + * {@code FT_Kerning_Mode} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_KERNING_DEFAULT KERNING_DEFAULT}
  • + *
  • {@link #FT_KERNING_UNFITTED KERNING_UNFITTED}
  • + *
  • {@link #FT_KERNING_UNSCALED KERNING_UNSCALED}
  • + *
+ */ + public static final int + FT_KERNING_DEFAULT = 0, + FT_KERNING_UNFITTED = 1, + FT_KERNING_UNSCALED = 2; + + /** + * {@code FT_SUBGLYPH_FLAG_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS SUBGLYPH_FLAG_ARGS_ARE_WORDS}
  • + *
  • {@link #FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES}
  • + *
  • {@link #FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID SUBGLYPH_FLAG_ROUND_XY_TO_GRID}
  • + *
  • {@link #FT_SUBGLYPH_FLAG_SCALE SUBGLYPH_FLAG_SCALE}
  • + *
  • {@link #FT_SUBGLYPH_FLAG_XY_SCALE SUBGLYPH_FLAG_XY_SCALE}
  • + *
  • {@link #FT_SUBGLYPH_FLAG_2X2 SUBGLYPH_FLAG_2X2}
  • + *
  • {@link #FT_SUBGLYPH_FLAG_USE_MY_METRICS SUBGLYPH_FLAG_USE_MY_METRICS}
  • + *
+ */ + public static final int + FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS = 1, + FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES = 2, + FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID = 4, + FT_SUBGLYPH_FLAG_SCALE = 8, + FT_SUBGLYPH_FLAG_XY_SCALE = 0x40, + FT_SUBGLYPH_FLAG_2X2 = 0x80, + FT_SUBGLYPH_FLAG_USE_MY_METRICS = 0x200; + + /** + * {@code FT_FSTYPE_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_FSTYPE_INSTALLABLE_EMBEDDING FSTYPE_INSTALLABLE_EMBEDDING}
  • + *
  • {@link #FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING FSTYPE_RESTRICTED_LICENSE_EMBEDDING}
  • + *
  • {@link #FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING FSTYPE_PREVIEW_AND_PRINT_EMBEDDING}
  • + *
  • {@link #FT_FSTYPE_EDITABLE_EMBEDDING FSTYPE_EDITABLE_EMBEDDING}
  • + *
  • {@link #FT_FSTYPE_NO_SUBSETTING FSTYPE_NO_SUBSETTING}
  • + *
  • {@link #FT_FSTYPE_BITMAP_EMBEDDING_ONLY FSTYPE_BITMAP_EMBEDDING_ONLY}
  • + *
+ */ + public static final int + FT_FSTYPE_INSTALLABLE_EMBEDDING = 0x0000, + FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING = 0x0002, + FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING = 0x0004, + FT_FSTYPE_EDITABLE_EMBEDDING = 0x0008, + FT_FSTYPE_NO_SUBSETTING = 0x0100, + FT_FSTYPE_BITMAP_EMBEDDING_ONLY = 0x0200; + + public static final int FREETYPE_MAJOR = 2; + + public static final int FREETYPE_MINOR = 13; + + public static final int FREETYPE_PATCH = 2; + + public static final int FT_ADVANCE_FLAG_FAST_ONLY = 0x20000000; + + /** + * {@code BDF_PropertyType} + * + *
Enum values:
+ * + *
    + *
  • {@link #BDF_PROPERTY_TYPE_NONE BDF_PROPERTY_TYPE_NONE}
  • + *
  • {@link #BDF_PROPERTY_TYPE_ATOM BDF_PROPERTY_TYPE_ATOM}
  • + *
  • {@link #BDF_PROPERTY_TYPE_INTEGER BDF_PROPERTY_TYPE_INTEGER}
  • + *
  • {@link #BDF_PROPERTY_TYPE_CARDINAL BDF_PROPERTY_TYPE_CARDINAL}
  • + *
+ */ + public static final int + BDF_PROPERTY_TYPE_NONE = 0, + BDF_PROPERTY_TYPE_ATOM = 1, + BDF_PROPERTY_TYPE_INTEGER = 2, + BDF_PROPERTY_TYPE_CARDINAL = 3; + + /** + * {@code FT_PALETTE_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_PALETTE_FOR_LIGHT_BACKGROUND PALETTE_FOR_LIGHT_BACKGROUND}
  • + *
  • {@link #FT_PALETTE_FOR_DARK_BACKGROUND PALETTE_FOR_DARK_BACKGROUND}
  • + *
+ */ + public static final int + FT_PALETTE_FOR_LIGHT_BACKGROUND = 0x01, + FT_PALETTE_FOR_DARK_BACKGROUND = 0x02; + + /** + * {@code FT_PaintFormat} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_COLR_PAINTFORMAT_COLR_LAYERS COLR_PAINTFORMAT_COLR_LAYERS}
  • + *
  • {@link #FT_COLR_PAINTFORMAT_SOLID COLR_PAINTFORMAT_SOLID}
  • + *
  • {@link #FT_COLR_PAINTFORMAT_LINEAR_GRADIENT COLR_PAINTFORMAT_LINEAR_GRADIENT}
  • + *
  • {@link #FT_COLR_PAINTFORMAT_RADIAL_GRADIENT COLR_PAINTFORMAT_RADIAL_GRADIENT}
  • + *
  • {@link #FT_COLR_PAINTFORMAT_SWEEP_GRADIENT COLR_PAINTFORMAT_SWEEP_GRADIENT}
  • + *
  • {@link #FT_COLR_PAINTFORMAT_GLYPH COLR_PAINTFORMAT_GLYPH}
  • + *
  • {@link #FT_COLR_PAINTFORMAT_COLR_GLYPH COLR_PAINTFORMAT_COLR_GLYPH}
  • + *
  • {@link #FT_COLR_PAINTFORMAT_TRANSFORM COLR_PAINTFORMAT_TRANSFORM}
  • + *
  • {@link #FT_COLR_PAINTFORMAT_TRANSLATE COLR_PAINTFORMAT_TRANSLATE}
  • + *
  • {@link #FT_COLR_PAINTFORMAT_SCALE COLR_PAINTFORMAT_SCALE}
  • + *
  • {@link #FT_COLR_PAINTFORMAT_ROTATE COLR_PAINTFORMAT_ROTATE}
  • + *
  • {@link #FT_COLR_PAINTFORMAT_SKEW COLR_PAINTFORMAT_SKEW}
  • + *
  • {@link #FT_COLR_PAINTFORMAT_COMPOSITE COLR_PAINTFORMAT_COMPOSITE}
  • + *
  • {@link #FT_COLR_PAINT_FORMAT_MAX COLR_PAINT_FORMAT_MAX}
  • + *
  • {@link #FT_COLR_PAINTFORMAT_UNSUPPORTED COLR_PAINTFORMAT_UNSUPPORTED}
  • + *
+ */ + public static final int + FT_COLR_PAINTFORMAT_COLR_LAYERS = 1, + FT_COLR_PAINTFORMAT_SOLID = 2, + FT_COLR_PAINTFORMAT_LINEAR_GRADIENT = 4, + FT_COLR_PAINTFORMAT_RADIAL_GRADIENT = 6, + FT_COLR_PAINTFORMAT_SWEEP_GRADIENT = 8, + FT_COLR_PAINTFORMAT_GLYPH = 10, + FT_COLR_PAINTFORMAT_COLR_GLYPH = 11, + FT_COLR_PAINTFORMAT_TRANSFORM = 12, + FT_COLR_PAINTFORMAT_TRANSLATE = 14, + FT_COLR_PAINTFORMAT_SCALE = 16, + FT_COLR_PAINTFORMAT_ROTATE = 24, + FT_COLR_PAINTFORMAT_SKEW = 28, + FT_COLR_PAINTFORMAT_COMPOSITE = 32, + FT_COLR_PAINT_FORMAT_MAX = 33, + FT_COLR_PAINTFORMAT_UNSUPPORTED = 255; + + /** + * {@code FT_PaintExtend} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_COLR_PAINT_EXTEND_PAD COLR_PAINT_EXTEND_PAD}
  • + *
  • {@link #FT_COLR_PAINT_EXTEND_REPEAT COLR_PAINT_EXTEND_REPEAT}
  • + *
  • {@link #FT_COLR_PAINT_EXTEND_REFLECT COLR_PAINT_EXTEND_REFLECT}
  • + *
+ */ + public static final int + FT_COLR_PAINT_EXTEND_PAD = 0, + FT_COLR_PAINT_EXTEND_REPEAT = 1, + FT_COLR_PAINT_EXTEND_REFLECT = 2; + + /** + * {@code FT_Composite_Mode} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_COLR_COMPOSITE_CLEAR COLR_COMPOSITE_CLEAR}
  • + *
  • {@link #FT_COLR_COMPOSITE_SRC COLR_COMPOSITE_SRC}
  • + *
  • {@link #FT_COLR_COMPOSITE_DEST COLR_COMPOSITE_DEST}
  • + *
  • {@link #FT_COLR_COMPOSITE_SRC_OVER COLR_COMPOSITE_SRC_OVER}
  • + *
  • {@link #FT_COLR_COMPOSITE_DEST_OVER COLR_COMPOSITE_DEST_OVER}
  • + *
  • {@link #FT_COLR_COMPOSITE_SRC_IN COLR_COMPOSITE_SRC_IN}
  • + *
  • {@link #FT_COLR_COMPOSITE_DEST_IN COLR_COMPOSITE_DEST_IN}
  • + *
  • {@link #FT_COLR_COMPOSITE_SRC_OUT COLR_COMPOSITE_SRC_OUT}
  • + *
  • {@link #FT_COLR_COMPOSITE_DEST_OUT COLR_COMPOSITE_DEST_OUT}
  • + *
  • {@link #FT_COLR_COMPOSITE_SRC_ATOP COLR_COMPOSITE_SRC_ATOP}
  • + *
  • {@link #FT_COLR_COMPOSITE_DEST_ATOP COLR_COMPOSITE_DEST_ATOP}
  • + *
  • {@link #FT_COLR_COMPOSITE_XOR COLR_COMPOSITE_XOR}
  • + *
  • {@link #FT_COLR_COMPOSITE_PLUS COLR_COMPOSITE_PLUS}
  • + *
  • {@link #FT_COLR_COMPOSITE_SCREEN COLR_COMPOSITE_SCREEN}
  • + *
  • {@link #FT_COLR_COMPOSITE_OVERLAY COLR_COMPOSITE_OVERLAY}
  • + *
  • {@link #FT_COLR_COMPOSITE_DARKEN COLR_COMPOSITE_DARKEN}
  • + *
  • {@link #FT_COLR_COMPOSITE_LIGHTEN COLR_COMPOSITE_LIGHTEN}
  • + *
  • {@link #FT_COLR_COMPOSITE_COLOR_DODGE COLR_COMPOSITE_COLOR_DODGE}
  • + *
  • {@link #FT_COLR_COMPOSITE_COLOR_BURN COLR_COMPOSITE_COLOR_BURN}
  • + *
  • {@link #FT_COLR_COMPOSITE_HARD_LIGHT COLR_COMPOSITE_HARD_LIGHT}
  • + *
  • {@link #FT_COLR_COMPOSITE_SOFT_LIGHT COLR_COMPOSITE_SOFT_LIGHT}
  • + *
  • {@link #FT_COLR_COMPOSITE_DIFFERENCE COLR_COMPOSITE_DIFFERENCE}
  • + *
  • {@link #FT_COLR_COMPOSITE_EXCLUSION COLR_COMPOSITE_EXCLUSION}
  • + *
  • {@link #FT_COLR_COMPOSITE_MULTIPLY COLR_COMPOSITE_MULTIPLY}
  • + *
  • {@link #FT_COLR_COMPOSITE_HSL_HUE COLR_COMPOSITE_HSL_HUE}
  • + *
  • {@link #FT_COLR_COMPOSITE_HSL_SATURATION COLR_COMPOSITE_HSL_SATURATION}
  • + *
  • {@link #FT_COLR_COMPOSITE_HSL_COLOR COLR_COMPOSITE_HSL_COLOR}
  • + *
  • {@link #FT_COLR_COMPOSITE_HSL_LUMINOSITY COLR_COMPOSITE_HSL_LUMINOSITY}
  • + *
  • {@link #FT_COLR_COMPOSITE_MAX COLR_COMPOSITE_MAX}
  • + *
+ */ + public static final int + FT_COLR_COMPOSITE_CLEAR = 0, + FT_COLR_COMPOSITE_SRC = 1, + FT_COLR_COMPOSITE_DEST = 2, + FT_COLR_COMPOSITE_SRC_OVER = 3, + FT_COLR_COMPOSITE_DEST_OVER = 4, + FT_COLR_COMPOSITE_SRC_IN = 5, + FT_COLR_COMPOSITE_DEST_IN = 6, + FT_COLR_COMPOSITE_SRC_OUT = 7, + FT_COLR_COMPOSITE_DEST_OUT = 8, + FT_COLR_COMPOSITE_SRC_ATOP = 9, + FT_COLR_COMPOSITE_DEST_ATOP = 10, + FT_COLR_COMPOSITE_XOR = 11, + FT_COLR_COMPOSITE_PLUS = 12, + FT_COLR_COMPOSITE_SCREEN = 13, + FT_COLR_COMPOSITE_OVERLAY = 14, + FT_COLR_COMPOSITE_DARKEN = 15, + FT_COLR_COMPOSITE_LIGHTEN = 16, + FT_COLR_COMPOSITE_COLOR_DODGE = 17, + FT_COLR_COMPOSITE_COLOR_BURN = 18, + FT_COLR_COMPOSITE_HARD_LIGHT = 19, + FT_COLR_COMPOSITE_SOFT_LIGHT = 20, + FT_COLR_COMPOSITE_DIFFERENCE = 21, + FT_COLR_COMPOSITE_EXCLUSION = 22, + FT_COLR_COMPOSITE_MULTIPLY = 23, + FT_COLR_COMPOSITE_HSL_HUE = 24, + FT_COLR_COMPOSITE_HSL_SATURATION = 25, + FT_COLR_COMPOSITE_HSL_COLOR = 26, + FT_COLR_COMPOSITE_HSL_LUMINOSITY = 27, + FT_COLR_COMPOSITE_MAX = 28; + + /** + * {@code FT_Color_Root_Transform} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_COLOR_INCLUDE_ROOT_TRANSFORM COLOR_INCLUDE_ROOT_TRANSFORM}
  • + *
  • {@link #FT_COLOR_NO_ROOT_TRANSFORM COLOR_NO_ROOT_TRANSFORM}
  • + *
  • {@link #FT_COLOR_ROOT_TRANSFORM_MAX COLOR_ROOT_TRANSFORM_MAX}
  • + *
+ */ + public static final int + FT_COLOR_INCLUDE_ROOT_TRANSFORM = 0, + FT_COLOR_NO_ROOT_TRANSFORM = 1, + FT_COLOR_ROOT_TRANSFORM_MAX = 2; + + /** + * {@code FT_HINTING_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_HINTING_FREETYPE HINTING_FREETYPE}
  • + *
  • {@link #FT_HINTING_ADOBE HINTING_ADOBE}
  • + *
+ */ + public static final int + FT_HINTING_FREETYPE = 0, + FT_HINTING_ADOBE = 1; + + public static final int TT_INTERPRETER_VERSION_35 = 35; + + public static final int TT_INTERPRETER_VERSION_38 = 38; + + public static final int TT_INTERPRETER_VERSION_40 = 40; + + /** + * {@code FT_AUTOHINTER_SCRIPT_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_AUTOHINTER_SCRIPT_NONE AUTOHINTER_SCRIPT_NONE}
  • + *
  • {@link #FT_AUTOHINTER_SCRIPT_LATIN AUTOHINTER_SCRIPT_LATIN}
  • + *
  • {@link #FT_AUTOHINTER_SCRIPT_CJK AUTOHINTER_SCRIPT_CJK}
  • + *
  • {@link #FT_AUTOHINTER_SCRIPT_INDIC AUTOHINTER_SCRIPT_INDIC}
  • + *
+ */ + public static final int + FT_AUTOHINTER_SCRIPT_NONE = 0, + FT_AUTOHINTER_SCRIPT_LATIN = 1, + FT_AUTOHINTER_SCRIPT_CJK = 2, + FT_AUTOHINTER_SCRIPT_INDIC = 3; + + /** + * {@code FT_Err_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_Err_Ok Err_Ok}
  • + *
  • {@link #FT_Err_Cannot_Open_Resource Err_Cannot_Open_Resource}
  • + *
  • {@link #FT_Err_Unknown_File_Format Err_Unknown_File_Format}
  • + *
  • {@link #FT_Err_Invalid_File_Format Err_Invalid_File_Format}
  • + *
  • {@link #FT_Err_Invalid_Version Err_Invalid_Version}
  • + *
  • {@link #FT_Err_Lower_Module_Version Err_Lower_Module_Version}
  • + *
  • {@link #FT_Err_Invalid_Argument Err_Invalid_Argument}
  • + *
  • {@link #FT_Err_Unimplemented_Feature Err_Unimplemented_Feature}
  • + *
  • {@link #FT_Err_Invalid_Table Err_Invalid_Table}
  • + *
  • {@link #FT_Err_Invalid_Offset Err_Invalid_Offset}
  • + *
  • {@link #FT_Err_Array_Too_Large Err_Array_Too_Large}
  • + *
  • {@link #FT_Err_Missing_Module Err_Missing_Module}
  • + *
  • {@link #FT_Err_Missing_Property Err_Missing_Property}
  • + *
  • {@link #FT_Err_Invalid_Glyph_Index Err_Invalid_Glyph_Index}
  • + *
  • {@link #FT_Err_Invalid_Character_Code Err_Invalid_Character_Code}
  • + *
  • {@link #FT_Err_Invalid_Glyph_Format Err_Invalid_Glyph_Format}
  • + *
  • {@link #FT_Err_Cannot_Render_Glyph Err_Cannot_Render_Glyph}
  • + *
  • {@link #FT_Err_Invalid_Outline Err_Invalid_Outline}
  • + *
  • {@link #FT_Err_Invalid_Composite Err_Invalid_Composite}
  • + *
  • {@link #FT_Err_Too_Many_Hints Err_Too_Many_Hints}
  • + *
  • {@link #FT_Err_Invalid_Pixel_Size Err_Invalid_Pixel_Size}
  • + *
  • {@link #FT_Err_Invalid_SVG_Document Err_Invalid_SVG_Document}
  • + *
  • {@link #FT_Err_Invalid_Handle Err_Invalid_Handle}
  • + *
  • {@link #FT_Err_Invalid_Library_Handle Err_Invalid_Library_Handle}
  • + *
  • {@link #FT_Err_Invalid_Driver_Handle Err_Invalid_Driver_Handle}
  • + *
  • {@link #FT_Err_Invalid_Face_Handle Err_Invalid_Face_Handle}
  • + *
  • {@link #FT_Err_Invalid_Size_Handle Err_Invalid_Size_Handle}
  • + *
  • {@link #FT_Err_Invalid_Slot_Handle Err_Invalid_Slot_Handle}
  • + *
  • {@link #FT_Err_Invalid_CharMap_Handle Err_Invalid_CharMap_Handle}
  • + *
  • {@link #FT_Err_Invalid_Cache_Handle Err_Invalid_Cache_Handle}
  • + *
  • {@link #FT_Err_Invalid_Stream_Handle Err_Invalid_Stream_Handle}
  • + *
  • {@link #FT_Err_Too_Many_Drivers Err_Too_Many_Drivers}
  • + *
  • {@link #FT_Err_Too_Many_Extensions Err_Too_Many_Extensions}
  • + *
  • {@link #FT_Err_Out_Of_Memory Err_Out_Of_Memory}
  • + *
  • {@link #FT_Err_Unlisted_Object Err_Unlisted_Object}
  • + *
  • {@link #FT_Err_Cannot_Open_Stream Err_Cannot_Open_Stream}
  • + *
  • {@link #FT_Err_Invalid_Stream_Seek Err_Invalid_Stream_Seek}
  • + *
  • {@link #FT_Err_Invalid_Stream_Skip Err_Invalid_Stream_Skip}
  • + *
  • {@link #FT_Err_Invalid_Stream_Read Err_Invalid_Stream_Read}
  • + *
  • {@link #FT_Err_Invalid_Stream_Operation Err_Invalid_Stream_Operation}
  • + *
  • {@link #FT_Err_Invalid_Frame_Operation Err_Invalid_Frame_Operation}
  • + *
  • {@link #FT_Err_Nested_Frame_Access Err_Nested_Frame_Access}
  • + *
  • {@link #FT_Err_Invalid_Frame_Read Err_Invalid_Frame_Read}
  • + *
  • {@link #FT_Err_Raster_Uninitialized Err_Raster_Uninitialized}
  • + *
  • {@link #FT_Err_Raster_Corrupted Err_Raster_Corrupted}
  • + *
  • {@link #FT_Err_Raster_Overflow Err_Raster_Overflow}
  • + *
  • {@link #FT_Err_Raster_Negative_Height Err_Raster_Negative_Height}
  • + *
  • {@link #FT_Err_Too_Many_Caches Err_Too_Many_Caches}
  • + *
  • {@link #FT_Err_Invalid_Opcode Err_Invalid_Opcode}
  • + *
  • {@link #FT_Err_Too_Few_Arguments Err_Too_Few_Arguments}
  • + *
  • {@link #FT_Err_Stack_Overflow Err_Stack_Overflow}
  • + *
  • {@link #FT_Err_Code_Overflow Err_Code_Overflow}
  • + *
  • {@link #FT_Err_Bad_Argument Err_Bad_Argument}
  • + *
  • {@link #FT_Err_Divide_By_Zero Err_Divide_By_Zero}
  • + *
  • {@link #FT_Err_Invalid_Reference Err_Invalid_Reference}
  • + *
  • {@link #FT_Err_Debug_OpCode Err_Debug_OpCode}
  • + *
  • {@link #FT_Err_ENDF_In_Exec_Stream Err_ENDF_In_Exec_Stream}
  • + *
  • {@link #FT_Err_Nested_DEFS Err_Nested_DEFS}
  • + *
  • {@link #FT_Err_Invalid_CodeRange Err_Invalid_CodeRange}
  • + *
  • {@link #FT_Err_Execution_Too_Long Err_Execution_Too_Long}
  • + *
  • {@link #FT_Err_Too_Many_Function_Defs Err_Too_Many_Function_Defs}
  • + *
  • {@link #FT_Err_Too_Many_Instruction_Defs Err_Too_Many_Instruction_Defs}
  • + *
  • {@link #FT_Err_Table_Missing Err_Table_Missing}
  • + *
  • {@link #FT_Err_Horiz_Header_Missing Err_Horiz_Header_Missing}
  • + *
  • {@link #FT_Err_Locations_Missing Err_Locations_Missing}
  • + *
  • {@link #FT_Err_Name_Table_Missing Err_Name_Table_Missing}
  • + *
  • {@link #FT_Err_CMap_Table_Missing Err_CMap_Table_Missing}
  • + *
  • {@link #FT_Err_Hmtx_Table_Missing Err_Hmtx_Table_Missing}
  • + *
  • {@link #FT_Err_Post_Table_Missing Err_Post_Table_Missing}
  • + *
  • {@link #FT_Err_Invalid_Horiz_Metrics Err_Invalid_Horiz_Metrics}
  • + *
  • {@link #FT_Err_Invalid_CharMap_Format Err_Invalid_CharMap_Format}
  • + *
  • {@link #FT_Err_Invalid_PPem Err_Invalid_PPem}
  • + *
  • {@link #FT_Err_Invalid_Vert_Metrics Err_Invalid_Vert_Metrics}
  • + *
  • {@link #FT_Err_Could_Not_Find_Context Err_Could_Not_Find_Context}
  • + *
  • {@link #FT_Err_Invalid_Post_Table_Format Err_Invalid_Post_Table_Format}
  • + *
  • {@link #FT_Err_Invalid_Post_Table Err_Invalid_Post_Table}
  • + *
  • {@link #FT_Err_DEF_In_Glyf_Bytecode Err_DEF_In_Glyf_Bytecode}
  • + *
  • {@link #FT_Err_Missing_Bitmap Err_Missing_Bitmap}
  • + *
  • {@link #FT_Err_Missing_SVG_Hooks Err_Missing_SVG_Hooks}
  • + *
  • {@link #FT_Err_Syntax_Error Err_Syntax_Error}
  • + *
  • {@link #FT_Err_Stack_Underflow Err_Stack_Underflow}
  • + *
  • {@link #FT_Err_Ignore Err_Ignore}
  • + *
  • {@link #FT_Err_No_Unicode_Glyph_Name Err_No_Unicode_Glyph_Name}
  • + *
  • {@link #FT_Err_Glyph_Too_Big Err_Glyph_Too_Big}
  • + *
  • {@link #FT_Err_Missing_Startfont_Field Err_Missing_Startfont_Field}
  • + *
  • {@link #FT_Err_Missing_Font_Field Err_Missing_Font_Field}
  • + *
  • {@link #FT_Err_Missing_Size_Field Err_Missing_Size_Field}
  • + *
  • {@link #FT_Err_Missing_Fontboundingbox_Field Err_Missing_Fontboundingbox_Field}
  • + *
  • {@link #FT_Err_Missing_Chars_Field Err_Missing_Chars_Field}
  • + *
  • {@link #FT_Err_Missing_Startchar_Field Err_Missing_Startchar_Field}
  • + *
  • {@link #FT_Err_Missing_Encoding_Field Err_Missing_Encoding_Field}
  • + *
  • {@link #FT_Err_Missing_Bbx_Field Err_Missing_Bbx_Field}
  • + *
  • {@link #FT_Err_Bbx_Too_Big Err_Bbx_Too_Big}
  • + *
  • {@link #FT_Err_Corrupted_Font_Header Err_Corrupted_Font_Header}
  • + *
  • {@link #FT_Err_Corrupted_Font_Glyphs Err_Corrupted_Font_Glyphs}
  • + *
  • {@link #FT_Err_Max Err_Max}
  • + *
+ */ + public static final int + FT_Err_Ok = 0x00, + FT_Err_Cannot_Open_Resource = 0x01, + FT_Err_Unknown_File_Format = 0x02, + FT_Err_Invalid_File_Format = 0x03, + FT_Err_Invalid_Version = 0x04, + FT_Err_Lower_Module_Version = 0x05, + FT_Err_Invalid_Argument = 0x06, + FT_Err_Unimplemented_Feature = 0x07, + FT_Err_Invalid_Table = 0x08, + FT_Err_Invalid_Offset = 0x09, + FT_Err_Array_Too_Large = 0x0A, + FT_Err_Missing_Module = 0x0B, + FT_Err_Missing_Property = 0x0C, + FT_Err_Invalid_Glyph_Index = 0x10, + FT_Err_Invalid_Character_Code = 0x11, + FT_Err_Invalid_Glyph_Format = 0x12, + FT_Err_Cannot_Render_Glyph = 0x13, + FT_Err_Invalid_Outline = 0x14, + FT_Err_Invalid_Composite = 0x15, + FT_Err_Too_Many_Hints = 0x16, + FT_Err_Invalid_Pixel_Size = 0x17, + FT_Err_Invalid_SVG_Document = 0x18, + FT_Err_Invalid_Handle = 0x20, + FT_Err_Invalid_Library_Handle = 0x21, + FT_Err_Invalid_Driver_Handle = 0x22, + FT_Err_Invalid_Face_Handle = 0x23, + FT_Err_Invalid_Size_Handle = 0x24, + FT_Err_Invalid_Slot_Handle = 0x25, + FT_Err_Invalid_CharMap_Handle = 0x26, + FT_Err_Invalid_Cache_Handle = 0x27, + FT_Err_Invalid_Stream_Handle = 0x28, + FT_Err_Too_Many_Drivers = 0x30, + FT_Err_Too_Many_Extensions = 0x31, + FT_Err_Out_Of_Memory = 0x40, + FT_Err_Unlisted_Object = 0x41, + FT_Err_Cannot_Open_Stream = 0x51, + FT_Err_Invalid_Stream_Seek = 0x52, + FT_Err_Invalid_Stream_Skip = 0x53, + FT_Err_Invalid_Stream_Read = 0x54, + FT_Err_Invalid_Stream_Operation = 0x55, + FT_Err_Invalid_Frame_Operation = 0x56, + FT_Err_Nested_Frame_Access = 0x57, + FT_Err_Invalid_Frame_Read = 0x58, + FT_Err_Raster_Uninitialized = 0x60, + FT_Err_Raster_Corrupted = 0x61, + FT_Err_Raster_Overflow = 0x62, + FT_Err_Raster_Negative_Height = 0x63, + FT_Err_Too_Many_Caches = 0x70, + FT_Err_Invalid_Opcode = 0x80, + FT_Err_Too_Few_Arguments = 0x81, + FT_Err_Stack_Overflow = 0x82, + FT_Err_Code_Overflow = 0x83, + FT_Err_Bad_Argument = 0x84, + FT_Err_Divide_By_Zero = 0x85, + FT_Err_Invalid_Reference = 0x86, + FT_Err_Debug_OpCode = 0x87, + FT_Err_ENDF_In_Exec_Stream = 0x88, + FT_Err_Nested_DEFS = 0x89, + FT_Err_Invalid_CodeRange = 0x8A, + FT_Err_Execution_Too_Long = 0x8B, + FT_Err_Too_Many_Function_Defs = 0x8C, + FT_Err_Too_Many_Instruction_Defs = 0x8D, + FT_Err_Table_Missing = 0x8E, + FT_Err_Horiz_Header_Missing = 0x8F, + FT_Err_Locations_Missing = 0x90, + FT_Err_Name_Table_Missing = 0x91, + FT_Err_CMap_Table_Missing = 0x92, + FT_Err_Hmtx_Table_Missing = 0x93, + FT_Err_Post_Table_Missing = 0x94, + FT_Err_Invalid_Horiz_Metrics = 0x95, + FT_Err_Invalid_CharMap_Format = 0x96, + FT_Err_Invalid_PPem = 0x97, + FT_Err_Invalid_Vert_Metrics = 0x98, + FT_Err_Could_Not_Find_Context = 0x99, + FT_Err_Invalid_Post_Table_Format = 0x9A, + FT_Err_Invalid_Post_Table = 0x9B, + FT_Err_DEF_In_Glyf_Bytecode = 0x9C, + FT_Err_Missing_Bitmap = 0x9D, + FT_Err_Missing_SVG_Hooks = 0x9E, + FT_Err_Syntax_Error = 0xA0, + FT_Err_Stack_Underflow = 0xA1, + FT_Err_Ignore = 0xA2, + FT_Err_No_Unicode_Glyph_Name = 0xA3, + FT_Err_Glyph_Too_Big = 0xA4, + FT_Err_Missing_Startfont_Field = 0xB0, + FT_Err_Missing_Font_Field = 0xB1, + FT_Err_Missing_Size_Field = 0xB2, + FT_Err_Missing_Fontboundingbox_Field = 0xB3, + FT_Err_Missing_Chars_Field = 0xB4, + FT_Err_Missing_Startchar_Field = 0xB5, + FT_Err_Missing_Encoding_Field = 0xB6, + FT_Err_Missing_Bbx_Field = 0xB7, + FT_Err_Bbx_Too_Big = 0xB8, + FT_Err_Corrupted_Font_Header = 0xB9, + FT_Err_Corrupted_Font_Glyphs = 0xBA, + FT_Err_Max = 187; + + /** + * {@code FT_GASP_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_GASP_NO_TABLE GASP_NO_TABLE}
  • + *
  • {@link #FT_GASP_DO_GRIDFIT GASP_DO_GRIDFIT}
  • + *
  • {@link #FT_GASP_DO_GRAY GASP_DO_GRAY}
  • + *
  • {@link #FT_GASP_SYMMETRIC_GRIDFIT GASP_SYMMETRIC_GRIDFIT}
  • + *
  • {@link #FT_GASP_SYMMETRIC_SMOOTHING GASP_SYMMETRIC_SMOOTHING}
  • + *
+ */ + public static final int + FT_GASP_NO_TABLE = -1, + FT_GASP_DO_GRIDFIT = 0x01, + FT_GASP_DO_GRAY = 0x02, + FT_GASP_SYMMETRIC_GRIDFIT = 0x04, + FT_GASP_SYMMETRIC_SMOOTHING = 0x08; + + /** + * {@code FT_Glyph_BBox_Mode} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_GLYPH_BBOX_UNSCALED GLYPH_BBOX_UNSCALED}
  • + *
  • {@link #FT_GLYPH_BBOX_SUBPIXELS GLYPH_BBOX_SUBPIXELS}
  • + *
  • {@link #FT_GLYPH_BBOX_GRIDFIT GLYPH_BBOX_GRIDFIT}
  • + *
  • {@link #FT_GLYPH_BBOX_TRUNCATE GLYPH_BBOX_TRUNCATE}
  • + *
  • {@link #FT_GLYPH_BBOX_PIXELS GLYPH_BBOX_PIXELS}
  • + *
+ */ + public static final int + FT_GLYPH_BBOX_UNSCALED = 0, + FT_GLYPH_BBOX_SUBPIXELS = 0, + FT_GLYPH_BBOX_GRIDFIT = 1, + FT_GLYPH_BBOX_TRUNCATE = 2, + FT_GLYPH_BBOX_PIXELS = 3; + + public static final int FT_VALIDATE_feat_INDEX = 0; + + public static final int FT_VALIDATE_mort_INDEX = 1; + + public static final int FT_VALIDATE_morx_INDEX = 2; + + public static final int FT_VALIDATE_bsln_INDEX = 3; + + public static final int FT_VALIDATE_just_INDEX = 4; + + public static final int FT_VALIDATE_kern_INDEX = 5; + + public static final int FT_VALIDATE_opbd_INDEX = 6; + + public static final int FT_VALIDATE_trak_INDEX = 7; + + public static final int FT_VALIDATE_prop_INDEX = 8; + + public static final int FT_VALIDATE_lcar_INDEX = 9; + + public static final int FT_VALIDATE_GX_LAST_INDEX = FT_VALIDATE_lcar_INDEX; + + public static final int FT_VALIDATE_GX_LENGTH = FT_VALIDATE_GX_LAST_INDEX + 1; + + public static final int FT_VALIDATE_GX_START = 0x4000; + + public static final int FT_VALIDATE_feat = FT_VALIDATE_GX_START << 0; + + public static final int FT_VALIDATE_mort = FT_VALIDATE_GX_START << 1; + + public static final int FT_VALIDATE_morx = FT_VALIDATE_GX_START << 2; + + public static final int FT_VALIDATE_bsln = FT_VALIDATE_GX_START << 3; + + public static final int FT_VALIDATE_just = FT_VALIDATE_GX_START << 4; + + public static final int FT_VALIDATE_kern = FT_VALIDATE_GX_START << 5; + + public static final int FT_VALIDATE_opbd = FT_VALIDATE_GX_START << 6; + + public static final int FT_VALIDATE_trak = FT_VALIDATE_GX_START << 7; + + public static final int FT_VALIDATE_prop = FT_VALIDATE_GX_START << 8; + + public static final int FT_VALIDATE_lcar = FT_VALIDATE_GX_START << 9; + + public static final int FT_FT_VALIDATE_GX = + FT_VALIDATE_feat | + FT_VALIDATE_mort | + FT_VALIDATE_morx | + FT_VALIDATE_bsln | + FT_VALIDATE_just | + FT_VALIDATE_kern | + FT_VALIDATE_opbd | + FT_VALIDATE_trak | + FT_VALIDATE_prop | + FT_VALIDATE_lcar; + + /** + * {@code FT_VALIDATE_CKERNXXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_VALIDATE_MS VALIDATE_MS}
  • + *
  • {@link #FT_VALIDATE_APPLE VALIDATE_APPLE}
  • + *
  • {@link #FT_VALIDATE_CKERN VALIDATE_CKERN}
  • + *
+ */ + public static final int + FT_VALIDATE_MS = FT_VALIDATE_GX_START << 0, + FT_VALIDATE_APPLE = FT_VALIDATE_GX_START << 1, + FT_VALIDATE_CKERN = FT_VALIDATE_MS | FT_VALIDATE_APPLE; + + /** + * {@code FT_Pixel_Mode} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_PIXEL_MODE_NONE PIXEL_MODE_NONE}
  • + *
  • {@link #FT_PIXEL_MODE_MONO PIXEL_MODE_MONO}
  • + *
  • {@link #FT_PIXEL_MODE_GRAY PIXEL_MODE_GRAY}
  • + *
  • {@link #FT_PIXEL_MODE_GRAY2 PIXEL_MODE_GRAY2}
  • + *
  • {@link #FT_PIXEL_MODE_GRAY4 PIXEL_MODE_GRAY4}
  • + *
  • {@link #FT_PIXEL_MODE_LCD PIXEL_MODE_LCD}
  • + *
  • {@link #FT_PIXEL_MODE_LCD_V PIXEL_MODE_LCD_V}
  • + *
  • {@link #FT_PIXEL_MODE_BGRA PIXEL_MODE_BGRA}
  • + *
  • {@link #FT_PIXEL_MODE_MAX PIXEL_MODE_MAX}
  • + *
+ */ + public static final int + FT_PIXEL_MODE_NONE = 0, + FT_PIXEL_MODE_MONO = 1, + FT_PIXEL_MODE_GRAY = 2, + FT_PIXEL_MODE_GRAY2 = 3, + FT_PIXEL_MODE_GRAY4 = 4, + FT_PIXEL_MODE_LCD = 5, + FT_PIXEL_MODE_LCD_V = 6, + FT_PIXEL_MODE_BGRA = 7, + FT_PIXEL_MODE_MAX = 8; + + public static final int + FT_OUTLINE_CONTOURS_MAX = 0xFFFF, + FT_OUTLINE_POINTS_MAX = 0xFFFF; + + /** + *
Enum values:
+ * + *
    + *
  • {@link #FT_OUTLINE_NONE OUTLINE_NONE}
  • + *
  • {@link #FT_OUTLINE_OWNER OUTLINE_OWNER}
  • + *
  • {@link #FT_OUTLINE_EVEN_ODD_FILL OUTLINE_EVEN_ODD_FILL}
  • + *
  • {@link #FT_OUTLINE_REVERSE_FILL OUTLINE_REVERSE_FILL}
  • + *
  • {@link #FT_OUTLINE_IGNORE_DROPOUTS OUTLINE_IGNORE_DROPOUTS}
  • + *
  • {@link #FT_OUTLINE_SMART_DROPOUTS OUTLINE_SMART_DROPOUTS}
  • + *
  • {@link #FT_OUTLINE_INCLUDE_STUBS OUTLINE_INCLUDE_STUBS}
  • + *
  • {@link #FT_OUTLINE_OVERLAP OUTLINE_OVERLAP}
  • + *
  • {@link #FT_OUTLINE_HIGH_PRECISION OUTLINE_HIGH_PRECISION}
  • + *
  • {@link #FT_OUTLINE_SINGLE_PASS OUTLINE_SINGLE_PASS}
  • + *
+ */ + public static final int + FT_OUTLINE_NONE = 0x0, + FT_OUTLINE_OWNER = 0x1, + FT_OUTLINE_EVEN_ODD_FILL = 0x2, + FT_OUTLINE_REVERSE_FILL = 0x4, + FT_OUTLINE_IGNORE_DROPOUTS = 0x8, + FT_OUTLINE_SMART_DROPOUTS = 0x10, + FT_OUTLINE_INCLUDE_STUBS = 0x20, + FT_OUTLINE_OVERLAP = 0x40, + FT_OUTLINE_HIGH_PRECISION = 0x100, + FT_OUTLINE_SINGLE_PASS = 0x200; + + public static final int + FT_CURVE_TAG_ON = 0x01, + FT_CURVE_TAG_CONIC = 0x00, + FT_CURVE_TAG_CUBIC = 0x02, + FT_CURVE_TAG_HAS_SCANMODE = 0x04, + FT_CURVE_TAG_TOUCH_X = 0x08, + FT_CURVE_TAG_TOUCH_Y = 0x10, + FT_CURVE_TAG_TOUCH_BOTH = FT_CURVE_TAG_TOUCH_X | FT_CURVE_TAG_TOUCH_Y; + + /** + * {@code FT_Glyph_Format} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_GLYPH_FORMAT_NONE GLYPH_FORMAT_NONE}
  • + *
  • {@link #FT_GLYPH_FORMAT_COMPOSITE GLYPH_FORMAT_COMPOSITE}
  • + *
  • {@link #FT_GLYPH_FORMAT_BITMAP GLYPH_FORMAT_BITMAP}
  • + *
  • {@link #FT_GLYPH_FORMAT_OUTLINE GLYPH_FORMAT_OUTLINE}
  • + *
  • {@link #FT_GLYPH_FORMAT_PLOTTER GLYPH_FORMAT_PLOTTER}
  • + *
  • {@link #FT_GLYPH_FORMAT_SVG GLYPH_FORMAT_SVG}
  • + *
+ */ + public static final int + FT_GLYPH_FORMAT_NONE = FT_IMAGE_TAG( 0, 0, 0, 0 ), + FT_GLYPH_FORMAT_COMPOSITE = FT_IMAGE_TAG( 'c', 'o', 'm', 'p' ), + FT_GLYPH_FORMAT_BITMAP = FT_IMAGE_TAG( 'b', 'i', 't', 's' ), + FT_GLYPH_FORMAT_OUTLINE = FT_IMAGE_TAG( 'o', 'u', 't', 'l' ), + FT_GLYPH_FORMAT_PLOTTER = FT_IMAGE_TAG( 'p', 'l', 'o', 't' ), + FT_GLYPH_FORMAT_SVG = FT_IMAGE_TAG( 'S', 'V', 'G', ' ' ); + + /** + * {@code FT_RASTER_FLAG_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_RASTER_FLAG_DEFAULT RASTER_FLAG_DEFAULT}
  • + *
  • {@link #FT_RASTER_FLAG_AA RASTER_FLAG_AA}
  • + *
  • {@link #FT_RASTER_FLAG_DIRECT RASTER_FLAG_DIRECT}
  • + *
  • {@link #FT_RASTER_FLAG_CLIP RASTER_FLAG_CLIP}
  • + *
  • {@link #FT_RASTER_FLAG_SDF RASTER_FLAG_SDF}
  • + *
+ */ + public static final int + FT_RASTER_FLAG_DEFAULT = 0x0, + FT_RASTER_FLAG_AA = 0x1, + FT_RASTER_FLAG_DIRECT = 0x2, + FT_RASTER_FLAG_CLIP = 0x4, + FT_RASTER_FLAG_SDF = 0x8; + + /** + * {@code FT_LcdFilter} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_LCD_FILTER_NONE LCD_FILTER_NONE}
  • + *
  • {@link #FT_LCD_FILTER_DEFAULT LCD_FILTER_DEFAULT}
  • + *
  • {@link #FT_LCD_FILTER_LIGHT LCD_FILTER_LIGHT}
  • + *
  • {@link #FT_LCD_FILTER_LEGACY1 LCD_FILTER_LEGACY1}
  • + *
  • {@link #FT_LCD_FILTER_LEGACY LCD_FILTER_LEGACY}
  • + *
  • {@link #FT_LCD_FILTER_MAX LCD_FILTER_MAX}
  • + *
+ */ + public static final int + FT_LCD_FILTER_NONE = 0, + FT_LCD_FILTER_DEFAULT = 1, + FT_LCD_FILTER_LIGHT = 2, + FT_LCD_FILTER_LEGACY1 = 3, + FT_LCD_FILTER_LEGACY = 16, + FT_LCD_FILTER_MAX = 17; + + public static final int FT_LCD_FILTER_FIVE_TAPS = 5; + + public static final int FT_VAR_AXIS_FLAG_HIDDEN = 1; + + public static final int FT_MODULE_FONT_DRIVER = 1; + + public static final int FT_MODULE_RENDERER = 2; + + public static final int FT_MODULE_HINTER = 4; + + public static final int FT_MODULE_STYLER = 8; + + public static final int FT_MODULE_DRIVER_SCALABLE = 0x100; + + public static final int FT_MODULE_DRIVER_NO_OUTLINES = 0x200; + + public static final int FT_MODULE_DRIVER_HAS_HINTER = 0x400; + + public static final int FT_MODULE_DRIVER_HINTS_LIGHTLY = 0x800; + + public static final int FT_DEBUG_HOOK_TRUETYPE = 0; + + /** + * {@code FT_TrueTypeEngineType} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_TRUETYPE_ENGINE_TYPE_NONE TRUETYPE_ENGINE_TYPE_NONE}
  • + *
  • {@link #FT_TRUETYPE_ENGINE_TYPE_UNPATENTED TRUETYPE_ENGINE_TYPE_UNPATENTED}
  • + *
  • {@link #FT_TRUETYPE_ENGINE_TYPE_PATENTED TRUETYPE_ENGINE_TYPE_PATENTED}
  • + *
+ */ + public static final int + FT_TRUETYPE_ENGINE_TYPE_NONE = 0, + FT_TRUETYPE_ENGINE_TYPE_UNPATENTED = 1, + FT_TRUETYPE_ENGINE_TYPE_PATENTED = 2; + + /** + * {@code FT_Mod_Err_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_Mod_Err_Base Mod_Err_Base}
  • + *
  • {@link #FT_Mod_Err_Autofit Mod_Err_Autofit}
  • + *
  • {@link #FT_Mod_Err_BDF Mod_Err_BDF}
  • + *
  • {@link #FT_Mod_Err_Bzip2 Mod_Err_Bzip2}
  • + *
  • {@link #FT_Mod_Err_Cache Mod_Err_Cache}
  • + *
  • {@link #FT_Mod_Err_CFF Mod_Err_CFF}
  • + *
  • {@link #FT_Mod_Err_CID Mod_Err_CID}
  • + *
  • {@link #FT_Mod_Err_Gzip Mod_Err_Gzip}
  • + *
  • {@link #FT_Mod_Err_LZW Mod_Err_LZW}
  • + *
  • {@link #FT_Mod_Err_OTvalid Mod_Err_OTvalid}
  • + *
  • {@link #FT_Mod_Err_PCF Mod_Err_PCF}
  • + *
  • {@link #FT_Mod_Err_PFR Mod_Err_PFR}
  • + *
  • {@link #FT_Mod_Err_PSaux Mod_Err_PSaux}
  • + *
  • {@link #FT_Mod_Err_PShinter Mod_Err_PShinter}
  • + *
  • {@link #FT_Mod_Err_PSnames Mod_Err_PSnames}
  • + *
  • {@link #FT_Mod_Err_Raster Mod_Err_Raster}
  • + *
  • {@link #FT_Mod_Err_SFNT Mod_Err_SFNT}
  • + *
  • {@link #FT_Mod_Err_Smooth Mod_Err_Smooth}
  • + *
  • {@link #FT_Mod_Err_TrueType Mod_Err_TrueType}
  • + *
  • {@link #FT_Mod_Err_Type1 Mod_Err_Type1}
  • + *
  • {@link #FT_Mod_Err_Type42 Mod_Err_Type42}
  • + *
  • {@link #FT_Mod_Err_Winfonts Mod_Err_Winfonts}
  • + *
  • {@link #FT_Mod_Err_GXvalid Mod_Err_GXvalid}
  • + *
  • {@link #FT_Mod_Err_Sdf Mod_Err_Sdf}
  • + *
  • {@link #FT_Mod_Err_Max Mod_Err_Max}
  • + *
+ */ + public static final int + FT_Mod_Err_Base = 0x00, + FT_Mod_Err_Autofit = 0x100, + FT_Mod_Err_BDF = 0x200, + FT_Mod_Err_Bzip2 = 0x300, + FT_Mod_Err_Cache = 0x400, + FT_Mod_Err_CFF = 0x500, + FT_Mod_Err_CID = 0x600, + FT_Mod_Err_Gzip = 0x700, + FT_Mod_Err_LZW = 0x800, + FT_Mod_Err_OTvalid = 0x900, + FT_Mod_Err_PCF = 0xA00, + FT_Mod_Err_PFR = 0xB00, + FT_Mod_Err_PSaux = 0xC00, + FT_Mod_Err_PShinter = 0xD00, + FT_Mod_Err_PSnames = 0xE00, + FT_Mod_Err_Raster = 0xF00, + FT_Mod_Err_SFNT = 0x1000, + FT_Mod_Err_Smooth = 0x1100, + FT_Mod_Err_TrueType = 0x1200, + FT_Mod_Err_Type1 = 0x1300, + FT_Mod_Err_Type42 = 0x1400, + FT_Mod_Err_Winfonts = 0x1500, + FT_Mod_Err_GXvalid = 0x1600, + FT_Mod_Err_Sdf = 0x1700, + FT_Mod_Err_Max = FT_Mod_Err_Sdf + 1; + + /** + * {@code FT_VALIDATE_OTXXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_VALIDATE_BASE VALIDATE_BASE}
  • + *
  • {@link #FT_VALIDATE_GDEF VALIDATE_GDEF}
  • + *
  • {@link #FT_VALIDATE_GPOS VALIDATE_GPOS}
  • + *
  • {@link #FT_VALIDATE_GSUB VALIDATE_GSUB}
  • + *
  • {@link #FT_VALIDATE_JSTF VALIDATE_JSTF}
  • + *
  • {@link #FT_VALIDATE_MATH VALIDATE_MATH}
  • + *
  • {@link #FT_VALIDATE_OT VALIDATE_OT}
  • + *
+ */ + public static final int + FT_VALIDATE_BASE = 0x0100, + FT_VALIDATE_GDEF = 0x0200, + FT_VALIDATE_GPOS = 0x0400, + FT_VALIDATE_GSUB = 0x0800, + FT_VALIDATE_JSTF = 0x1000, + FT_VALIDATE_MATH = 0x2000, + FT_VALIDATE_OT = + FT_VALIDATE_BASE | + FT_VALIDATE_GDEF | + FT_VALIDATE_GPOS | + FT_VALIDATE_GSUB | + FT_VALIDATE_JSTF | + FT_VALIDATE_MATH; + + /** + * {@code FT_Orientation} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_ORIENTATION_TRUETYPE ORIENTATION_TRUETYPE}
  • + *
  • {@link #FT_ORIENTATION_POSTSCRIPT ORIENTATION_POSTSCRIPT}
  • + *
  • {@link #FT_ORIENTATION_FILL_RIGHT ORIENTATION_FILL_RIGHT}
  • + *
  • {@link #FT_ORIENTATION_FILL_LEFT ORIENTATION_FILL_LEFT}
  • + *
  • {@link #FT_ORIENTATION_NONE ORIENTATION_NONE}
  • + *
+ */ + public static final int + FT_ORIENTATION_TRUETYPE = 0, + FT_ORIENTATION_POSTSCRIPT = 1, + FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE, + FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT, + FT_ORIENTATION_NONE = 2; + + public static final int + FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY = FT_MAKE_TAG( 'i', 'g', 'p', 'f' ), + FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY = FT_MAKE_TAG( 'i', 'g', 'p', 's' ), + FT_PARAM_TAG_INCREMENTAL = FT_MAKE_TAG( 'i', 'n', 'c', 'r' ), + FT_PARAM_TAG_IGNORE_SBIX = FT_MAKE_TAG( 'i', 's', 'b', 'x' ), + FT_PARAM_TAG_LCD_FILTER_WEIGHTS = FT_MAKE_TAG( 'l', 'c', 'd', 'f' ), + FT_PARAM_TAG_RANDOM_SEED = FT_MAKE_TAG( 's', 'e', 'e', 'd' ), + FT_PARAM_TAG_STEM_DARKENING = FT_MAKE_TAG( 'd', 'a', 'r', 'k' ), + FT_PARAM_TAG_UNPATENTED_HINTING = FT_MAKE_TAG( 'u', 'n', 'p', 'a' ); + + /** + * {@code FT_Stroker_LineJoin} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_STROKER_LINEJOIN_ROUND STROKER_LINEJOIN_ROUND}
  • + *
  • {@link #FT_STROKER_LINEJOIN_BEVEL STROKER_LINEJOIN_BEVEL}
  • + *
  • {@link #FT_STROKER_LINEJOIN_MITER_VARIABLE STROKER_LINEJOIN_MITER_VARIABLE}
  • + *
  • {@link #FT_STROKER_LINEJOIN_MITER STROKER_LINEJOIN_MITER}
  • + *
  • {@link #FT_STROKER_LINEJOIN_MITER_FIXED STROKER_LINEJOIN_MITER_FIXED}
  • + *
+ */ + public static final int + FT_STROKER_LINEJOIN_ROUND = 0, + FT_STROKER_LINEJOIN_BEVEL = 1, + FT_STROKER_LINEJOIN_MITER_VARIABLE = 2, + FT_STROKER_LINEJOIN_MITER = FT_STROKER_LINEJOIN_MITER_VARIABLE, + FT_STROKER_LINEJOIN_MITER_FIXED = 3; + + /** + * {@code FT_Stroker_LineCap} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_STROKER_LINECAP_BUTT STROKER_LINECAP_BUTT}
  • + *
  • {@link #FT_STROKER_LINECAP_ROUND STROKER_LINECAP_ROUND}
  • + *
  • {@link #FT_STROKER_LINECAP_SQUARE STROKER_LINECAP_SQUARE}
  • + *
+ */ + public static final int + FT_STROKER_LINECAP_BUTT = 0, + FT_STROKER_LINECAP_ROUND = 1, + FT_STROKER_LINECAP_SQUARE = 2; + + /** + * {@code FT_StrokerBorder} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_STROKER_BORDER_LEFT STROKER_BORDER_LEFT}
  • + *
  • {@link #FT_STROKER_BORDER_RIGHT STROKER_BORDER_RIGHT}
  • + *
+ */ + public static final int + FT_STROKER_BORDER_LEFT = 0, + FT_STROKER_BORDER_RIGHT = 1; + + public static final int + FT_ANGLE_PI = 180 << 16, + FT_ANGLE_2PI = FT_ANGLE_PI * 2, + FT_ANGLE_PI2 = FT_ANGLE_PI / 2, + FT_ANGLE_PI4 = FT_ANGLE_PI / 4; + + /** + * {@code T1_Blend_Flags} + * + *
Enum values:
+ * + *
    + *
  • {@link #T1_BLEND_UNDERLINE_POSITION T1_BLEND_UNDERLINE_POSITION}
  • + *
  • {@link #T1_BLEND_UNDERLINE_THICKNESS T1_BLEND_UNDERLINE_THICKNESS}
  • + *
  • {@link #T1_BLEND_ITALIC_ANGLE T1_BLEND_ITALIC_ANGLE}
  • + *
  • {@link #T1_BLEND_BLUE_VALUES T1_BLEND_BLUE_VALUES}
  • + *
  • {@link #T1_BLEND_OTHER_BLUES T1_BLEND_OTHER_BLUES}
  • + *
  • {@link #T1_BLEND_STANDARD_WIDTH T1_BLEND_STANDARD_WIDTH}
  • + *
  • {@link #T1_BLEND_STANDARD_HEIGHT T1_BLEND_STANDARD_HEIGHT}
  • + *
  • {@link #T1_BLEND_STEM_SNAP_WIDTHS T1_BLEND_STEM_SNAP_WIDTHS}
  • + *
  • {@link #T1_BLEND_STEM_SNAP_HEIGHTS T1_BLEND_STEM_SNAP_HEIGHTS}
  • + *
  • {@link #T1_BLEND_BLUE_SCALE T1_BLEND_BLUE_SCALE}
  • + *
  • {@link #T1_BLEND_BLUE_SHIFT T1_BLEND_BLUE_SHIFT}
  • + *
  • {@link #T1_BLEND_FAMILY_BLUES T1_BLEND_FAMILY_BLUES}
  • + *
  • {@link #T1_BLEND_FAMILY_OTHER_BLUES T1_BLEND_FAMILY_OTHER_BLUES}
  • + *
  • {@link #T1_BLEND_FORCE_BOLD T1_BLEND_FORCE_BOLD}
  • + *
  • {@link #T1_BLEND_MAX T1_BLEND_MAX}
  • + *
+ */ + public static final int + T1_BLEND_UNDERLINE_POSITION = 0, + T1_BLEND_UNDERLINE_THICKNESS = 1, + T1_BLEND_ITALIC_ANGLE = 2, + T1_BLEND_BLUE_VALUES = 3, + T1_BLEND_OTHER_BLUES = 4, + T1_BLEND_STANDARD_WIDTH = 5, + T1_BLEND_STANDARD_HEIGHT = 6, + T1_BLEND_STEM_SNAP_WIDTHS = 7, + T1_BLEND_STEM_SNAP_HEIGHTS = 8, + T1_BLEND_BLUE_SCALE = 9, + T1_BLEND_BLUE_SHIFT = 10, + T1_BLEND_FAMILY_BLUES = 11, + T1_BLEND_FAMILY_OTHER_BLUES = 12, + T1_BLEND_FORCE_BOLD = 13, + T1_BLEND_MAX = 14; + + public static final int T1_MAX_MM_DESIGNS = 16; + + public static final int T1_MAX_MM_AXIS = 4; + + public static final int T1_MAX_MM_MAP_POINTS = 20; + + /** + * {@code T1_EncodingType} + * + *
Enum values:
+ * + *
    + *
  • {@link #T1_ENCODING_TYPE_NONE T1_ENCODING_TYPE_NONE}
  • + *
  • {@link #T1_ENCODING_TYPE_ARRAY T1_ENCODING_TYPE_ARRAY}
  • + *
  • {@link #T1_ENCODING_TYPE_STANDARD T1_ENCODING_TYPE_STANDARD}
  • + *
  • {@link #T1_ENCODING_TYPE_ISOLATIN1 T1_ENCODING_TYPE_ISOLATIN1}
  • + *
  • {@link #T1_ENCODING_TYPE_EXPERT T1_ENCODING_TYPE_EXPERT}
  • + *
+ */ + public static final int + T1_ENCODING_TYPE_NONE = 0, + T1_ENCODING_TYPE_ARRAY = 1, + T1_ENCODING_TYPE_STANDARD = 2, + T1_ENCODING_TYPE_ISOLATIN1 = 3, + T1_ENCODING_TYPE_EXPERT = 4; + + /** + * {@code PS_Dict_Keys} + * + *
Enum values:
+ * + *
    + *
  • {@link #PS_DICT_FONT_TYPE PS_DICT_FONT_TYPE}
  • + *
  • {@link #PS_DICT_FONT_MATRIX PS_DICT_FONT_MATRIX}
  • + *
  • {@link #PS_DICT_FONT_BBOX PS_DICT_FONT_BBOX}
  • + *
  • {@link #PS_DICT_PAINT_TYPE PS_DICT_PAINT_TYPE}
  • + *
  • {@link #PS_DICT_FONT_NAME PS_DICT_FONT_NAME}
  • + *
  • {@link #PS_DICT_UNIQUE_ID PS_DICT_UNIQUE_ID}
  • + *
  • {@link #PS_DICT_NUM_CHAR_STRINGS PS_DICT_NUM_CHAR_STRINGS}
  • + *
  • {@link #PS_DICT_CHAR_STRING_KEY PS_DICT_CHAR_STRING_KEY}
  • + *
  • {@link #PS_DICT_CHAR_STRING PS_DICT_CHAR_STRING}
  • + *
  • {@link #PS_DICT_ENCODING_TYPE PS_DICT_ENCODING_TYPE}
  • + *
  • {@link #PS_DICT_ENCODING_ENTRY PS_DICT_ENCODING_ENTRY}
  • + *
  • {@link #PS_DICT_NUM_SUBRS PS_DICT_NUM_SUBRS}
  • + *
  • {@link #PS_DICT_SUBR PS_DICT_SUBR}
  • + *
  • {@link #PS_DICT_STD_HW PS_DICT_STD_HW}
  • + *
  • {@link #PS_DICT_STD_VW PS_DICT_STD_VW}
  • + *
  • {@link #PS_DICT_NUM_BLUE_VALUES PS_DICT_NUM_BLUE_VALUES}
  • + *
  • {@link #PS_DICT_BLUE_VALUE PS_DICT_BLUE_VALUE}
  • + *
  • {@link #PS_DICT_BLUE_FUZZ PS_DICT_BLUE_FUZZ}
  • + *
  • {@link #PS_DICT_NUM_OTHER_BLUES PS_DICT_NUM_OTHER_BLUES}
  • + *
  • {@link #PS_DICT_OTHER_BLUE PS_DICT_OTHER_BLUE}
  • + *
  • {@link #PS_DICT_NUM_FAMILY_BLUES PS_DICT_NUM_FAMILY_BLUES}
  • + *
  • {@link #PS_DICT_FAMILY_BLUE PS_DICT_FAMILY_BLUE}
  • + *
  • {@link #PS_DICT_NUM_FAMILY_OTHER_BLUES PS_DICT_NUM_FAMILY_OTHER_BLUES}
  • + *
  • {@link #PS_DICT_FAMILY_OTHER_BLUE PS_DICT_FAMILY_OTHER_BLUE}
  • + *
  • {@link #PS_DICT_BLUE_SCALE PS_DICT_BLUE_SCALE}
  • + *
  • {@link #PS_DICT_BLUE_SHIFT PS_DICT_BLUE_SHIFT}
  • + *
  • {@link #PS_DICT_NUM_STEM_SNAP_H PS_DICT_NUM_STEM_SNAP_H}
  • + *
  • {@link #PS_DICT_STEM_SNAP_H PS_DICT_STEM_SNAP_H}
  • + *
  • {@link #PS_DICT_NUM_STEM_SNAP_V PS_DICT_NUM_STEM_SNAP_V}
  • + *
  • {@link #PS_DICT_STEM_SNAP_V PS_DICT_STEM_SNAP_V}
  • + *
  • {@link #PS_DICT_FORCE_BOLD PS_DICT_FORCE_BOLD}
  • + *
  • {@link #PS_DICT_RND_STEM_UP PS_DICT_RND_STEM_UP}
  • + *
  • {@link #PS_DICT_MIN_FEATURE PS_DICT_MIN_FEATURE}
  • + *
  • {@link #PS_DICT_LEN_IV PS_DICT_LEN_IV}
  • + *
  • {@link #PS_DICT_PASSWORD PS_DICT_PASSWORD}
  • + *
  • {@link #PS_DICT_LANGUAGE_GROUP PS_DICT_LANGUAGE_GROUP}
  • + *
  • {@link #PS_DICT_VERSION PS_DICT_VERSION}
  • + *
  • {@link #PS_DICT_NOTICE PS_DICT_NOTICE}
  • + *
  • {@link #PS_DICT_FULL_NAME PS_DICT_FULL_NAME}
  • + *
  • {@link #PS_DICT_FAMILY_NAME PS_DICT_FAMILY_NAME}
  • + *
  • {@link #PS_DICT_WEIGHT PS_DICT_WEIGHT}
  • + *
  • {@link #PS_DICT_IS_FIXED_PITCH PS_DICT_IS_FIXED_PITCH}
  • + *
  • {@link #PS_DICT_UNDERLINE_POSITION PS_DICT_UNDERLINE_POSITION}
  • + *
  • {@link #PS_DICT_UNDERLINE_THICKNESS PS_DICT_UNDERLINE_THICKNESS}
  • + *
  • {@link #PS_DICT_FS_TYPE PS_DICT_FS_TYPE}
  • + *
  • {@link #PS_DICT_ITALIC_ANGLE PS_DICT_ITALIC_ANGLE}
  • + *
  • {@link #PS_DICT_MAX PS_DICT_MAX}
  • + *
+ */ + public static final int + PS_DICT_FONT_TYPE = 0, + PS_DICT_FONT_MATRIX = 1, + PS_DICT_FONT_BBOX = 2, + PS_DICT_PAINT_TYPE = 3, + PS_DICT_FONT_NAME = 4, + PS_DICT_UNIQUE_ID = 5, + PS_DICT_NUM_CHAR_STRINGS = 6, + PS_DICT_CHAR_STRING_KEY = 7, + PS_DICT_CHAR_STRING = 8, + PS_DICT_ENCODING_TYPE = 9, + PS_DICT_ENCODING_ENTRY = 10, + PS_DICT_NUM_SUBRS = 11, + PS_DICT_SUBR = 12, + PS_DICT_STD_HW = 13, + PS_DICT_STD_VW = 14, + PS_DICT_NUM_BLUE_VALUES = 15, + PS_DICT_BLUE_VALUE = 16, + PS_DICT_BLUE_FUZZ = 17, + PS_DICT_NUM_OTHER_BLUES = 18, + PS_DICT_OTHER_BLUE = 19, + PS_DICT_NUM_FAMILY_BLUES = 20, + PS_DICT_FAMILY_BLUE = 21, + PS_DICT_NUM_FAMILY_OTHER_BLUES = 22, + PS_DICT_FAMILY_OTHER_BLUE = 23, + PS_DICT_BLUE_SCALE = 24, + PS_DICT_BLUE_SHIFT = 25, + PS_DICT_NUM_STEM_SNAP_H = 26, + PS_DICT_STEM_SNAP_H = 27, + PS_DICT_NUM_STEM_SNAP_V = 28, + PS_DICT_STEM_SNAP_V = 29, + PS_DICT_FORCE_BOLD = 30, + PS_DICT_RND_STEM_UP = 31, + PS_DICT_MIN_FEATURE = 32, + PS_DICT_LEN_IV = 33, + PS_DICT_PASSWORD = 34, + PS_DICT_LANGUAGE_GROUP = 35, + PS_DICT_VERSION = 36, + PS_DICT_NOTICE = 37, + PS_DICT_FULL_NAME = 38, + PS_DICT_FAMILY_NAME = 39, + PS_DICT_WEIGHT = 40, + PS_DICT_IS_FIXED_PITCH = 41, + PS_DICT_UNDERLINE_POSITION = 42, + PS_DICT_UNDERLINE_THICKNESS = 43, + PS_DICT_FS_TYPE = 44, + PS_DICT_ITALIC_ANGLE = 45, + PS_DICT_MAX = PS_DICT_ITALIC_ANGLE; + + /** + * {@code TT_PLATFORM_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #TT_PLATFORM_APPLE_UNICODE TT_PLATFORM_APPLE_UNICODE}
  • + *
  • {@link #TT_PLATFORM_MACINTOSH TT_PLATFORM_MACINTOSH}
  • + *
  • {@link #TT_PLATFORM_ISO TT_PLATFORM_ISO}
  • + *
  • {@link #TT_PLATFORM_MICROSOFT TT_PLATFORM_MICROSOFT}
  • + *
  • {@link #TT_PLATFORM_CUSTOM TT_PLATFORM_CUSTOM}
  • + *
  • {@link #TT_PLATFORM_ADOBE TT_PLATFORM_ADOBE}
  • + *
+ */ + public static final int + TT_PLATFORM_APPLE_UNICODE = 0, + TT_PLATFORM_MACINTOSH = 1, + TT_PLATFORM_ISO = 2, + TT_PLATFORM_MICROSOFT = 3, + TT_PLATFORM_CUSTOM = 4, + TT_PLATFORM_ADOBE = 7; + + /** + * {@code TT_APPLE_ID_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #TT_APPLE_ID_DEFAULT TT_APPLE_ID_DEFAULT}
  • + *
  • {@link #TT_APPLE_ID_UNICODE_1_1 TT_APPLE_ID_UNICODE_1_1}
  • + *
  • {@link #TT_APPLE_ID_ISO_10646 TT_APPLE_ID_ISO_10646}
  • + *
  • {@link #TT_APPLE_ID_UNICODE_2_0 TT_APPLE_ID_UNICODE_2_0}
  • + *
  • {@link #TT_APPLE_ID_UNICODE_32 TT_APPLE_ID_UNICODE_32}
  • + *
  • {@link #TT_APPLE_ID_VARIANT_SELECTOR TT_APPLE_ID_VARIANT_SELECTOR}
  • + *
  • {@link #TT_APPLE_ID_FULL_UNICODE TT_APPLE_ID_FULL_UNICODE}
  • + *
+ */ + public static final int + TT_APPLE_ID_DEFAULT = 0, + TT_APPLE_ID_UNICODE_1_1 = 1, + TT_APPLE_ID_ISO_10646 = 2, + TT_APPLE_ID_UNICODE_2_0 = 3, + TT_APPLE_ID_UNICODE_32 = 4, + TT_APPLE_ID_VARIANT_SELECTOR = 5, + TT_APPLE_ID_FULL_UNICODE = 6; + + /** + * {@code TT_MAC_ID_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #TT_MAC_ID_ROMAN TT_MAC_ID_ROMAN}
  • + *
  • {@link #TT_MAC_ID_JAPANESE TT_MAC_ID_JAPANESE}
  • + *
  • {@link #TT_MAC_ID_TRADITIONAL_CHINESE TT_MAC_ID_TRADITIONAL_CHINESE}
  • + *
  • {@link #TT_MAC_ID_KOREAN TT_MAC_ID_KOREAN}
  • + *
  • {@link #TT_MAC_ID_ARABIC TT_MAC_ID_ARABIC}
  • + *
  • {@link #TT_MAC_ID_HEBREW TT_MAC_ID_HEBREW}
  • + *
  • {@link #TT_MAC_ID_GREEK TT_MAC_ID_GREEK}
  • + *
  • {@link #TT_MAC_ID_RUSSIAN TT_MAC_ID_RUSSIAN}
  • + *
  • {@link #TT_MAC_ID_RSYMBOL TT_MAC_ID_RSYMBOL}
  • + *
  • {@link #TT_MAC_ID_DEVANAGARI TT_MAC_ID_DEVANAGARI}
  • + *
  • {@link #TT_MAC_ID_GURMUKHI TT_MAC_ID_GURMUKHI}
  • + *
  • {@link #TT_MAC_ID_GUJARATI TT_MAC_ID_GUJARATI}
  • + *
  • {@link #TT_MAC_ID_ORIYA TT_MAC_ID_ORIYA}
  • + *
  • {@link #TT_MAC_ID_BENGALI TT_MAC_ID_BENGALI}
  • + *
  • {@link #TT_MAC_ID_TAMIL TT_MAC_ID_TAMIL}
  • + *
  • {@link #TT_MAC_ID_TELUGU TT_MAC_ID_TELUGU}
  • + *
  • {@link #TT_MAC_ID_KANNADA TT_MAC_ID_KANNADA}
  • + *
  • {@link #TT_MAC_ID_MALAYALAM TT_MAC_ID_MALAYALAM}
  • + *
  • {@link #TT_MAC_ID_SINHALESE TT_MAC_ID_SINHALESE}
  • + *
  • {@link #TT_MAC_ID_BURMESE TT_MAC_ID_BURMESE}
  • + *
  • {@link #TT_MAC_ID_KHMER TT_MAC_ID_KHMER}
  • + *
  • {@link #TT_MAC_ID_THAI TT_MAC_ID_THAI}
  • + *
  • {@link #TT_MAC_ID_LAOTIAN TT_MAC_ID_LAOTIAN}
  • + *
  • {@link #TT_MAC_ID_GEORGIAN TT_MAC_ID_GEORGIAN}
  • + *
  • {@link #TT_MAC_ID_ARMENIAN TT_MAC_ID_ARMENIAN}
  • + *
  • {@link #TT_MAC_ID_MALDIVIAN TT_MAC_ID_MALDIVIAN}
  • + *
  • {@link #TT_MAC_ID_SIMPLIFIED_CHINESE TT_MAC_ID_SIMPLIFIED_CHINESE}
  • + *
  • {@link #TT_MAC_ID_TIBETAN TT_MAC_ID_TIBETAN}
  • + *
  • {@link #TT_MAC_ID_MONGOLIAN TT_MAC_ID_MONGOLIAN}
  • + *
  • {@link #TT_MAC_ID_GEEZ TT_MAC_ID_GEEZ}
  • + *
  • {@link #TT_MAC_ID_SLAVIC TT_MAC_ID_SLAVIC}
  • + *
  • {@link #TT_MAC_ID_VIETNAMESE TT_MAC_ID_VIETNAMESE}
  • + *
  • {@link #TT_MAC_ID_SINDHI TT_MAC_ID_SINDHI}
  • + *
  • {@link #TT_MAC_ID_UNINTERP TT_MAC_ID_UNINTERP}
  • + *
+ */ + public static final int + TT_MAC_ID_ROMAN = 0, + TT_MAC_ID_JAPANESE = 1, + TT_MAC_ID_TRADITIONAL_CHINESE = 2, + TT_MAC_ID_KOREAN = 3, + TT_MAC_ID_ARABIC = 4, + TT_MAC_ID_HEBREW = 5, + TT_MAC_ID_GREEK = 6, + TT_MAC_ID_RUSSIAN = 7, + TT_MAC_ID_RSYMBOL = 8, + TT_MAC_ID_DEVANAGARI = 9, + TT_MAC_ID_GURMUKHI = 10, + TT_MAC_ID_GUJARATI = 11, + TT_MAC_ID_ORIYA = 12, + TT_MAC_ID_BENGALI = 13, + TT_MAC_ID_TAMIL = 14, + TT_MAC_ID_TELUGU = 15, + TT_MAC_ID_KANNADA = 16, + TT_MAC_ID_MALAYALAM = 17, + TT_MAC_ID_SINHALESE = 18, + TT_MAC_ID_BURMESE = 19, + TT_MAC_ID_KHMER = 20, + TT_MAC_ID_THAI = 21, + TT_MAC_ID_LAOTIAN = 22, + TT_MAC_ID_GEORGIAN = 23, + TT_MAC_ID_ARMENIAN = 24, + TT_MAC_ID_MALDIVIAN = 25, + TT_MAC_ID_SIMPLIFIED_CHINESE = 26, + TT_MAC_ID_TIBETAN = 27, + TT_MAC_ID_MONGOLIAN = 28, + TT_MAC_ID_GEEZ = 29, + TT_MAC_ID_SLAVIC = 30, + TT_MAC_ID_VIETNAMESE = 31, + TT_MAC_ID_SINDHI = 32, + TT_MAC_ID_UNINTERP = 33; + + /** + * {@code TT_ISO_ID_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #TT_ISO_ID_7BIT_ASCII TT_ISO_ID_7BIT_ASCII}
  • + *
  • {@link #TT_ISO_ID_10646 TT_ISO_ID_10646}
  • + *
  • {@link #TT_ISO_ID_8859_1 TT_ISO_ID_8859_1}
  • + *
+ */ + public static final int + TT_ISO_ID_7BIT_ASCII = 0, + TT_ISO_ID_10646 = 1, + TT_ISO_ID_8859_1 = 2; + + /** + * {@code TT_MS_ID_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #TT_MS_ID_SYMBOL_CS TT_MS_ID_SYMBOL_CS}
  • + *
  • {@link #TT_MS_ID_UNICODE_CS TT_MS_ID_UNICODE_CS}
  • + *
  • {@link #TT_MS_ID_SJIS TT_MS_ID_SJIS}
  • + *
  • {@link #TT_MS_ID_PRC TT_MS_ID_PRC}
  • + *
  • {@link #TT_MS_ID_BIG_5 TT_MS_ID_BIG_5}
  • + *
  • {@link #TT_MS_ID_WANSUNG TT_MS_ID_WANSUNG}
  • + *
  • {@link #TT_MS_ID_JOHAB TT_MS_ID_JOHAB}
  • + *
  • {@link #TT_MS_ID_UCS_4 TT_MS_ID_UCS_4}
  • + *
+ */ + public static final int + TT_MS_ID_SYMBOL_CS = 0, + TT_MS_ID_UNICODE_CS = 1, + TT_MS_ID_SJIS = 2, + TT_MS_ID_PRC = 3, + TT_MS_ID_BIG_5 = 4, + TT_MS_ID_WANSUNG = 5, + TT_MS_ID_JOHAB = 6, + TT_MS_ID_UCS_4 = 10; + + /** + * {@code TT_ADOBE_ID_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #TT_ADOBE_ID_STANDARD TT_ADOBE_ID_STANDARD}
  • + *
  • {@link #TT_ADOBE_ID_EXPERT TT_ADOBE_ID_EXPERT}
  • + *
  • {@link #TT_ADOBE_ID_CUSTOM TT_ADOBE_ID_CUSTOM}
  • + *
  • {@link #TT_ADOBE_ID_LATIN_1 TT_ADOBE_ID_LATIN_1}
  • + *
+ */ + public static final int + TT_ADOBE_ID_STANDARD = 0, + TT_ADOBE_ID_EXPERT = 1, + TT_ADOBE_ID_CUSTOM = 2, + TT_ADOBE_ID_LATIN_1 = 3; + + /** + * {@code TT_MAC_LANGID_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #TT_MAC_LANGID_ENGLISH TT_MAC_LANGID_ENGLISH}
  • + *
  • {@link #TT_MAC_LANGID_FRENCH TT_MAC_LANGID_FRENCH}
  • + *
  • {@link #TT_MAC_LANGID_GERMAN TT_MAC_LANGID_GERMAN}
  • + *
  • {@link #TT_MAC_LANGID_ITALIAN TT_MAC_LANGID_ITALIAN}
  • + *
  • {@link #TT_MAC_LANGID_DUTCH TT_MAC_LANGID_DUTCH}
  • + *
  • {@link #TT_MAC_LANGID_SWEDISH TT_MAC_LANGID_SWEDISH}
  • + *
  • {@link #TT_MAC_LANGID_SPANISH TT_MAC_LANGID_SPANISH}
  • + *
  • {@link #TT_MAC_LANGID_DANISH TT_MAC_LANGID_DANISH}
  • + *
  • {@link #TT_MAC_LANGID_PORTUGUESE TT_MAC_LANGID_PORTUGUESE}
  • + *
  • {@link #TT_MAC_LANGID_NORWEGIAN TT_MAC_LANGID_NORWEGIAN}
  • + *
  • {@link #TT_MAC_LANGID_HEBREW TT_MAC_LANGID_HEBREW}
  • + *
  • {@link #TT_MAC_LANGID_JAPANESE TT_MAC_LANGID_JAPANESE}
  • + *
  • {@link #TT_MAC_LANGID_ARABIC TT_MAC_LANGID_ARABIC}
  • + *
  • {@link #TT_MAC_LANGID_FINNISH TT_MAC_LANGID_FINNISH}
  • + *
  • {@link #TT_MAC_LANGID_GREEK TT_MAC_LANGID_GREEK}
  • + *
  • {@link #TT_MAC_LANGID_ICELANDIC TT_MAC_LANGID_ICELANDIC}
  • + *
  • {@link #TT_MAC_LANGID_MALTESE TT_MAC_LANGID_MALTESE}
  • + *
  • {@link #TT_MAC_LANGID_TURKISH TT_MAC_LANGID_TURKISH}
  • + *
  • {@link #TT_MAC_LANGID_CROATIAN TT_MAC_LANGID_CROATIAN}
  • + *
  • {@link #TT_MAC_LANGID_CHINESE_TRADITIONAL TT_MAC_LANGID_CHINESE_TRADITIONAL}
  • + *
  • {@link #TT_MAC_LANGID_URDU TT_MAC_LANGID_URDU}
  • + *
  • {@link #TT_MAC_LANGID_HINDI TT_MAC_LANGID_HINDI}
  • + *
  • {@link #TT_MAC_LANGID_THAI TT_MAC_LANGID_THAI}
  • + *
  • {@link #TT_MAC_LANGID_KOREAN TT_MAC_LANGID_KOREAN}
  • + *
  • {@link #TT_MAC_LANGID_LITHUANIAN TT_MAC_LANGID_LITHUANIAN}
  • + *
  • {@link #TT_MAC_LANGID_POLISH TT_MAC_LANGID_POLISH}
  • + *
  • {@link #TT_MAC_LANGID_HUNGARIAN TT_MAC_LANGID_HUNGARIAN}
  • + *
  • {@link #TT_MAC_LANGID_ESTONIAN TT_MAC_LANGID_ESTONIAN}
  • + *
  • {@link #TT_MAC_LANGID_LETTISH TT_MAC_LANGID_LETTISH}
  • + *
  • {@link #TT_MAC_LANGID_SAAMISK TT_MAC_LANGID_SAAMISK}
  • + *
  • {@link #TT_MAC_LANGID_FAEROESE TT_MAC_LANGID_FAEROESE}
  • + *
  • {@link #TT_MAC_LANGID_FARSI TT_MAC_LANGID_FARSI}
  • + *
  • {@link #TT_MAC_LANGID_RUSSIAN TT_MAC_LANGID_RUSSIAN}
  • + *
  • {@link #TT_MAC_LANGID_CHINESE_SIMPLIFIED TT_MAC_LANGID_CHINESE_SIMPLIFIED}
  • + *
  • {@link #TT_MAC_LANGID_FLEMISH TT_MAC_LANGID_FLEMISH}
  • + *
  • {@link #TT_MAC_LANGID_IRISH TT_MAC_LANGID_IRISH}
  • + *
  • {@link #TT_MAC_LANGID_ALBANIAN TT_MAC_LANGID_ALBANIAN}
  • + *
  • {@link #TT_MAC_LANGID_ROMANIAN TT_MAC_LANGID_ROMANIAN}
  • + *
  • {@link #TT_MAC_LANGID_CZECH TT_MAC_LANGID_CZECH}
  • + *
  • {@link #TT_MAC_LANGID_SLOVAK TT_MAC_LANGID_SLOVAK}
  • + *
  • {@link #TT_MAC_LANGID_SLOVENIAN TT_MAC_LANGID_SLOVENIAN}
  • + *
  • {@link #TT_MAC_LANGID_YIDDISH TT_MAC_LANGID_YIDDISH}
  • + *
  • {@link #TT_MAC_LANGID_SERBIAN TT_MAC_LANGID_SERBIAN}
  • + *
  • {@link #TT_MAC_LANGID_MACEDONIAN TT_MAC_LANGID_MACEDONIAN}
  • + *
  • {@link #TT_MAC_LANGID_BULGARIAN TT_MAC_LANGID_BULGARIAN}
  • + *
  • {@link #TT_MAC_LANGID_UKRAINIAN TT_MAC_LANGID_UKRAINIAN}
  • + *
  • {@link #TT_MAC_LANGID_BYELORUSSIAN TT_MAC_LANGID_BYELORUSSIAN}
  • + *
  • {@link #TT_MAC_LANGID_UZBEK TT_MAC_LANGID_UZBEK}
  • + *
  • {@link #TT_MAC_LANGID_KAZAKH TT_MAC_LANGID_KAZAKH}
  • + *
  • {@link #TT_MAC_LANGID_AZERBAIJANI TT_MAC_LANGID_AZERBAIJANI}
  • + *
  • {@link #TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT}
  • + *
  • {@link #TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT}
  • + *
  • {@link #TT_MAC_LANGID_ARMENIAN TT_MAC_LANGID_ARMENIAN}
  • + *
  • {@link #TT_MAC_LANGID_GEORGIAN TT_MAC_LANGID_GEORGIAN}
  • + *
  • {@link #TT_MAC_LANGID_MOLDAVIAN TT_MAC_LANGID_MOLDAVIAN}
  • + *
  • {@link #TT_MAC_LANGID_KIRGHIZ TT_MAC_LANGID_KIRGHIZ}
  • + *
  • {@link #TT_MAC_LANGID_TAJIKI TT_MAC_LANGID_TAJIKI}
  • + *
  • {@link #TT_MAC_LANGID_TURKMEN TT_MAC_LANGID_TURKMEN}
  • + *
  • {@link #TT_MAC_LANGID_MONGOLIAN TT_MAC_LANGID_MONGOLIAN}
  • + *
  • {@link #TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT}
  • + *
  • {@link #TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT}
  • + *
  • {@link #TT_MAC_LANGID_PASHTO TT_MAC_LANGID_PASHTO}
  • + *
  • {@link #TT_MAC_LANGID_KURDISH TT_MAC_LANGID_KURDISH}
  • + *
  • {@link #TT_MAC_LANGID_KASHMIRI TT_MAC_LANGID_KASHMIRI}
  • + *
  • {@link #TT_MAC_LANGID_SINDHI TT_MAC_LANGID_SINDHI}
  • + *
  • {@link #TT_MAC_LANGID_TIBETAN TT_MAC_LANGID_TIBETAN}
  • + *
  • {@link #TT_MAC_LANGID_NEPALI TT_MAC_LANGID_NEPALI}
  • + *
  • {@link #TT_MAC_LANGID_SANSKRIT TT_MAC_LANGID_SANSKRIT}
  • + *
  • {@link #TT_MAC_LANGID_MARATHI TT_MAC_LANGID_MARATHI}
  • + *
  • {@link #TT_MAC_LANGID_BENGALI TT_MAC_LANGID_BENGALI}
  • + *
  • {@link #TT_MAC_LANGID_ASSAMESE TT_MAC_LANGID_ASSAMESE}
  • + *
  • {@link #TT_MAC_LANGID_GUJARATI TT_MAC_LANGID_GUJARATI}
  • + *
  • {@link #TT_MAC_LANGID_PUNJABI TT_MAC_LANGID_PUNJABI}
  • + *
  • {@link #TT_MAC_LANGID_ORIYA TT_MAC_LANGID_ORIYA}
  • + *
  • {@link #TT_MAC_LANGID_MALAYALAM TT_MAC_LANGID_MALAYALAM}
  • + *
  • {@link #TT_MAC_LANGID_KANNADA TT_MAC_LANGID_KANNADA}
  • + *
  • {@link #TT_MAC_LANGID_TAMIL TT_MAC_LANGID_TAMIL}
  • + *
  • {@link #TT_MAC_LANGID_TELUGU TT_MAC_LANGID_TELUGU}
  • + *
  • {@link #TT_MAC_LANGID_SINHALESE TT_MAC_LANGID_SINHALESE}
  • + *
  • {@link #TT_MAC_LANGID_BURMESE TT_MAC_LANGID_BURMESE}
  • + *
  • {@link #TT_MAC_LANGID_KHMER TT_MAC_LANGID_KHMER}
  • + *
  • {@link #TT_MAC_LANGID_LAO TT_MAC_LANGID_LAO}
  • + *
  • {@link #TT_MAC_LANGID_VIETNAMESE TT_MAC_LANGID_VIETNAMESE}
  • + *
  • {@link #TT_MAC_LANGID_INDONESIAN TT_MAC_LANGID_INDONESIAN}
  • + *
  • {@link #TT_MAC_LANGID_TAGALOG TT_MAC_LANGID_TAGALOG}
  • + *
  • {@link #TT_MAC_LANGID_MALAY_ROMAN_SCRIPT TT_MAC_LANGID_MALAY_ROMAN_SCRIPT}
  • + *
  • {@link #TT_MAC_LANGID_MALAY_ARABIC_SCRIPT TT_MAC_LANGID_MALAY_ARABIC_SCRIPT}
  • + *
  • {@link #TT_MAC_LANGID_AMHARIC TT_MAC_LANGID_AMHARIC}
  • + *
  • {@link #TT_MAC_LANGID_TIGRINYA TT_MAC_LANGID_TIGRINYA}
  • + *
  • {@link #TT_MAC_LANGID_GALLA TT_MAC_LANGID_GALLA}
  • + *
  • {@link #TT_MAC_LANGID_SOMALI TT_MAC_LANGID_SOMALI}
  • + *
  • {@link #TT_MAC_LANGID_SWAHILI TT_MAC_LANGID_SWAHILI}
  • + *
  • {@link #TT_MAC_LANGID_RUANDA TT_MAC_LANGID_RUANDA}
  • + *
  • {@link #TT_MAC_LANGID_RUNDI TT_MAC_LANGID_RUNDI}
  • + *
  • {@link #TT_MAC_LANGID_CHEWA TT_MAC_LANGID_CHEWA}
  • + *
  • {@link #TT_MAC_LANGID_MALAGASY TT_MAC_LANGID_MALAGASY}
  • + *
  • {@link #TT_MAC_LANGID_ESPERANTO TT_MAC_LANGID_ESPERANTO}
  • + *
  • {@link #TT_MAC_LANGID_WELSH TT_MAC_LANGID_WELSH}
  • + *
  • {@link #TT_MAC_LANGID_BASQUE TT_MAC_LANGID_BASQUE}
  • + *
  • {@link #TT_MAC_LANGID_CATALAN TT_MAC_LANGID_CATALAN}
  • + *
  • {@link #TT_MAC_LANGID_LATIN TT_MAC_LANGID_LATIN}
  • + *
  • {@link #TT_MAC_LANGID_QUECHUA TT_MAC_LANGID_QUECHUA}
  • + *
  • {@link #TT_MAC_LANGID_GUARANI TT_MAC_LANGID_GUARANI}
  • + *
  • {@link #TT_MAC_LANGID_AYMARA TT_MAC_LANGID_AYMARA}
  • + *
  • {@link #TT_MAC_LANGID_TATAR TT_MAC_LANGID_TATAR}
  • + *
  • {@link #TT_MAC_LANGID_UIGHUR TT_MAC_LANGID_UIGHUR}
  • + *
  • {@link #TT_MAC_LANGID_DZONGKHA TT_MAC_LANGID_DZONGKHA}
  • + *
  • {@link #TT_MAC_LANGID_JAVANESE TT_MAC_LANGID_JAVANESE}
  • + *
  • {@link #TT_MAC_LANGID_SUNDANESE TT_MAC_LANGID_SUNDANESE}
  • + *
  • {@link #TT_MAC_LANGID_GALICIAN TT_MAC_LANGID_GALICIAN}
  • + *
  • {@link #TT_MAC_LANGID_AFRIKAANS TT_MAC_LANGID_AFRIKAANS}
  • + *
  • {@link #TT_MAC_LANGID_BRETON TT_MAC_LANGID_BRETON}
  • + *
  • {@link #TT_MAC_LANGID_INUKTITUT TT_MAC_LANGID_INUKTITUT}
  • + *
  • {@link #TT_MAC_LANGID_SCOTTISH_GAELIC TT_MAC_LANGID_SCOTTISH_GAELIC}
  • + *
  • {@link #TT_MAC_LANGID_MANX_GAELIC TT_MAC_LANGID_MANX_GAELIC}
  • + *
  • {@link #TT_MAC_LANGID_IRISH_GAELIC TT_MAC_LANGID_IRISH_GAELIC}
  • + *
  • {@link #TT_MAC_LANGID_TONGAN TT_MAC_LANGID_TONGAN}
  • + *
  • {@link #TT_MAC_LANGID_GREEK_POLYTONIC TT_MAC_LANGID_GREEK_POLYTONIC}
  • + *
  • {@link #TT_MAC_LANGID_GREELANDIC TT_MAC_LANGID_GREELANDIC}
  • + *
  • {@link #TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT}
  • + *
+ */ + public static final int + TT_MAC_LANGID_ENGLISH = 0, + TT_MAC_LANGID_FRENCH = 1, + TT_MAC_LANGID_GERMAN = 2, + TT_MAC_LANGID_ITALIAN = 3, + TT_MAC_LANGID_DUTCH = 4, + TT_MAC_LANGID_SWEDISH = 5, + TT_MAC_LANGID_SPANISH = 6, + TT_MAC_LANGID_DANISH = 7, + TT_MAC_LANGID_PORTUGUESE = 8, + TT_MAC_LANGID_NORWEGIAN = 9, + TT_MAC_LANGID_HEBREW = 10, + TT_MAC_LANGID_JAPANESE = 11, + TT_MAC_LANGID_ARABIC = 12, + TT_MAC_LANGID_FINNISH = 13, + TT_MAC_LANGID_GREEK = 14, + TT_MAC_LANGID_ICELANDIC = 15, + TT_MAC_LANGID_MALTESE = 16, + TT_MAC_LANGID_TURKISH = 17, + TT_MAC_LANGID_CROATIAN = 18, + TT_MAC_LANGID_CHINESE_TRADITIONAL = 19, + TT_MAC_LANGID_URDU = 20, + TT_MAC_LANGID_HINDI = 21, + TT_MAC_LANGID_THAI = 22, + TT_MAC_LANGID_KOREAN = 23, + TT_MAC_LANGID_LITHUANIAN = 24, + TT_MAC_LANGID_POLISH = 25, + TT_MAC_LANGID_HUNGARIAN = 26, + TT_MAC_LANGID_ESTONIAN = 27, + TT_MAC_LANGID_LETTISH = 28, + TT_MAC_LANGID_SAAMISK = 29, + TT_MAC_LANGID_FAEROESE = 30, + TT_MAC_LANGID_FARSI = 31, + TT_MAC_LANGID_RUSSIAN = 32, + TT_MAC_LANGID_CHINESE_SIMPLIFIED = 33, + TT_MAC_LANGID_FLEMISH = 34, + TT_MAC_LANGID_IRISH = 35, + TT_MAC_LANGID_ALBANIAN = 36, + TT_MAC_LANGID_ROMANIAN = 37, + TT_MAC_LANGID_CZECH = 38, + TT_MAC_LANGID_SLOVAK = 39, + TT_MAC_LANGID_SLOVENIAN = 40, + TT_MAC_LANGID_YIDDISH = 41, + TT_MAC_LANGID_SERBIAN = 42, + TT_MAC_LANGID_MACEDONIAN = 43, + TT_MAC_LANGID_BULGARIAN = 44, + TT_MAC_LANGID_UKRAINIAN = 45, + TT_MAC_LANGID_BYELORUSSIAN = 46, + TT_MAC_LANGID_UZBEK = 47, + TT_MAC_LANGID_KAZAKH = 48, + TT_MAC_LANGID_AZERBAIJANI = 49, + TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT = 50, + TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT = 51, + TT_MAC_LANGID_ARMENIAN = 52, + TT_MAC_LANGID_GEORGIAN = 53, + TT_MAC_LANGID_MOLDAVIAN = 54, + TT_MAC_LANGID_KIRGHIZ = 55, + TT_MAC_LANGID_TAJIKI = 56, + TT_MAC_LANGID_TURKMEN = 57, + TT_MAC_LANGID_MONGOLIAN = 58, + TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT = 59, + TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT = 60, + TT_MAC_LANGID_PASHTO = 61, + TT_MAC_LANGID_KURDISH = 62, + TT_MAC_LANGID_KASHMIRI = 63, + TT_MAC_LANGID_SINDHI = 64, + TT_MAC_LANGID_TIBETAN = 65, + TT_MAC_LANGID_NEPALI = 66, + TT_MAC_LANGID_SANSKRIT = 67, + TT_MAC_LANGID_MARATHI = 68, + TT_MAC_LANGID_BENGALI = 69, + TT_MAC_LANGID_ASSAMESE = 70, + TT_MAC_LANGID_GUJARATI = 71, + TT_MAC_LANGID_PUNJABI = 72, + TT_MAC_LANGID_ORIYA = 73, + TT_MAC_LANGID_MALAYALAM = 74, + TT_MAC_LANGID_KANNADA = 75, + TT_MAC_LANGID_TAMIL = 76, + TT_MAC_LANGID_TELUGU = 77, + TT_MAC_LANGID_SINHALESE = 78, + TT_MAC_LANGID_BURMESE = 79, + TT_MAC_LANGID_KHMER = 80, + TT_MAC_LANGID_LAO = 81, + TT_MAC_LANGID_VIETNAMESE = 82, + TT_MAC_LANGID_INDONESIAN = 83, + TT_MAC_LANGID_TAGALOG = 84, + TT_MAC_LANGID_MALAY_ROMAN_SCRIPT = 85, + TT_MAC_LANGID_MALAY_ARABIC_SCRIPT = 86, + TT_MAC_LANGID_AMHARIC = 87, + TT_MAC_LANGID_TIGRINYA = 88, + TT_MAC_LANGID_GALLA = 89, + TT_MAC_LANGID_SOMALI = 90, + TT_MAC_LANGID_SWAHILI = 91, + TT_MAC_LANGID_RUANDA = 92, + TT_MAC_LANGID_RUNDI = 93, + TT_MAC_LANGID_CHEWA = 94, + TT_MAC_LANGID_MALAGASY = 95, + TT_MAC_LANGID_ESPERANTO = 96, + TT_MAC_LANGID_WELSH = 128, + TT_MAC_LANGID_BASQUE = 129, + TT_MAC_LANGID_CATALAN = 130, + TT_MAC_LANGID_LATIN = 131, + TT_MAC_LANGID_QUECHUA = 132, + TT_MAC_LANGID_GUARANI = 133, + TT_MAC_LANGID_AYMARA = 134, + TT_MAC_LANGID_TATAR = 135, + TT_MAC_LANGID_UIGHUR = 136, + TT_MAC_LANGID_DZONGKHA = 137, + TT_MAC_LANGID_JAVANESE = 138, + TT_MAC_LANGID_SUNDANESE = 139, + TT_MAC_LANGID_GALICIAN = 140, + TT_MAC_LANGID_AFRIKAANS = 141, + TT_MAC_LANGID_BRETON = 142, + TT_MAC_LANGID_INUKTITUT = 143, + TT_MAC_LANGID_SCOTTISH_GAELIC = 144, + TT_MAC_LANGID_MANX_GAELIC = 145, + TT_MAC_LANGID_IRISH_GAELIC = 146, + TT_MAC_LANGID_TONGAN = 147, + TT_MAC_LANGID_GREEK_POLYTONIC = 148, + TT_MAC_LANGID_GREELANDIC = 149, + TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT = 150; + + /** + * {@code TT_MS_LANGID_XXX} + * + *
Enum values:
+ * + *
    + *
  • {@link #TT_MS_LANGID_ARABIC_SAUDI_ARABIA TT_MS_LANGID_ARABIC_SAUDI_ARABIA}
  • + *
  • {@link #TT_MS_LANGID_ARABIC_IRAQ TT_MS_LANGID_ARABIC_IRAQ}
  • + *
  • {@link #TT_MS_LANGID_ARABIC_EGYPT TT_MS_LANGID_ARABIC_EGYPT}
  • + *
  • {@link #TT_MS_LANGID_ARABIC_LIBYA TT_MS_LANGID_ARABIC_LIBYA}
  • + *
  • {@link #TT_MS_LANGID_ARABIC_ALGERIA TT_MS_LANGID_ARABIC_ALGERIA}
  • + *
  • {@link #TT_MS_LANGID_ARABIC_MOROCCO TT_MS_LANGID_ARABIC_MOROCCO}
  • + *
  • {@link #TT_MS_LANGID_ARABIC_TUNISIA TT_MS_LANGID_ARABIC_TUNISIA}
  • + *
  • {@link #TT_MS_LANGID_ARABIC_OMAN TT_MS_LANGID_ARABIC_OMAN}
  • + *
  • {@link #TT_MS_LANGID_ARABIC_YEMEN TT_MS_LANGID_ARABIC_YEMEN}
  • + *
  • {@link #TT_MS_LANGID_ARABIC_SYRIA TT_MS_LANGID_ARABIC_SYRIA}
  • + *
  • {@link #TT_MS_LANGID_ARABIC_JORDAN TT_MS_LANGID_ARABIC_JORDAN}
  • + *
  • {@link #TT_MS_LANGID_ARABIC_LEBANON TT_MS_LANGID_ARABIC_LEBANON}
  • + *
  • {@link #TT_MS_LANGID_ARABIC_KUWAIT TT_MS_LANGID_ARABIC_KUWAIT}
  • + *
  • {@link #TT_MS_LANGID_ARABIC_UAE TT_MS_LANGID_ARABIC_UAE}
  • + *
  • {@link #TT_MS_LANGID_ARABIC_BAHRAIN TT_MS_LANGID_ARABIC_BAHRAIN}
  • + *
  • {@link #TT_MS_LANGID_ARABIC_QATAR TT_MS_LANGID_ARABIC_QATAR}
  • + *
  • {@link #TT_MS_LANGID_BULGARIAN_BULGARIA TT_MS_LANGID_BULGARIAN_BULGARIA}
  • + *
  • {@link #TT_MS_LANGID_CATALAN_CATALAN TT_MS_LANGID_CATALAN_CATALAN}
  • + *
  • {@link #TT_MS_LANGID_CHINESE_TAIWAN TT_MS_LANGID_CHINESE_TAIWAN}
  • + *
  • {@link #TT_MS_LANGID_CHINESE_PRC TT_MS_LANGID_CHINESE_PRC}
  • + *
  • {@link #TT_MS_LANGID_CHINESE_HONG_KONG TT_MS_LANGID_CHINESE_HONG_KONG}
  • + *
  • {@link #TT_MS_LANGID_CHINESE_SINGAPORE TT_MS_LANGID_CHINESE_SINGAPORE}
  • + *
  • {@link #TT_MS_LANGID_CHINESE_MACAO TT_MS_LANGID_CHINESE_MACAO}
  • + *
  • {@link #TT_MS_LANGID_CZECH_CZECH_REPUBLIC TT_MS_LANGID_CZECH_CZECH_REPUBLIC}
  • + *
  • {@link #TT_MS_LANGID_DANISH_DENMARK TT_MS_LANGID_DANISH_DENMARK}
  • + *
  • {@link #TT_MS_LANGID_GERMAN_GERMANY TT_MS_LANGID_GERMAN_GERMANY}
  • + *
  • {@link #TT_MS_LANGID_GERMAN_SWITZERLAND TT_MS_LANGID_GERMAN_SWITZERLAND}
  • + *
  • {@link #TT_MS_LANGID_GERMAN_AUSTRIA TT_MS_LANGID_GERMAN_AUSTRIA}
  • + *
  • {@link #TT_MS_LANGID_GERMAN_LUXEMBOURG TT_MS_LANGID_GERMAN_LUXEMBOURG}
  • + *
  • {@link #TT_MS_LANGID_GERMAN_LIECHTENSTEIN TT_MS_LANGID_GERMAN_LIECHTENSTEIN}
  • + *
  • {@link #TT_MS_LANGID_GREEK_GREECE TT_MS_LANGID_GREEK_GREECE}
  • + *
  • {@link #TT_MS_LANGID_ENGLISH_UNITED_STATES TT_MS_LANGID_ENGLISH_UNITED_STATES}
  • + *
  • {@link #TT_MS_LANGID_ENGLISH_UNITED_KINGDOM TT_MS_LANGID_ENGLISH_UNITED_KINGDOM}
  • + *
  • {@link #TT_MS_LANGID_ENGLISH_AUSTRALIA TT_MS_LANGID_ENGLISH_AUSTRALIA}
  • + *
  • {@link #TT_MS_LANGID_ENGLISH_CANADA TT_MS_LANGID_ENGLISH_CANADA}
  • + *
  • {@link #TT_MS_LANGID_ENGLISH_NEW_ZEALAND TT_MS_LANGID_ENGLISH_NEW_ZEALAND}
  • + *
  • {@link #TT_MS_LANGID_ENGLISH_IRELAND TT_MS_LANGID_ENGLISH_IRELAND}
  • + *
  • {@link #TT_MS_LANGID_ENGLISH_SOUTH_AFRICA TT_MS_LANGID_ENGLISH_SOUTH_AFRICA}
  • + *
  • {@link #TT_MS_LANGID_ENGLISH_JAMAICA TT_MS_LANGID_ENGLISH_JAMAICA}
  • + *
  • {@link #TT_MS_LANGID_ENGLISH_CARIBBEAN TT_MS_LANGID_ENGLISH_CARIBBEAN}
  • + *
  • {@link #TT_MS_LANGID_ENGLISH_BELIZE TT_MS_LANGID_ENGLISH_BELIZE}
  • + *
  • {@link #TT_MS_LANGID_ENGLISH_TRINIDAD TT_MS_LANGID_ENGLISH_TRINIDAD}
  • + *
  • {@link #TT_MS_LANGID_ENGLISH_ZIMBABWE TT_MS_LANGID_ENGLISH_ZIMBABWE}
  • + *
  • {@link #TT_MS_LANGID_ENGLISH_PHILIPPINES TT_MS_LANGID_ENGLISH_PHILIPPINES}
  • + *
  • {@link #TT_MS_LANGID_ENGLISH_INDIA TT_MS_LANGID_ENGLISH_INDIA}
  • + *
  • {@link #TT_MS_LANGID_ENGLISH_MALAYSIA TT_MS_LANGID_ENGLISH_MALAYSIA}
  • + *
  • {@link #TT_MS_LANGID_ENGLISH_SINGAPORE TT_MS_LANGID_ENGLISH_SINGAPORE}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_MEXICO TT_MS_LANGID_SPANISH_MEXICO}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_SPAIN_MODERN_SORT TT_MS_LANGID_SPANISH_SPAIN_MODERN_SORT}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_GUATEMALA TT_MS_LANGID_SPANISH_GUATEMALA}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_COSTA_RICA TT_MS_LANGID_SPANISH_COSTA_RICA}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_PANAMA TT_MS_LANGID_SPANISH_PANAMA}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_VENEZUELA TT_MS_LANGID_SPANISH_VENEZUELA}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_COLOMBIA TT_MS_LANGID_SPANISH_COLOMBIA}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_PERU TT_MS_LANGID_SPANISH_PERU}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_ARGENTINA TT_MS_LANGID_SPANISH_ARGENTINA}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_ECUADOR TT_MS_LANGID_SPANISH_ECUADOR}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_CHILE TT_MS_LANGID_SPANISH_CHILE}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_URUGUAY TT_MS_LANGID_SPANISH_URUGUAY}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_PARAGUAY TT_MS_LANGID_SPANISH_PARAGUAY}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_BOLIVIA TT_MS_LANGID_SPANISH_BOLIVIA}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_EL_SALVADOR TT_MS_LANGID_SPANISH_EL_SALVADOR}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_HONDURAS TT_MS_LANGID_SPANISH_HONDURAS}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_NICARAGUA TT_MS_LANGID_SPANISH_NICARAGUA}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_PUERTO_RICO TT_MS_LANGID_SPANISH_PUERTO_RICO}
  • + *
  • {@link #TT_MS_LANGID_SPANISH_UNITED_STATES TT_MS_LANGID_SPANISH_UNITED_STATES}
  • + *
  • {@link #TT_MS_LANGID_FINNISH_FINLAND TT_MS_LANGID_FINNISH_FINLAND}
  • + *
  • {@link #TT_MS_LANGID_FRENCH_FRANCE TT_MS_LANGID_FRENCH_FRANCE}
  • + *
  • {@link #TT_MS_LANGID_FRENCH_BELGIUM TT_MS_LANGID_FRENCH_BELGIUM}
  • + *
  • {@link #TT_MS_LANGID_FRENCH_CANADA TT_MS_LANGID_FRENCH_CANADA}
  • + *
  • {@link #TT_MS_LANGID_FRENCH_SWITZERLAND TT_MS_LANGID_FRENCH_SWITZERLAND}
  • + *
  • {@link #TT_MS_LANGID_FRENCH_LUXEMBOURG TT_MS_LANGID_FRENCH_LUXEMBOURG}
  • + *
  • {@link #TT_MS_LANGID_FRENCH_MONACO TT_MS_LANGID_FRENCH_MONACO}
  • + *
  • {@link #TT_MS_LANGID_HEBREW_ISRAEL TT_MS_LANGID_HEBREW_ISRAEL}
  • + *
  • {@link #TT_MS_LANGID_HUNGARIAN_HUNGARY TT_MS_LANGID_HUNGARIAN_HUNGARY}
  • + *
  • {@link #TT_MS_LANGID_ICELANDIC_ICELAND TT_MS_LANGID_ICELANDIC_ICELAND}
  • + *
  • {@link #TT_MS_LANGID_ITALIAN_ITALY TT_MS_LANGID_ITALIAN_ITALY}
  • + *
  • {@link #TT_MS_LANGID_ITALIAN_SWITZERLAND TT_MS_LANGID_ITALIAN_SWITZERLAND}
  • + *
  • {@link #TT_MS_LANGID_JAPANESE_JAPAN TT_MS_LANGID_JAPANESE_JAPAN}
  • + *
  • {@link #TT_MS_LANGID_KOREAN_KOREA TT_MS_LANGID_KOREAN_KOREA}
  • + *
  • {@link #TT_MS_LANGID_DUTCH_NETHERLANDS TT_MS_LANGID_DUTCH_NETHERLANDS}
  • + *
  • {@link #TT_MS_LANGID_DUTCH_BELGIUM TT_MS_LANGID_DUTCH_BELGIUM}
  • + *
  • {@link #TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL}
  • + *
  • {@link #TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK}
  • + *
  • {@link #TT_MS_LANGID_POLISH_POLAND TT_MS_LANGID_POLISH_POLAND}
  • + *
  • {@link #TT_MS_LANGID_PORTUGUESE_BRAZIL TT_MS_LANGID_PORTUGUESE_BRAZIL}
  • + *
  • {@link #TT_MS_LANGID_PORTUGUESE_PORTUGAL TT_MS_LANGID_PORTUGUESE_PORTUGAL}
  • + *
  • {@link #TT_MS_LANGID_ROMANSH_SWITZERLAND TT_MS_LANGID_ROMANSH_SWITZERLAND}
  • + *
  • {@link #TT_MS_LANGID_ROMANIAN_ROMANIA TT_MS_LANGID_ROMANIAN_ROMANIA}
  • + *
  • {@link #TT_MS_LANGID_RUSSIAN_RUSSIA TT_MS_LANGID_RUSSIAN_RUSSIA}
  • + *
  • {@link #TT_MS_LANGID_CROATIAN_CROATIA TT_MS_LANGID_CROATIAN_CROATIA}
  • + *
  • {@link #TT_MS_LANGID_SERBIAN_SERBIA_LATIN TT_MS_LANGID_SERBIAN_SERBIA_LATIN}
  • + *
  • {@link #TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC}
  • + *
  • {@link #TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA}
  • + *
  • {@link #TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA}
  • + *
  • {@link #TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN}
  • + *
  • {@link #TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC}
  • + *
  • {@link #TT_MS_LANGID_BOSNIAN_BOSNIA_HERZ_CYRILLIC TT_MS_LANGID_BOSNIAN_BOSNIA_HERZ_CYRILLIC}
  • + *
  • {@link #TT_MS_LANGID_SLOVAK_SLOVAKIA TT_MS_LANGID_SLOVAK_SLOVAKIA}
  • + *
  • {@link #TT_MS_LANGID_ALBANIAN_ALBANIA TT_MS_LANGID_ALBANIAN_ALBANIA}
  • + *
  • {@link #TT_MS_LANGID_SWEDISH_SWEDEN TT_MS_LANGID_SWEDISH_SWEDEN}
  • + *
  • {@link #TT_MS_LANGID_SWEDISH_FINLAND TT_MS_LANGID_SWEDISH_FINLAND}
  • + *
  • {@link #TT_MS_LANGID_THAI_THAILAND TT_MS_LANGID_THAI_THAILAND}
  • + *
  • {@link #TT_MS_LANGID_TURKISH_TURKEY TT_MS_LANGID_TURKISH_TURKEY}
  • + *
  • {@link #TT_MS_LANGID_URDU_PAKISTAN TT_MS_LANGID_URDU_PAKISTAN}
  • + *
  • {@link #TT_MS_LANGID_INDONESIAN_INDONESIA TT_MS_LANGID_INDONESIAN_INDONESIA}
  • + *
  • {@link #TT_MS_LANGID_UKRAINIAN_UKRAINE TT_MS_LANGID_UKRAINIAN_UKRAINE}
  • + *
  • {@link #TT_MS_LANGID_BELARUSIAN_BELARUS TT_MS_LANGID_BELARUSIAN_BELARUS}
  • + *
  • {@link #TT_MS_LANGID_SLOVENIAN_SLOVENIA TT_MS_LANGID_SLOVENIAN_SLOVENIA}
  • + *
  • {@link #TT_MS_LANGID_ESTONIAN_ESTONIA TT_MS_LANGID_ESTONIAN_ESTONIA}
  • + *
  • {@link #TT_MS_LANGID_LATVIAN_LATVIA TT_MS_LANGID_LATVIAN_LATVIA}
  • + *
  • {@link #TT_MS_LANGID_LITHUANIAN_LITHUANIA TT_MS_LANGID_LITHUANIAN_LITHUANIA}
  • + *
  • {@link #TT_MS_LANGID_TAJIK_TAJIKISTAN TT_MS_LANGID_TAJIK_TAJIKISTAN}
  • + *
  • {@link #TT_MS_LANGID_VIETNAMESE_VIET_NAM TT_MS_LANGID_VIETNAMESE_VIET_NAM}
  • + *
  • {@link #TT_MS_LANGID_ARMENIAN_ARMENIA TT_MS_LANGID_ARMENIAN_ARMENIA}
  • + *
  • {@link #TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN}
  • + *
  • {@link #TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC}
  • + *
  • {@link #TT_MS_LANGID_BASQUE_BASQUE TT_MS_LANGID_BASQUE_BASQUE}
  • + *
  • {@link #TT_MS_LANGID_UPPER_SORBIAN_GERMANY TT_MS_LANGID_UPPER_SORBIAN_GERMANY}
  • + *
  • {@link #TT_MS_LANGID_LOWER_SORBIAN_GERMANY TT_MS_LANGID_LOWER_SORBIAN_GERMANY}
  • + *
  • {@link #TT_MS_LANGID_MACEDONIAN_MACEDONIA TT_MS_LANGID_MACEDONIAN_MACEDONIA}
  • + *
  • {@link #TT_MS_LANGID_SETSWANA_SOUTH_AFRICA TT_MS_LANGID_SETSWANA_SOUTH_AFRICA}
  • + *
  • {@link #TT_MS_LANGID_ISIXHOSA_SOUTH_AFRICA TT_MS_LANGID_ISIXHOSA_SOUTH_AFRICA}
  • + *
  • {@link #TT_MS_LANGID_ISIZULU_SOUTH_AFRICA TT_MS_LANGID_ISIZULU_SOUTH_AFRICA}
  • + *
  • {@link #TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA}
  • + *
  • {@link #TT_MS_LANGID_GEORGIAN_GEORGIA TT_MS_LANGID_GEORGIAN_GEORGIA}
  • + *
  • {@link #TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS}
  • + *
  • {@link #TT_MS_LANGID_HINDI_INDIA TT_MS_LANGID_HINDI_INDIA}
  • + *
  • {@link #TT_MS_LANGID_MALTESE_MALTA TT_MS_LANGID_MALTESE_MALTA}
  • + *
  • {@link #TT_MS_LANGID_SAMI_NORTHERN_NORWAY TT_MS_LANGID_SAMI_NORTHERN_NORWAY}
  • + *
  • {@link #TT_MS_LANGID_SAMI_NORTHERN_SWEDEN TT_MS_LANGID_SAMI_NORTHERN_SWEDEN}
  • + *
  • {@link #TT_MS_LANGID_SAMI_NORTHERN_FINLAND TT_MS_LANGID_SAMI_NORTHERN_FINLAND}
  • + *
  • {@link #TT_MS_LANGID_SAMI_LULE_NORWAY TT_MS_LANGID_SAMI_LULE_NORWAY}
  • + *
  • {@link #TT_MS_LANGID_SAMI_LULE_SWEDEN TT_MS_LANGID_SAMI_LULE_SWEDEN}
  • + *
  • {@link #TT_MS_LANGID_SAMI_SOUTHERN_NORWAY TT_MS_LANGID_SAMI_SOUTHERN_NORWAY}
  • + *
  • {@link #TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN}
  • + *
  • {@link #TT_MS_LANGID_SAMI_SKOLT_FINLAND TT_MS_LANGID_SAMI_SKOLT_FINLAND}
  • + *
  • {@link #TT_MS_LANGID_SAMI_INARI_FINLAND TT_MS_LANGID_SAMI_INARI_FINLAND}
  • + *
  • {@link #TT_MS_LANGID_IRISH_IRELAND TT_MS_LANGID_IRISH_IRELAND}
  • + *
  • {@link #TT_MS_LANGID_MALAY_MALAYSIA TT_MS_LANGID_MALAY_MALAYSIA}
  • + *
  • {@link #TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM}
  • + *
  • {@link #TT_MS_LANGID_KAZAKH_KAZAKHSTAN TT_MS_LANGID_KAZAKH_KAZAKHSTAN}
  • + *
  • {@link #TT_MS_LANGID_KYRGYZ_KYRGYZSTAN TT_MS_LANGID_KYRGYZ_KYRGYZSTAN}
  • + *
  • {@link #TT_MS_LANGID_KISWAHILI_KENYA TT_MS_LANGID_KISWAHILI_KENYA}
  • + *
  • {@link #TT_MS_LANGID_TURKMEN_TURKMENISTAN TT_MS_LANGID_TURKMEN_TURKMENISTAN}
  • + *
  • {@link #TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN}
  • + *
  • {@link #TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC}
  • + *
  • {@link #TT_MS_LANGID_TATAR_RUSSIA TT_MS_LANGID_TATAR_RUSSIA}
  • + *
  • {@link #TT_MS_LANGID_BENGALI_INDIA TT_MS_LANGID_BENGALI_INDIA}
  • + *
  • {@link #TT_MS_LANGID_BENGALI_BANGLADESH TT_MS_LANGID_BENGALI_BANGLADESH}
  • + *
  • {@link #TT_MS_LANGID_PUNJABI_INDIA TT_MS_LANGID_PUNJABI_INDIA}
  • + *
  • {@link #TT_MS_LANGID_GUJARATI_INDIA TT_MS_LANGID_GUJARATI_INDIA}
  • + *
  • {@link #TT_MS_LANGID_ODIA_INDIA TT_MS_LANGID_ODIA_INDIA}
  • + *
  • {@link #TT_MS_LANGID_TAMIL_INDIA TT_MS_LANGID_TAMIL_INDIA}
  • + *
  • {@link #TT_MS_LANGID_TELUGU_INDIA TT_MS_LANGID_TELUGU_INDIA}
  • + *
  • {@link #TT_MS_LANGID_KANNADA_INDIA TT_MS_LANGID_KANNADA_INDIA}
  • + *
  • {@link #TT_MS_LANGID_MALAYALAM_INDIA TT_MS_LANGID_MALAYALAM_INDIA}
  • + *
  • {@link #TT_MS_LANGID_ASSAMESE_INDIA TT_MS_LANGID_ASSAMESE_INDIA}
  • + *
  • {@link #TT_MS_LANGID_MARATHI_INDIA TT_MS_LANGID_MARATHI_INDIA}
  • + *
  • {@link #TT_MS_LANGID_SANSKRIT_INDIA TT_MS_LANGID_SANSKRIT_INDIA}
  • + *
  • {@link #TT_MS_LANGID_MONGOLIAN_MONGOLIA TT_MS_LANGID_MONGOLIAN_MONGOLIA}
  • + *
  • {@link #TT_MS_LANGID_MONGOLIAN_PRC TT_MS_LANGID_MONGOLIAN_PRC}
  • + *
  • {@link #TT_MS_LANGID_TIBETAN_PRC TT_MS_LANGID_TIBETAN_PRC}
  • + *
  • {@link #TT_MS_LANGID_WELSH_UNITED_KINGDOM TT_MS_LANGID_WELSH_UNITED_KINGDOM}
  • + *
  • {@link #TT_MS_LANGID_KHMER_CAMBODIA TT_MS_LANGID_KHMER_CAMBODIA}
  • + *
  • {@link #TT_MS_LANGID_LAO_LAOS TT_MS_LANGID_LAO_LAOS}
  • + *
  • {@link #TT_MS_LANGID_GALICIAN_GALICIAN TT_MS_LANGID_GALICIAN_GALICIAN}
  • + *
  • {@link #TT_MS_LANGID_KONKANI_INDIA TT_MS_LANGID_KONKANI_INDIA}
  • + *
  • {@link #TT_MS_LANGID_SYRIAC_SYRIA TT_MS_LANGID_SYRIAC_SYRIA}
  • + *
  • {@link #TT_MS_LANGID_SINHALA_SRI_LANKA TT_MS_LANGID_SINHALA_SRI_LANKA}
  • + *
  • {@link #TT_MS_LANGID_INUKTITUT_CANADA TT_MS_LANGID_INUKTITUT_CANADA}
  • + *
  • {@link #TT_MS_LANGID_INUKTITUT_CANADA_LATIN TT_MS_LANGID_INUKTITUT_CANADA_LATIN}
  • + *
  • {@link #TT_MS_LANGID_AMHARIC_ETHIOPIA TT_MS_LANGID_AMHARIC_ETHIOPIA}
  • + *
  • {@link #TT_MS_LANGID_TAMAZIGHT_ALGERIA TT_MS_LANGID_TAMAZIGHT_ALGERIA}
  • + *
  • {@link #TT_MS_LANGID_NEPALI_NEPAL TT_MS_LANGID_NEPALI_NEPAL}
  • + *
  • {@link #TT_MS_LANGID_FRISIAN_NETHERLANDS TT_MS_LANGID_FRISIAN_NETHERLANDS}
  • + *
  • {@link #TT_MS_LANGID_PASHTO_AFGHANISTAN TT_MS_LANGID_PASHTO_AFGHANISTAN}
  • + *
  • {@link #TT_MS_LANGID_FILIPINO_PHILIPPINES TT_MS_LANGID_FILIPINO_PHILIPPINES}
  • + *
  • {@link #TT_MS_LANGID_DHIVEHI_MALDIVES TT_MS_LANGID_DHIVEHI_MALDIVES}
  • + *
  • {@link #TT_MS_LANGID_HAUSA_NIGERIA TT_MS_LANGID_HAUSA_NIGERIA}
  • + *
  • {@link #TT_MS_LANGID_YORUBA_NIGERIA TT_MS_LANGID_YORUBA_NIGERIA}
  • + *
  • {@link #TT_MS_LANGID_QUECHUA_BOLIVIA TT_MS_LANGID_QUECHUA_BOLIVIA}
  • + *
  • {@link #TT_MS_LANGID_QUECHUA_ECUADOR TT_MS_LANGID_QUECHUA_ECUADOR}
  • + *
  • {@link #TT_MS_LANGID_QUECHUA_PERU TT_MS_LANGID_QUECHUA_PERU}
  • + *
  • {@link #TT_MS_LANGID_SESOTHO_SA_LEBOA_SOUTH_AFRICA TT_MS_LANGID_SESOTHO_SA_LEBOA_SOUTH_AFRICA}
  • + *
  • {@link #TT_MS_LANGID_BASHKIR_RUSSIA TT_MS_LANGID_BASHKIR_RUSSIA}
  • + *
  • {@link #TT_MS_LANGID_LUXEMBOURGISH_LUXEMBOURG TT_MS_LANGID_LUXEMBOURGISH_LUXEMBOURG}
  • + *
  • {@link #TT_MS_LANGID_GREENLANDIC_GREENLAND TT_MS_LANGID_GREENLANDIC_GREENLAND}
  • + *
  • {@link #TT_MS_LANGID_IGBO_NIGERIA TT_MS_LANGID_IGBO_NIGERIA}
  • + *
  • {@link #TT_MS_LANGID_YI_PRC TT_MS_LANGID_YI_PRC}
  • + *
  • {@link #TT_MS_LANGID_MAPUDUNGUN_CHILE TT_MS_LANGID_MAPUDUNGUN_CHILE}
  • + *
  • {@link #TT_MS_LANGID_MOHAWK_MOHAWK TT_MS_LANGID_MOHAWK_MOHAWK}
  • + *
  • {@link #TT_MS_LANGID_BRETON_FRANCE TT_MS_LANGID_BRETON_FRANCE}
  • + *
  • {@link #TT_MS_LANGID_UIGHUR_PRC TT_MS_LANGID_UIGHUR_PRC}
  • + *
  • {@link #TT_MS_LANGID_MAORI_NEW_ZEALAND TT_MS_LANGID_MAORI_NEW_ZEALAND}
  • + *
  • {@link #TT_MS_LANGID_OCCITAN_FRANCE TT_MS_LANGID_OCCITAN_FRANCE}
  • + *
  • {@link #TT_MS_LANGID_CORSICAN_FRANCE TT_MS_LANGID_CORSICAN_FRANCE}
  • + *
  • {@link #TT_MS_LANGID_ALSATIAN_FRANCE TT_MS_LANGID_ALSATIAN_FRANCE}
  • + *
  • {@link #TT_MS_LANGID_YAKUT_RUSSIA TT_MS_LANGID_YAKUT_RUSSIA}
  • + *
  • {@link #TT_MS_LANGID_KICHE_GUATEMALA TT_MS_LANGID_KICHE_GUATEMALA}
  • + *
  • {@link #TT_MS_LANGID_KINYARWANDA_RWANDA TT_MS_LANGID_KINYARWANDA_RWANDA}
  • + *
  • {@link #TT_MS_LANGID_WOLOF_SENEGAL TT_MS_LANGID_WOLOF_SENEGAL}
  • + *
  • {@link #TT_MS_LANGID_DARI_AFGHANISTAN TT_MS_LANGID_DARI_AFGHANISTAN}
  • + *
+ */ + public static final int + TT_MS_LANGID_ARABIC_SAUDI_ARABIA = 0x0401, + TT_MS_LANGID_ARABIC_IRAQ = 0x0801, + TT_MS_LANGID_ARABIC_EGYPT = 0x0C01, + TT_MS_LANGID_ARABIC_LIBYA = 0x1001, + TT_MS_LANGID_ARABIC_ALGERIA = 0x1401, + TT_MS_LANGID_ARABIC_MOROCCO = 0x1801, + TT_MS_LANGID_ARABIC_TUNISIA = 0x1C01, + TT_MS_LANGID_ARABIC_OMAN = 0x2001, + TT_MS_LANGID_ARABIC_YEMEN = 0x2401, + TT_MS_LANGID_ARABIC_SYRIA = 0x2801, + TT_MS_LANGID_ARABIC_JORDAN = 0x2C01, + TT_MS_LANGID_ARABIC_LEBANON = 0x3001, + TT_MS_LANGID_ARABIC_KUWAIT = 0x3401, + TT_MS_LANGID_ARABIC_UAE = 0x3801, + TT_MS_LANGID_ARABIC_BAHRAIN = 0x3C01, + TT_MS_LANGID_ARABIC_QATAR = 0x4001, + TT_MS_LANGID_BULGARIAN_BULGARIA = 0x0402, + TT_MS_LANGID_CATALAN_CATALAN = 0x0403, + TT_MS_LANGID_CHINESE_TAIWAN = 0x0404, + TT_MS_LANGID_CHINESE_PRC = 0x0804, + TT_MS_LANGID_CHINESE_HONG_KONG = 0x0C04, + TT_MS_LANGID_CHINESE_SINGAPORE = 0x1004, + TT_MS_LANGID_CHINESE_MACAO = 0x1404, + TT_MS_LANGID_CZECH_CZECH_REPUBLIC = 0x0405, + TT_MS_LANGID_DANISH_DENMARK = 0x0406, + TT_MS_LANGID_GERMAN_GERMANY = 0x0407, + TT_MS_LANGID_GERMAN_SWITZERLAND = 0x0807, + TT_MS_LANGID_GERMAN_AUSTRIA = 0x0C07, + TT_MS_LANGID_GERMAN_LUXEMBOURG = 0x1007, + TT_MS_LANGID_GERMAN_LIECHTENSTEIN = 0x1407, + TT_MS_LANGID_GREEK_GREECE = 0x0408, + TT_MS_LANGID_ENGLISH_UNITED_STATES = 0x0409, + TT_MS_LANGID_ENGLISH_UNITED_KINGDOM = 0x0809, + TT_MS_LANGID_ENGLISH_AUSTRALIA = 0x0C09, + TT_MS_LANGID_ENGLISH_CANADA = 0x1009, + TT_MS_LANGID_ENGLISH_NEW_ZEALAND = 0x1409, + TT_MS_LANGID_ENGLISH_IRELAND = 0x1809, + TT_MS_LANGID_ENGLISH_SOUTH_AFRICA = 0x1C09, + TT_MS_LANGID_ENGLISH_JAMAICA = 0x2009, + TT_MS_LANGID_ENGLISH_CARIBBEAN = 0x2409, + TT_MS_LANGID_ENGLISH_BELIZE = 0x2809, + TT_MS_LANGID_ENGLISH_TRINIDAD = 0x2C09, + TT_MS_LANGID_ENGLISH_ZIMBABWE = 0x3009, + TT_MS_LANGID_ENGLISH_PHILIPPINES = 0x3409, + TT_MS_LANGID_ENGLISH_INDIA = 0x4009, + TT_MS_LANGID_ENGLISH_MALAYSIA = 0x4409, + TT_MS_LANGID_ENGLISH_SINGAPORE = 0x4809, + TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT = 0x040A, + TT_MS_LANGID_SPANISH_MEXICO = 0x080A, + TT_MS_LANGID_SPANISH_SPAIN_MODERN_SORT = 0x0C0A, + TT_MS_LANGID_SPANISH_GUATEMALA = 0x100A, + TT_MS_LANGID_SPANISH_COSTA_RICA = 0x140A, + TT_MS_LANGID_SPANISH_PANAMA = 0x180A, + TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC = 0x1C0A, + TT_MS_LANGID_SPANISH_VENEZUELA = 0x200A, + TT_MS_LANGID_SPANISH_COLOMBIA = 0x240A, + TT_MS_LANGID_SPANISH_PERU = 0x280A, + TT_MS_LANGID_SPANISH_ARGENTINA = 0x2C0A, + TT_MS_LANGID_SPANISH_ECUADOR = 0x300A, + TT_MS_LANGID_SPANISH_CHILE = 0x340A, + TT_MS_LANGID_SPANISH_URUGUAY = 0x380A, + TT_MS_LANGID_SPANISH_PARAGUAY = 0x3C0A, + TT_MS_LANGID_SPANISH_BOLIVIA = 0x400A, + TT_MS_LANGID_SPANISH_EL_SALVADOR = 0x440A, + TT_MS_LANGID_SPANISH_HONDURAS = 0x480A, + TT_MS_LANGID_SPANISH_NICARAGUA = 0x4C0A, + TT_MS_LANGID_SPANISH_PUERTO_RICO = 0x500A, + TT_MS_LANGID_SPANISH_UNITED_STATES = 0x540A, + TT_MS_LANGID_FINNISH_FINLAND = 0x040B, + TT_MS_LANGID_FRENCH_FRANCE = 0x040C, + TT_MS_LANGID_FRENCH_BELGIUM = 0x080C, + TT_MS_LANGID_FRENCH_CANADA = 0x0C0C, + TT_MS_LANGID_FRENCH_SWITZERLAND = 0x100C, + TT_MS_LANGID_FRENCH_LUXEMBOURG = 0x140C, + TT_MS_LANGID_FRENCH_MONACO = 0x180C, + TT_MS_LANGID_HEBREW_ISRAEL = 0x040D, + TT_MS_LANGID_HUNGARIAN_HUNGARY = 0x040E, + TT_MS_LANGID_ICELANDIC_ICELAND = 0x040F, + TT_MS_LANGID_ITALIAN_ITALY = 0x0410, + TT_MS_LANGID_ITALIAN_SWITZERLAND = 0x0810, + TT_MS_LANGID_JAPANESE_JAPAN = 0x0411, + TT_MS_LANGID_KOREAN_KOREA = 0x0412, + TT_MS_LANGID_DUTCH_NETHERLANDS = 0x0413, + TT_MS_LANGID_DUTCH_BELGIUM = 0x0813, + TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL = 0x0414, + TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK = 0x0814, + TT_MS_LANGID_POLISH_POLAND = 0x0415, + TT_MS_LANGID_PORTUGUESE_BRAZIL = 0x0416, + TT_MS_LANGID_PORTUGUESE_PORTUGAL = 0x0816, + TT_MS_LANGID_ROMANSH_SWITZERLAND = 0x0417, + TT_MS_LANGID_ROMANIAN_ROMANIA = 0x0418, + TT_MS_LANGID_RUSSIAN_RUSSIA = 0x0419, + TT_MS_LANGID_CROATIAN_CROATIA = 0x041A, + TT_MS_LANGID_SERBIAN_SERBIA_LATIN = 0x081A, + TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC = 0x0C1A, + TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA = 0x101A, + TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA = 0x141A, + TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN = 0x181A, + TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC = 0x1C1A, + TT_MS_LANGID_BOSNIAN_BOSNIA_HERZ_CYRILLIC = 0x201A, + TT_MS_LANGID_SLOVAK_SLOVAKIA = 0x041B, + TT_MS_LANGID_ALBANIAN_ALBANIA = 0x041C, + TT_MS_LANGID_SWEDISH_SWEDEN = 0x041D, + TT_MS_LANGID_SWEDISH_FINLAND = 0x081D, + TT_MS_LANGID_THAI_THAILAND = 0x041E, + TT_MS_LANGID_TURKISH_TURKEY = 0x041F, + TT_MS_LANGID_URDU_PAKISTAN = 0x0420, + TT_MS_LANGID_INDONESIAN_INDONESIA = 0x0421, + TT_MS_LANGID_UKRAINIAN_UKRAINE = 0x0422, + TT_MS_LANGID_BELARUSIAN_BELARUS = 0x0423, + TT_MS_LANGID_SLOVENIAN_SLOVENIA = 0x0424, + TT_MS_LANGID_ESTONIAN_ESTONIA = 0x0425, + TT_MS_LANGID_LATVIAN_LATVIA = 0x0426, + TT_MS_LANGID_LITHUANIAN_LITHUANIA = 0x0427, + TT_MS_LANGID_TAJIK_TAJIKISTAN = 0x0428, + TT_MS_LANGID_VIETNAMESE_VIET_NAM = 0x042A, + TT_MS_LANGID_ARMENIAN_ARMENIA = 0x042B, + TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN = 0x042C, + TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC = 0x082C, + TT_MS_LANGID_BASQUE_BASQUE = 0x042D, + TT_MS_LANGID_UPPER_SORBIAN_GERMANY = 0x042E, + TT_MS_LANGID_LOWER_SORBIAN_GERMANY = 0x082E, + TT_MS_LANGID_MACEDONIAN_MACEDONIA = 0x042F, + TT_MS_LANGID_SETSWANA_SOUTH_AFRICA = 0x0432, + TT_MS_LANGID_ISIXHOSA_SOUTH_AFRICA = 0x0434, + TT_MS_LANGID_ISIZULU_SOUTH_AFRICA = 0x0435, + TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA = 0x0436, + TT_MS_LANGID_GEORGIAN_GEORGIA = 0x0437, + TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS = 0x0438, + TT_MS_LANGID_HINDI_INDIA = 0x0439, + TT_MS_LANGID_MALTESE_MALTA = 0x043A, + TT_MS_LANGID_SAMI_NORTHERN_NORWAY = 0x043B, + TT_MS_LANGID_SAMI_NORTHERN_SWEDEN = 0x083B, + TT_MS_LANGID_SAMI_NORTHERN_FINLAND = 0x0C3B, + TT_MS_LANGID_SAMI_LULE_NORWAY = 0x103B, + TT_MS_LANGID_SAMI_LULE_SWEDEN = 0x143B, + TT_MS_LANGID_SAMI_SOUTHERN_NORWAY = 0x183B, + TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN = 0x1C3B, + TT_MS_LANGID_SAMI_SKOLT_FINLAND = 0x203B, + TT_MS_LANGID_SAMI_INARI_FINLAND = 0x243B, + TT_MS_LANGID_IRISH_IRELAND = 0x083C, + TT_MS_LANGID_MALAY_MALAYSIA = 0x043E, + TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM = 0x083E, + TT_MS_LANGID_KAZAKH_KAZAKHSTAN = 0x043F, + TT_MS_LANGID_KYRGYZ_KYRGYZSTAN = 0x0440, + TT_MS_LANGID_KISWAHILI_KENYA = 0x0441, + TT_MS_LANGID_TURKMEN_TURKMENISTAN = 0x0442, + TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN = 0x0443, + TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC = 0x0843, + TT_MS_LANGID_TATAR_RUSSIA = 0x0444, + TT_MS_LANGID_BENGALI_INDIA = 0x0445, + TT_MS_LANGID_BENGALI_BANGLADESH = 0x0845, + TT_MS_LANGID_PUNJABI_INDIA = 0x0446, + TT_MS_LANGID_GUJARATI_INDIA = 0x0447, + TT_MS_LANGID_ODIA_INDIA = 0x0448, + TT_MS_LANGID_TAMIL_INDIA = 0x0449, + TT_MS_LANGID_TELUGU_INDIA = 0x044A, + TT_MS_LANGID_KANNADA_INDIA = 0x044B, + TT_MS_LANGID_MALAYALAM_INDIA = 0x044C, + TT_MS_LANGID_ASSAMESE_INDIA = 0x044D, + TT_MS_LANGID_MARATHI_INDIA = 0x044E, + TT_MS_LANGID_SANSKRIT_INDIA = 0x044F, + TT_MS_LANGID_MONGOLIAN_MONGOLIA = 0x0450, + TT_MS_LANGID_MONGOLIAN_PRC = 0x0850, + TT_MS_LANGID_TIBETAN_PRC = 0x0451, + TT_MS_LANGID_WELSH_UNITED_KINGDOM = 0x0452, + TT_MS_LANGID_KHMER_CAMBODIA = 0x0453, + TT_MS_LANGID_LAO_LAOS = 0x0454, + TT_MS_LANGID_GALICIAN_GALICIAN = 0x0456, + TT_MS_LANGID_KONKANI_INDIA = 0x0457, + TT_MS_LANGID_SYRIAC_SYRIA = 0x045A, + TT_MS_LANGID_SINHALA_SRI_LANKA = 0x045B, + TT_MS_LANGID_INUKTITUT_CANADA = 0x045D, + TT_MS_LANGID_INUKTITUT_CANADA_LATIN = 0x085D, + TT_MS_LANGID_AMHARIC_ETHIOPIA = 0x045E, + TT_MS_LANGID_TAMAZIGHT_ALGERIA = 0x085F, + TT_MS_LANGID_NEPALI_NEPAL = 0x0461, + TT_MS_LANGID_FRISIAN_NETHERLANDS = 0x0462, + TT_MS_LANGID_PASHTO_AFGHANISTAN = 0x0463, + TT_MS_LANGID_FILIPINO_PHILIPPINES = 0x0464, + TT_MS_LANGID_DHIVEHI_MALDIVES = 0x0465, + TT_MS_LANGID_HAUSA_NIGERIA = 0x0468, + TT_MS_LANGID_YORUBA_NIGERIA = 0x046A, + TT_MS_LANGID_QUECHUA_BOLIVIA = 0x046B, + TT_MS_LANGID_QUECHUA_ECUADOR = 0x086B, + TT_MS_LANGID_QUECHUA_PERU = 0x0C6B, + TT_MS_LANGID_SESOTHO_SA_LEBOA_SOUTH_AFRICA = 0x046C, + TT_MS_LANGID_BASHKIR_RUSSIA = 0x046D, + TT_MS_LANGID_LUXEMBOURGISH_LUXEMBOURG = 0x046E, + TT_MS_LANGID_GREENLANDIC_GREENLAND = 0x046F, + TT_MS_LANGID_IGBO_NIGERIA = 0x0470, + TT_MS_LANGID_YI_PRC = 0x0478, + TT_MS_LANGID_MAPUDUNGUN_CHILE = 0x047A, + TT_MS_LANGID_MOHAWK_MOHAWK = 0x047C, + TT_MS_LANGID_BRETON_FRANCE = 0x047E, + TT_MS_LANGID_UIGHUR_PRC = 0x0480, + TT_MS_LANGID_MAORI_NEW_ZEALAND = 0x0481, + TT_MS_LANGID_OCCITAN_FRANCE = 0x0482, + TT_MS_LANGID_CORSICAN_FRANCE = 0x0483, + TT_MS_LANGID_ALSATIAN_FRANCE = 0x0484, + TT_MS_LANGID_YAKUT_RUSSIA = 0x0485, + TT_MS_LANGID_KICHE_GUATEMALA = 0x0486, + TT_MS_LANGID_KINYARWANDA_RWANDA = 0x0487, + TT_MS_LANGID_WOLOF_SENEGAL = 0x0488, + TT_MS_LANGID_DARI_AFGHANISTAN = 0x048C; + + /** + *
Enum values:
+ * + *
    + *
  • {@link #TT_NAME_ID_COPYRIGHT TT_NAME_ID_COPYRIGHT}
  • + *
  • {@link #TT_NAME_ID_FONT_FAMILY TT_NAME_ID_FONT_FAMILY}
  • + *
  • {@link #TT_NAME_ID_FONT_SUBFAMILY TT_NAME_ID_FONT_SUBFAMILY}
  • + *
  • {@link #TT_NAME_ID_UNIQUE_ID TT_NAME_ID_UNIQUE_ID}
  • + *
  • {@link #TT_NAME_ID_FULL_NAME TT_NAME_ID_FULL_NAME}
  • + *
  • {@link #TT_NAME_ID_VERSION_STRING TT_NAME_ID_VERSION_STRING}
  • + *
  • {@link #TT_NAME_ID_PS_NAME TT_NAME_ID_PS_NAME}
  • + *
  • {@link #TT_NAME_ID_TRADEMARK TT_NAME_ID_TRADEMARK}
  • + *
  • {@link #TT_NAME_ID_MANUFACTURER TT_NAME_ID_MANUFACTURER}
  • + *
  • {@link #TT_NAME_ID_DESIGNER TT_NAME_ID_DESIGNER}
  • + *
  • {@link #TT_NAME_ID_DESCRIPTION TT_NAME_ID_DESCRIPTION}
  • + *
  • {@link #TT_NAME_ID_VENDOR_URL TT_NAME_ID_VENDOR_URL}
  • + *
  • {@link #TT_NAME_ID_DESIGNER_URL TT_NAME_ID_DESIGNER_URL}
  • + *
  • {@link #TT_NAME_ID_LICENSE TT_NAME_ID_LICENSE}
  • + *
  • {@link #TT_NAME_ID_LICENSE_URL TT_NAME_ID_LICENSE_URL}
  • + *
  • {@link #TT_NAME_ID_TYPOGRAPHIC_FAMILY TT_NAME_ID_TYPOGRAPHIC_FAMILY}
  • + *
  • {@link #TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY}
  • + *
  • {@link #TT_NAME_ID_MAC_FULL_NAME TT_NAME_ID_MAC_FULL_NAME}
  • + *
  • {@link #TT_NAME_ID_SAMPLE_TEXT TT_NAME_ID_SAMPLE_TEXT}
  • + *
  • {@link #TT_NAME_ID_CID_FINDFONT_NAME TT_NAME_ID_CID_FINDFONT_NAME}
  • + *
  • {@link #TT_NAME_ID_WWS_FAMILY TT_NAME_ID_WWS_FAMILY}
  • + *
  • {@link #TT_NAME_ID_WWS_SUBFAMILY TT_NAME_ID_WWS_SUBFAMILY}
  • + *
  • {@link #TT_NAME_ID_LIGHT_BACKGROUND TT_NAME_ID_LIGHT_BACKGROUND}
  • + *
  • {@link #TT_NAME_ID_DARK_BACKGROUND TT_NAME_ID_DARK_BACKGROUND}
  • + *
  • {@link #TT_NAME_ID_VARIATIONS_PREFIX TT_NAME_ID_VARIATIONS_PREFIX}
  • + *
+ */ + public static final int + TT_NAME_ID_COPYRIGHT = 0, + TT_NAME_ID_FONT_FAMILY = 1, + TT_NAME_ID_FONT_SUBFAMILY = 2, + TT_NAME_ID_UNIQUE_ID = 3, + TT_NAME_ID_FULL_NAME = 4, + TT_NAME_ID_VERSION_STRING = 5, + TT_NAME_ID_PS_NAME = 6, + TT_NAME_ID_TRADEMARK = 7, + TT_NAME_ID_MANUFACTURER = 8, + TT_NAME_ID_DESIGNER = 9, + TT_NAME_ID_DESCRIPTION = 10, + TT_NAME_ID_VENDOR_URL = 11, + TT_NAME_ID_DESIGNER_URL = 12, + TT_NAME_ID_LICENSE = 13, + TT_NAME_ID_LICENSE_URL = 14, + TT_NAME_ID_TYPOGRAPHIC_FAMILY = 16, + TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY = 17, + TT_NAME_ID_MAC_FULL_NAME = 18, + TT_NAME_ID_SAMPLE_TEXT = 19, + TT_NAME_ID_CID_FINDFONT_NAME = 20, + TT_NAME_ID_WWS_FAMILY = 21, + TT_NAME_ID_WWS_SUBFAMILY = 22, + TT_NAME_ID_LIGHT_BACKGROUND = 23, + TT_NAME_ID_DARK_BACKGROUND = 24, + TT_NAME_ID_VARIATIONS_PREFIX = 25; + + /** + *
Enum values:
+ * + *
    + *
  • {@link #TT_UCR_BASIC_LATIN TT_UCR_BASIC_LATIN}
  • + *
  • {@link #TT_UCR_LATIN1_SUPPLEMENT TT_UCR_LATIN1_SUPPLEMENT}
  • + *
  • {@link #TT_UCR_LATIN_EXTENDED_A TT_UCR_LATIN_EXTENDED_A}
  • + *
  • {@link #TT_UCR_LATIN_EXTENDED_B TT_UCR_LATIN_EXTENDED_B}
  • + *
  • {@link #TT_UCR_IPA_EXTENSIONS TT_UCR_IPA_EXTENSIONS}
  • + *
  • {@link #TT_UCR_SPACING_MODIFIER TT_UCR_SPACING_MODIFIER}
  • + *
  • {@link #TT_UCR_COMBINING_DIACRITICAL_MARKS TT_UCR_COMBINING_DIACRITICAL_MARKS}
  • + *
  • {@link #TT_UCR_GREEK TT_UCR_GREEK}
  • + *
  • {@link #TT_UCR_COPTIC TT_UCR_COPTIC}
  • + *
  • {@link #TT_UCR_CYRILLIC TT_UCR_CYRILLIC}
  • + *
  • {@link #TT_UCR_ARMENIAN TT_UCR_ARMENIAN}
  • + *
  • {@link #TT_UCR_HEBREW TT_UCR_HEBREW}
  • + *
  • {@link #TT_UCR_VAI TT_UCR_VAI}
  • + *
  • {@link #TT_UCR_ARABIC TT_UCR_ARABIC}
  • + *
  • {@link #TT_UCR_NKO TT_UCR_NKO}
  • + *
  • {@link #TT_UCR_DEVANAGARI TT_UCR_DEVANAGARI}
  • + *
  • {@link #TT_UCR_BENGALI TT_UCR_BENGALI}
  • + *
  • {@link #TT_UCR_GURMUKHI TT_UCR_GURMUKHI}
  • + *
  • {@link #TT_UCR_GUJARATI TT_UCR_GUJARATI}
  • + *
  • {@link #TT_UCR_ORIYA TT_UCR_ORIYA}
  • + *
  • {@link #TT_UCR_TAMIL TT_UCR_TAMIL}
  • + *
  • {@link #TT_UCR_TELUGU TT_UCR_TELUGU}
  • + *
  • {@link #TT_UCR_KANNADA TT_UCR_KANNADA}
  • + *
  • {@link #TT_UCR_MALAYALAM TT_UCR_MALAYALAM}
  • + *
  • {@link #TT_UCR_THAI TT_UCR_THAI}
  • + *
  • {@link #TT_UCR_LAO TT_UCR_LAO}
  • + *
  • {@link #TT_UCR_GEORGIAN TT_UCR_GEORGIAN}
  • + *
  • {@link #TT_UCR_BALINESE TT_UCR_BALINESE}
  • + *
  • {@link #TT_UCR_HANGUL_JAMO TT_UCR_HANGUL_JAMO}
  • + *
  • {@link #TT_UCR_LATIN_EXTENDED_ADDITIONAL TT_UCR_LATIN_EXTENDED_ADDITIONAL}
  • + *
  • {@link #TT_UCR_GREEK_EXTENDED TT_UCR_GREEK_EXTENDED}
  • + *
  • {@link #TT_UCR_GENERAL_PUNCTUATION TT_UCR_GENERAL_PUNCTUATION}
  • + *
  • {@link #TT_UCR_SUPERSCRIPTS_SUBSCRIPTS TT_UCR_SUPERSCRIPTS_SUBSCRIPTS}
  • + *
  • {@link #TT_UCR_CURRENCY_SYMBOLS TT_UCR_CURRENCY_SYMBOLS}
  • + *
  • {@link #TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB}
  • + *
  • {@link #TT_UCR_LETTERLIKE_SYMBOLS TT_UCR_LETTERLIKE_SYMBOLS}
  • + *
  • {@link #TT_UCR_NUMBER_FORMS TT_UCR_NUMBER_FORMS}
  • + *
  • {@link #TT_UCR_ARROWS TT_UCR_ARROWS}
  • + *
  • {@link #TT_UCR_MATHEMATICAL_OPERATORS TT_UCR_MATHEMATICAL_OPERATORS}
  • + *
  • {@link #TT_UCR_MISCELLANEOUS_TECHNICAL TT_UCR_MISCELLANEOUS_TECHNICAL}
  • + *
  • {@link #TT_UCR_CONTROL_PICTURES TT_UCR_CONTROL_PICTURES}
  • + *
  • {@link #TT_UCR_OCR TT_UCR_OCR}
  • + *
  • {@link #TT_UCR_ENCLOSED_ALPHANUMERICS TT_UCR_ENCLOSED_ALPHANUMERICS}
  • + *
  • {@link #TT_UCR_BOX_DRAWING TT_UCR_BOX_DRAWING}
  • + *
  • {@link #TT_UCR_BLOCK_ELEMENTS TT_UCR_BLOCK_ELEMENTS}
  • + *
  • {@link #TT_UCR_GEOMETRIC_SHAPES TT_UCR_GEOMETRIC_SHAPES}
  • + *
  • {@link #TT_UCR_MISCELLANEOUS_SYMBOLS TT_UCR_MISCELLANEOUS_SYMBOLS}
  • + *
  • {@link #TT_UCR_DINGBATS TT_UCR_DINGBATS}
  • + *
  • {@link #TT_UCR_CJK_SYMBOLS TT_UCR_CJK_SYMBOLS}
  • + *
  • {@link #TT_UCR_HIRAGANA TT_UCR_HIRAGANA}
  • + *
  • {@link #TT_UCR_KATAKANA TT_UCR_KATAKANA}
  • + *
  • {@link #TT_UCR_BOPOMOFO TT_UCR_BOPOMOFO}
  • + *
  • {@link #TT_UCR_HANGUL_COMPATIBILITY_JAMO TT_UCR_HANGUL_COMPATIBILITY_JAMO}
  • + *
  • {@link #TT_UCR_CJK_MISC TT_UCR_CJK_MISC}
  • + *
  • {@link #TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS}
  • + *
  • {@link #TT_UCR_CJK_COMPATIBILITY TT_UCR_CJK_COMPATIBILITY}
  • + *
  • {@link #TT_UCR_HANGUL TT_UCR_HANGUL}
  • + *
  • {@link #TT_UCR_SURROGATES TT_UCR_SURROGATES}
  • + *
  • {@link #TT_UCR_PHOENICIAN TT_UCR_PHOENICIAN}
  • + *
  • {@link #TT_UCR_CJK_UNIFIED_IDEOGRAPHS TT_UCR_CJK_UNIFIED_IDEOGRAPHS}
  • + *
  • {@link #TT_UCR_PRIVATE_USE TT_UCR_PRIVATE_USE}
  • + *
  • {@link #TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS}
  • + *
  • {@link #TT_UCR_ALPHABETIC_PRESENTATION_FORMS TT_UCR_ALPHABETIC_PRESENTATION_FORMS}
  • + *
  • {@link #TT_UCR_ARABIC_PRESENTATION_FORMS_A TT_UCR_ARABIC_PRESENTATION_FORMS_A}
  • + *
  • {@link #TT_UCR_COMBINING_HALF_MARKS TT_UCR_COMBINING_HALF_MARKS}
  • + *
  • {@link #TT_UCR_CJK_COMPATIBILITY_FORMS TT_UCR_CJK_COMPATIBILITY_FORMS}
  • + *
  • {@link #TT_UCR_SMALL_FORM_VARIANTS TT_UCR_SMALL_FORM_VARIANTS}
  • + *
  • {@link #TT_UCR_ARABIC_PRESENTATION_FORMS_B TT_UCR_ARABIC_PRESENTATION_FORMS_B}
  • + *
  • {@link #TT_UCR_HALFWIDTH_FULLWIDTH_FORMS TT_UCR_HALFWIDTH_FULLWIDTH_FORMS}
  • + *
  • {@link #TT_UCR_SPECIALS TT_UCR_SPECIALS}
  • + *
  • {@link #TT_UCR_TIBETAN TT_UCR_TIBETAN}
  • + *
  • {@link #TT_UCR_SYRIAC TT_UCR_SYRIAC}
  • + *
  • {@link #TT_UCR_THAANA TT_UCR_THAANA}
  • + *
  • {@link #TT_UCR_SINHALA TT_UCR_SINHALA}
  • + *
  • {@link #TT_UCR_MYANMAR TT_UCR_MYANMAR}
  • + *
  • {@link #TT_UCR_ETHIOPIC TT_UCR_ETHIOPIC}
  • + *
  • {@link #TT_UCR_CHEROKEE TT_UCR_CHEROKEE}
  • + *
  • {@link #TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS}
  • + *
  • {@link #TT_UCR_OGHAM TT_UCR_OGHAM}
  • + *
  • {@link #TT_UCR_RUNIC TT_UCR_RUNIC}
  • + *
  • {@link #TT_UCR_KHMER TT_UCR_KHMER}
  • + *
  • {@link #TT_UCR_MONGOLIAN TT_UCR_MONGOLIAN}
  • + *
  • {@link #TT_UCR_BRAILLE TT_UCR_BRAILLE}
  • + *
  • {@link #TT_UCR_YI TT_UCR_YI}
  • + *
  • {@link #TT_UCR_PHILIPPINE TT_UCR_PHILIPPINE}
  • + *
  • {@link #TT_UCR_OLD_ITALIC TT_UCR_OLD_ITALIC}
  • + *
  • {@link #TT_UCR_GOTHIC TT_UCR_GOTHIC}
  • + *
  • {@link #TT_UCR_DESERET TT_UCR_DESERET}
  • + *
  • {@link #TT_UCR_MUSICAL_SYMBOLS TT_UCR_MUSICAL_SYMBOLS}
  • + *
  • {@link #TT_UCR_MATH_ALPHANUMERIC_SYMBOLS TT_UCR_MATH_ALPHANUMERIC_SYMBOLS}
  • + *
  • {@link #TT_UCR_PRIVATE_USE_SUPPLEMENTARY TT_UCR_PRIVATE_USE_SUPPLEMENTARY}
  • + *
  • {@link #TT_UCR_VARIATION_SELECTORS TT_UCR_VARIATION_SELECTORS}
  • + *
  • {@link #TT_UCR_TAGS TT_UCR_TAGS}
  • + *
  • {@link #TT_UCR_LIMBU TT_UCR_LIMBU}
  • + *
  • {@link #TT_UCR_TAI_LE TT_UCR_TAI_LE}
  • + *
  • {@link #TT_UCR_NEW_TAI_LUE TT_UCR_NEW_TAI_LUE}
  • + *
  • {@link #TT_UCR_BUGINESE TT_UCR_BUGINESE}
  • + *
  • {@link #TT_UCR_GLAGOLITIC TT_UCR_GLAGOLITIC}
  • + *
  • {@link #TT_UCR_TIFINAGH TT_UCR_TIFINAGH}
  • + *
  • {@link #TT_UCR_YIJING TT_UCR_YIJING}
  • + *
  • {@link #TT_UCR_SYLOTI_NAGRI TT_UCR_SYLOTI_NAGRI}
  • + *
  • {@link #TT_UCR_LINEAR_B TT_UCR_LINEAR_B}
  • + *
  • {@link #TT_UCR_ANCIENT_GREEK_NUMBERS TT_UCR_ANCIENT_GREEK_NUMBERS}
  • + *
  • {@link #TT_UCR_UGARITIC TT_UCR_UGARITIC}
  • + *
  • {@link #TT_UCR_OLD_PERSIAN TT_UCR_OLD_PERSIAN}
  • + *
  • {@link #TT_UCR_SHAVIAN TT_UCR_SHAVIAN}
  • + *
  • {@link #TT_UCR_OSMANYA TT_UCR_OSMANYA}
  • + *
  • {@link #TT_UCR_CYPRIOT_SYLLABARY TT_UCR_CYPRIOT_SYLLABARY}
  • + *
  • {@link #TT_UCR_KHAROSHTHI TT_UCR_KHAROSHTHI}
  • + *
  • {@link #TT_UCR_TAI_XUAN_JING TT_UCR_TAI_XUAN_JING}
  • + *
  • {@link #TT_UCR_CUNEIFORM TT_UCR_CUNEIFORM}
  • + *
  • {@link #TT_UCR_COUNTING_ROD_NUMERALS TT_UCR_COUNTING_ROD_NUMERALS}
  • + *
  • {@link #TT_UCR_SUNDANESE TT_UCR_SUNDANESE}
  • + *
  • {@link #TT_UCR_LEPCHA TT_UCR_LEPCHA}
  • + *
  • {@link #TT_UCR_OL_CHIKI TT_UCR_OL_CHIKI}
  • + *
  • {@link #TT_UCR_SAURASHTRA TT_UCR_SAURASHTRA}
  • + *
  • {@link #TT_UCR_KAYAH_LI TT_UCR_KAYAH_LI}
  • + *
  • {@link #TT_UCR_REJANG TT_UCR_REJANG}
  • + *
  • {@link #TT_UCR_CHAM TT_UCR_CHAM}
  • + *
  • {@link #TT_UCR_ANCIENT_SYMBOLS TT_UCR_ANCIENT_SYMBOLS}
  • + *
  • {@link #TT_UCR_PHAISTOS_DISC TT_UCR_PHAISTOS_DISC}
  • + *
  • {@link #TT_UCR_OLD_ANATOLIAN TT_UCR_OLD_ANATOLIAN}
  • + *
  • {@link #TT_UCR_GAME_TILES TT_UCR_GAME_TILES}
  • + *
+ */ + public static final int + TT_UCR_BASIC_LATIN = 1 << 0, + TT_UCR_LATIN1_SUPPLEMENT = 1 << 1, + TT_UCR_LATIN_EXTENDED_A = 1 << 2, + TT_UCR_LATIN_EXTENDED_B = 1 << 3, + TT_UCR_IPA_EXTENSIONS = 1 << 4, + TT_UCR_SPACING_MODIFIER = 1 << 5, + TT_UCR_COMBINING_DIACRITICAL_MARKS = 1 << 6, + TT_UCR_GREEK = 1 << 7, + TT_UCR_COPTIC = 1 << 8, + TT_UCR_CYRILLIC = 1 << 9, + TT_UCR_ARMENIAN = 1 << 10, + TT_UCR_HEBREW = 1 << 11, + TT_UCR_VAI = 1 << 12, + TT_UCR_ARABIC = 1 << 13, + TT_UCR_NKO = 1 << 14, + TT_UCR_DEVANAGARI = 1 << 15, + TT_UCR_BENGALI = 1 << 16, + TT_UCR_GURMUKHI = 1 << 17, + TT_UCR_GUJARATI = 1 << 18, + TT_UCR_ORIYA = 1 << 19, + TT_UCR_TAMIL = 1 << 20, + TT_UCR_TELUGU = 1 << 21, + TT_UCR_KANNADA = 1 << 22, + TT_UCR_MALAYALAM = 1 << 23, + TT_UCR_THAI = 1 << 24, + TT_UCR_LAO = 1 << 25, + TT_UCR_GEORGIAN = 1 << 26, + TT_UCR_BALINESE = 1 << 27, + TT_UCR_HANGUL_JAMO = 1 << 28, + TT_UCR_LATIN_EXTENDED_ADDITIONAL = 1 << 29, + TT_UCR_GREEK_EXTENDED = 1 << 30, + TT_UCR_GENERAL_PUNCTUATION = 1 << 31, + TT_UCR_SUPERSCRIPTS_SUBSCRIPTS = 1 << 0, + TT_UCR_CURRENCY_SYMBOLS = 1 << 1, + TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB = 1 << 2, + TT_UCR_LETTERLIKE_SYMBOLS = 1 << 3, + TT_UCR_NUMBER_FORMS = 1 << 4, + TT_UCR_ARROWS = 1 << 5, + TT_UCR_MATHEMATICAL_OPERATORS = 1 << 6, + TT_UCR_MISCELLANEOUS_TECHNICAL = 1 << 7, + TT_UCR_CONTROL_PICTURES = 1 << 8, + TT_UCR_OCR = 1 << 9, + TT_UCR_ENCLOSED_ALPHANUMERICS = 1 << 10, + TT_UCR_BOX_DRAWING = 1 << 11, + TT_UCR_BLOCK_ELEMENTS = 1 << 12, + TT_UCR_GEOMETRIC_SHAPES = 1 << 13, + TT_UCR_MISCELLANEOUS_SYMBOLS = 1 << 14, + TT_UCR_DINGBATS = 1 << 15, + TT_UCR_CJK_SYMBOLS = 1 << 16, + TT_UCR_HIRAGANA = 1 << 17, + TT_UCR_KATAKANA = 1 << 18, + TT_UCR_BOPOMOFO = 1 << 19, + TT_UCR_HANGUL_COMPATIBILITY_JAMO = 1 << 20, + TT_UCR_CJK_MISC = 1 << 21, + TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS = 1 << 22, + TT_UCR_CJK_COMPATIBILITY = 1 << 23, + TT_UCR_HANGUL = 1 << 24, + TT_UCR_SURROGATES = 1 << 25, + TT_UCR_PHOENICIAN = 1 << 26, + TT_UCR_CJK_UNIFIED_IDEOGRAPHS = 1 << 27, + TT_UCR_PRIVATE_USE = 1 << 28, + TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS = 1 << 29, + TT_UCR_ALPHABETIC_PRESENTATION_FORMS = 1 << 30, + TT_UCR_ARABIC_PRESENTATION_FORMS_A = 1 << 31, + TT_UCR_COMBINING_HALF_MARKS = 1 << 0, + TT_UCR_CJK_COMPATIBILITY_FORMS = 1 << 1, + TT_UCR_SMALL_FORM_VARIANTS = 1 << 2, + TT_UCR_ARABIC_PRESENTATION_FORMS_B = 1 << 3, + TT_UCR_HALFWIDTH_FULLWIDTH_FORMS = 1 << 4, + TT_UCR_SPECIALS = 1 << 5, + TT_UCR_TIBETAN = 1 << 6, + TT_UCR_SYRIAC = 1 << 7, + TT_UCR_THAANA = 1 << 8, + TT_UCR_SINHALA = 1 << 9, + TT_UCR_MYANMAR = 1 << 10, + TT_UCR_ETHIOPIC = 1 << 11, + TT_UCR_CHEROKEE = 1 << 12, + TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS = 1 << 13, + TT_UCR_OGHAM = 1 << 14, + TT_UCR_RUNIC = 1 << 15, + TT_UCR_KHMER = 1 << 16, + TT_UCR_MONGOLIAN = 1 << 17, + TT_UCR_BRAILLE = 1 << 18, + TT_UCR_YI = 1 << 19, + TT_UCR_PHILIPPINE = 1 << 20, + TT_UCR_OLD_ITALIC = 1 << 21, + TT_UCR_GOTHIC = 1 << 22, + TT_UCR_DESERET = 1 << 23, + TT_UCR_MUSICAL_SYMBOLS = 1 << 24, + TT_UCR_MATH_ALPHANUMERIC_SYMBOLS = 1 << 25, + TT_UCR_PRIVATE_USE_SUPPLEMENTARY = 1 << 26, + TT_UCR_VARIATION_SELECTORS = 1 << 27, + TT_UCR_TAGS = 1 << 28, + TT_UCR_LIMBU = 1 << 29, + TT_UCR_TAI_LE = 1 << 30, + TT_UCR_NEW_TAI_LUE = 1 << 31, + TT_UCR_BUGINESE = 1 << 0, + TT_UCR_GLAGOLITIC = 1 << 1, + TT_UCR_TIFINAGH = 1 << 2, + TT_UCR_YIJING = 1 << 3, + TT_UCR_SYLOTI_NAGRI = 1 << 4, + TT_UCR_LINEAR_B = 1 << 5, + TT_UCR_ANCIENT_GREEK_NUMBERS = 1 << 6, + TT_UCR_UGARITIC = 1 << 7, + TT_UCR_OLD_PERSIAN = 1 << 8, + TT_UCR_SHAVIAN = 1 << 9, + TT_UCR_OSMANYA = 1 << 10, + TT_UCR_CYPRIOT_SYLLABARY = 1 << 11, + TT_UCR_KHAROSHTHI = 1 << 12, + TT_UCR_TAI_XUAN_JING = 1 << 13, + TT_UCR_CUNEIFORM = 1 << 14, + TT_UCR_COUNTING_ROD_NUMERALS = 1 << 15, + TT_UCR_SUNDANESE = 1 << 16, + TT_UCR_LEPCHA = 1 << 17, + TT_UCR_OL_CHIKI = 1 << 18, + TT_UCR_SAURASHTRA = 1 << 19, + TT_UCR_KAYAH_LI = 1 << 20, + TT_UCR_REJANG = 1 << 21, + TT_UCR_CHAM = 1 << 22, + TT_UCR_ANCIENT_SYMBOLS = 1 << 23, + TT_UCR_PHAISTOS_DISC = 1 << 24, + TT_UCR_OLD_ANATOLIAN = 1 << 25, + TT_UCR_GAME_TILES = 1 << 26; + + /** + * {@code FT_Sfnt_Tag} + * + *
Enum values:
+ * + *
    + *
  • {@link #FT_SFNT_HEAD SFNT_HEAD}
  • + *
  • {@link #FT_SFNT_MAXP SFNT_MAXP}
  • + *
  • {@link #FT_SFNT_OS2 SFNT_OS2}
  • + *
  • {@link #FT_SFNT_HHEA SFNT_HHEA}
  • + *
  • {@link #FT_SFNT_VHEA SFNT_VHEA}
  • + *
  • {@link #FT_SFNT_POST SFNT_POST}
  • + *
  • {@link #FT_SFNT_PCLT SFNT_PCLT}
  • + *
  • {@link #FT_SFNT_MAX SFNT_MAX}
  • + *
+ */ + public static final int + FT_SFNT_HEAD = 0, + FT_SFNT_MAXP = 1, + FT_SFNT_OS2 = 2, + FT_SFNT_HHEA = 3, + FT_SFNT_VHEA = 4, + FT_SFNT_POST = 5, + FT_SFNT_PCLT = 6, + FT_SFNT_MAX = 7; + + public static final int + TTAG_avar = FT_MAKE_TAG( 'a', 'v', 'a', 'r' ), + TTAG_BASE = FT_MAKE_TAG( 'B', 'A', 'S', 'E' ), + TTAG_bdat = FT_MAKE_TAG( 'b', 'd', 'a', 't' ), + TTAG_BDF = FT_MAKE_TAG( 'B', 'D', 'F', ' ' ), + TTAG_bhed = FT_MAKE_TAG( 'b', 'h', 'e', 'd' ), + TTAG_bloc = FT_MAKE_TAG( 'b', 'l', 'o', 'c' ), + TTAG_bsln = FT_MAKE_TAG( 'b', 's', 'l', 'n' ), + TTAG_CBDT = FT_MAKE_TAG( 'C', 'B', 'D', 'T' ), + TTAG_CBLC = FT_MAKE_TAG( 'C', 'B', 'L', 'C' ), + TTAG_CFF = FT_MAKE_TAG( 'C', 'F', 'F', ' ' ), + TTAG_CFF2 = FT_MAKE_TAG( 'C', 'F', 'F', '2' ), + TTAG_CID = FT_MAKE_TAG( 'C', 'I', 'D', ' ' ), + TTAG_cmap = FT_MAKE_TAG( 'c', 'm', 'a', 'p' ), + TTAG_COLR = FT_MAKE_TAG( 'C', 'O', 'L', 'R' ), + TTAG_CPAL = FT_MAKE_TAG( 'C', 'P', 'A', 'L' ), + TTAG_cvar = FT_MAKE_TAG( 'c', 'v', 'a', 'r' ), + TTAG_cvt = FT_MAKE_TAG( 'c', 'v', 't', ' ' ), + TTAG_DSIG = FT_MAKE_TAG( 'D', 'S', 'I', 'G' ), + TTAG_EBDT = FT_MAKE_TAG( 'E', 'B', 'D', 'T' ), + TTAG_EBLC = FT_MAKE_TAG( 'E', 'B', 'L', 'C' ), + TTAG_EBSC = FT_MAKE_TAG( 'E', 'B', 'S', 'C' ), + TTAG_feat = FT_MAKE_TAG( 'f', 'e', 'a', 't' ), + TTAG_FOND = FT_MAKE_TAG( 'F', 'O', 'N', 'D' ), + TTAG_fpgm = FT_MAKE_TAG( 'f', 'p', 'g', 'm' ), + TTAG_fvar = FT_MAKE_TAG( 'f', 'v', 'a', 'r' ), + TTAG_gasp = FT_MAKE_TAG( 'g', 'a', 's', 'p' ), + TTAG_GDEF = FT_MAKE_TAG( 'G', 'D', 'E', 'F' ), + TTAG_glyf = FT_MAKE_TAG( 'g', 'l', 'y', 'f' ), + TTAG_GPOS = FT_MAKE_TAG( 'G', 'P', 'O', 'S' ), + TTAG_GSUB = FT_MAKE_TAG( 'G', 'S', 'U', 'B' ), + TTAG_gvar = FT_MAKE_TAG( 'g', 'v', 'a', 'r' ), + TTAG_HVAR = FT_MAKE_TAG( 'H', 'V', 'A', 'R' ), + TTAG_hdmx = FT_MAKE_TAG( 'h', 'd', 'm', 'x' ), + TTAG_head = FT_MAKE_TAG( 'h', 'e', 'a', 'd' ), + TTAG_hhea = FT_MAKE_TAG( 'h', 'h', 'e', 'a' ), + TTAG_hmtx = FT_MAKE_TAG( 'h', 'm', 't', 'x' ), + TTAG_JSTF = FT_MAKE_TAG( 'J', 'S', 'T', 'F' ), + TTAG_just = FT_MAKE_TAG( 'j', 'u', 's', 't' ), + TTAG_kern = FT_MAKE_TAG( 'k', 'e', 'r', 'n' ), + TTAG_lcar = FT_MAKE_TAG( 'l', 'c', 'a', 'r' ), + TTAG_loca = FT_MAKE_TAG( 'l', 'o', 'c', 'a' ), + TTAG_LTSH = FT_MAKE_TAG( 'L', 'T', 'S', 'H' ), + TTAG_LWFN = FT_MAKE_TAG( 'L', 'W', 'F', 'N' ), + TTAG_MATH = FT_MAKE_TAG( 'M', 'A', 'T', 'H' ), + TTAG_maxp = FT_MAKE_TAG( 'm', 'a', 'x', 'p' ), + TTAG_META = FT_MAKE_TAG( 'M', 'E', 'T', 'A' ), + TTAG_MMFX = FT_MAKE_TAG( 'M', 'M', 'F', 'X' ), + TTAG_MMSD = FT_MAKE_TAG( 'M', 'M', 'S', 'D' ), + TTAG_mort = FT_MAKE_TAG( 'm', 'o', 'r', 't' ), + TTAG_morx = FT_MAKE_TAG( 'm', 'o', 'r', 'x' ), + TTAG_MVAR = FT_MAKE_TAG( 'M', 'V', 'A', 'R' ), + TTAG_name = FT_MAKE_TAG( 'n', 'a', 'm', 'e' ), + TTAG_opbd = FT_MAKE_TAG( 'o', 'p', 'b', 'd' ), + TTAG_OS2 = FT_MAKE_TAG( 'O', 'S', '/', '2' ), + TTAG_OTTO = FT_MAKE_TAG( 'O', 'T', 'T', 'O' ), + TTAG_PCLT = FT_MAKE_TAG( 'P', 'C', 'L', 'T' ), + TTAG_POST = FT_MAKE_TAG( 'P', 'O', 'S', 'T' ), + TTAG_post = FT_MAKE_TAG( 'p', 'o', 's', 't' ), + TTAG_prep = FT_MAKE_TAG( 'p', 'r', 'e', 'p' ), + TTAG_prop = FT_MAKE_TAG( 'p', 'r', 'o', 'p' ), + TTAG_sbix = FT_MAKE_TAG( 's', 'b', 'i', 'x' ), + TTAG_sfnt = FT_MAKE_TAG( 's', 'f', 'n', 't' ), + TTAG_SING = FT_MAKE_TAG( 'S', 'I', 'N', 'G' ), + TTAG_SVG = FT_MAKE_TAG( 'S', 'V', 'G', ' ' ), + TTAG_trak = FT_MAKE_TAG( 't', 'r', 'a', 'k' ), + TTAG_true = FT_MAKE_TAG( 't', 'r', 'u', 'e' ), + TTAG_ttc = FT_MAKE_TAG( 't', 't', 'c', ' ' ), + TTAG_ttcf = FT_MAKE_TAG( 't', 't', 'c', 'f' ), + TTAG_TYP1 = FT_MAKE_TAG( 'T', 'Y', 'P', '1' ), + TTAG_typ1 = FT_MAKE_TAG( 't', 'y', 'p', '1' ), + TTAG_VDMX = FT_MAKE_TAG( 'V', 'D', 'M', 'X' ), + TTAG_vhea = FT_MAKE_TAG( 'v', 'h', 'e', 'a' ), + TTAG_vmtx = FT_MAKE_TAG( 'v', 'm', 't', 'x' ), + TTAG_VVAR = FT_MAKE_TAG( 'V', 'V', 'A', 'R' ), + TTAG_wOFF = FT_MAKE_TAG( 'w', 'O', 'F', 'F' ), + TTAG_wOF2 = FT_MAKE_TAG( 'w', 'O', 'F', '2' ), + TTAG_0xA5kbd = FT_MAKE_TAG( 0xA5, 'k', 'b', 'd' ), + TTAG_0xA5lst = FT_MAKE_TAG( 0xA5, 'l', 's', 't' ); + + protected FreeType() { + throw new UnsupportedOperationException(); + } + + // --- [ FT_Init_FreeType ] --- + + public static int nFT_Init_FreeType(long alibrary) { + long __functionAddress = Functions.Init_FreeType; + return invokePI(alibrary, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Init_FreeType(@NativeType("FT_Library *") PointerBuffer alibrary) { + if (CHECKS) { + check(alibrary, 1); + } + return nFT_Init_FreeType(memAddress(alibrary)); + } + + // --- [ FT_Done_FreeType ] --- + + @NativeType("FT_Error") + public static int FT_Done_FreeType(@NativeType("FT_Library") long library) { + long __functionAddress = Functions.Done_FreeType; + if (CHECKS) { + check(library); + } + return invokePI(library, __functionAddress); + } + + // --- [ FT_New_Face ] --- + + public static int nFT_New_Face(long library, long filepathname, long face_index, long aface) { + long __functionAddress = Functions.New_Face; + if (CHECKS) { + check(library); + } + return invokePPNPI(library, filepathname, face_index, aface, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_New_Face(@NativeType("FT_Library") long library, @NativeType("char const *") ByteBuffer filepathname, @NativeType("FT_Long") long face_index, @NativeType("FT_Face *") PointerBuffer aface) { + if (CHECKS) { + checkNT1(filepathname); + check(aface, 1); + } + return nFT_New_Face(library, memAddress(filepathname), face_index, memAddress(aface)); + } + + @NativeType("FT_Error") + public static int FT_New_Face(@NativeType("FT_Library") long library, @NativeType("char const *") CharSequence filepathname, @NativeType("FT_Long") long face_index, @NativeType("FT_Face *") PointerBuffer aface) { + if (CHECKS) { + check(aface, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(filepathname, true); + long filepathnameEncoded = stack.getPointerAddress(); + return nFT_New_Face(library, filepathnameEncoded, face_index, memAddress(aface)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ FT_New_Memory_Face ] --- + + public static int nFT_New_Memory_Face(long library, long file_base, long file_size, long face_index, long aface) { + long __functionAddress = Functions.New_Memory_Face; + if (CHECKS) { + check(library); + } + return invokePPNNPI(library, file_base, file_size, face_index, aface, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_New_Memory_Face(@NativeType("FT_Library") long library, @NativeType("FT_Byte const *") ByteBuffer file_base, @NativeType("FT_Long") long face_index, @NativeType("FT_Face *") PointerBuffer aface) { + if (CHECKS) { + check(aface, 1); + } + return nFT_New_Memory_Face(library, memAddress(file_base), file_base.remaining(), face_index, memAddress(aface)); + } + + // --- [ FT_Open_Face ] --- + + public static int nFT_Open_Face(long library, long args, long face_index, long aface) { + long __functionAddress = Functions.Open_Face; + if (CHECKS) { + check(library); + } + return invokePPNPI(library, args, face_index, aface, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Open_Face(@NativeType("FT_Library") long library, @NativeType("FT_Open_Args const *") FT_Open_Args args, @NativeType("FT_Long") long face_index, @NativeType("FT_Face *") PointerBuffer aface) { + if (CHECKS) { + check(aface, 1); + } + return nFT_Open_Face(library, args.address(), face_index, memAddress(aface)); + } + + // --- [ FT_Attach_File ] --- + + public static int nFT_Attach_File(long face, long filepathname) { + long __functionAddress = Functions.Attach_File; + return invokePPI(face, filepathname, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Attach_File(FT_Face face, @NativeType("char const *") ByteBuffer filepathname) { + if (CHECKS) { + checkNT1(filepathname); + } + return nFT_Attach_File(face.address(), memAddress(filepathname)); + } + + @NativeType("FT_Error") + public static int FT_Attach_File(FT_Face face, @NativeType("char const *") CharSequence filepathname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(filepathname, true); + long filepathnameEncoded = stack.getPointerAddress(); + return nFT_Attach_File(face.address(), filepathnameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ FT_Attach_Stream ] --- + + public static int nFT_Attach_Stream(long face, long parameters) { + long __functionAddress = Functions.Attach_Stream; + return invokePPI(face, parameters, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Attach_Stream(FT_Face face, @NativeType("FT_Open_Args const *") FT_Open_Args parameters) { + return nFT_Attach_Stream(face.address(), parameters.address()); + } + + // --- [ FT_Reference_Face ] --- + + public static int nFT_Reference_Face(long face) { + long __functionAddress = Functions.Reference_Face; + return invokePI(face, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Reference_Face(FT_Face face) { + return nFT_Reference_Face(face.address()); + } + + // --- [ FT_Done_Face ] --- + + public static int nFT_Done_Face(long face) { + long __functionAddress = Functions.Done_Face; + return invokePI(face, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Done_Face(FT_Face face) { + return nFT_Done_Face(face.address()); + } + + // --- [ FT_Select_Size ] --- + + public static int nFT_Select_Size(long face, int strike_index) { + long __functionAddress = Functions.Select_Size; + return invokePI(face, strike_index, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Select_Size(FT_Face face, @NativeType("FT_Int") int strike_index) { + return nFT_Select_Size(face.address(), strike_index); + } + + // --- [ FT_Request_Size ] --- + + public static int nFT_Request_Size(long face, long req) { + long __functionAddress = Functions.Request_Size; + return invokePPI(face, req, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Request_Size(FT_Face face, FT_Size_Request req) { + return nFT_Request_Size(face.address(), req.address()); + } + + // --- [ FT_Set_Char_Size ] --- + + public static int nFT_Set_Char_Size(long face, long char_width, long char_height, int horz_resolution, int vert_resolution) { + long __functionAddress = Functions.Set_Char_Size; + return invokePNNI(face, char_width, char_height, horz_resolution, vert_resolution, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Set_Char_Size(FT_Face face, @NativeType("FT_F26Dot6") long char_width, @NativeType("FT_F26Dot6") long char_height, @NativeType("FT_UInt") int horz_resolution, @NativeType("FT_UInt") int vert_resolution) { + return nFT_Set_Char_Size(face.address(), char_width, char_height, horz_resolution, vert_resolution); + } + + // --- [ FT_Set_Pixel_Sizes ] --- + + public static int nFT_Set_Pixel_Sizes(long face, int pixel_width, int pixel_height) { + long __functionAddress = Functions.Set_Pixel_Sizes; + return invokePI(face, pixel_width, pixel_height, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Set_Pixel_Sizes(FT_Face face, @NativeType("FT_UInt") int pixel_width, @NativeType("FT_UInt") int pixel_height) { + return nFT_Set_Pixel_Sizes(face.address(), pixel_width, pixel_height); + } + + // --- [ FT_Load_Glyph ] --- + + public static int nFT_Load_Glyph(long face, int glyph_index, int load_flags) { + long __functionAddress = Functions.Load_Glyph; + return invokePI(face, glyph_index, load_flags, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Load_Glyph(FT_Face face, @NativeType("FT_UInt") int glyph_index, @NativeType("FT_Int32") int load_flags) { + return nFT_Load_Glyph(face.address(), glyph_index, load_flags); + } + + // --- [ FT_Load_Char ] --- + + public static int nFT_Load_Char(long face, long char_code, int load_flags) { + long __functionAddress = Functions.Load_Char; + return invokePNI(face, char_code, load_flags, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Load_Char(FT_Face face, @NativeType("FT_ULong") long char_code, @NativeType("FT_Int32") int load_flags) { + return nFT_Load_Char(face.address(), char_code, load_flags); + } + + // --- [ FT_Set_Transform ] --- + + public static void nFT_Set_Transform(long face, long matrix, long delta) { + long __functionAddress = Functions.Set_Transform; + invokePPPV(face, matrix, delta, __functionAddress); + } + + public static void FT_Set_Transform(FT_Face face, @Nullable @NativeType("FT_Matrix *") FT_Matrix matrix, @Nullable @NativeType("FT_Vector *") FT_Vector delta) { + nFT_Set_Transform(face.address(), memAddressSafe(matrix), memAddressSafe(delta)); + } + + // --- [ FT_Get_Transform ] --- + + public static void nFT_Get_Transform(long face, long matrix, long delta) { + long __functionAddress = Functions.Get_Transform; + invokePPPV(face, matrix, delta, __functionAddress); + } + + public static void FT_Get_Transform(FT_Face face, @Nullable @NativeType("FT_Matrix *") FT_Matrix matrix, @Nullable @NativeType("FT_Vector *") FT_Vector delta) { + nFT_Get_Transform(face.address(), memAddressSafe(matrix), memAddressSafe(delta)); + } + + // --- [ FT_Render_Glyph ] --- + + public static int nFT_Render_Glyph(long slot, int render_mode) { + long __functionAddress = Functions.Render_Glyph; + return invokePI(slot, render_mode, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Render_Glyph(FT_GlyphSlot slot, @NativeType("FT_Render_Mode") int render_mode) { + return nFT_Render_Glyph(slot.address(), render_mode); + } + + // --- [ FT_Get_Kerning ] --- + + public static int nFT_Get_Kerning(long face, int left_glyph, int right_glyph, int kern_mode, long akerning) { + long __functionAddress = Functions.Get_Kerning; + return invokePPI(face, left_glyph, right_glyph, kern_mode, akerning, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_Kerning(FT_Face face, @NativeType("FT_UInt") int left_glyph, @NativeType("FT_UInt") int right_glyph, @NativeType("FT_UInt") int kern_mode, @NativeType("FT_Vector *") FT_Vector akerning) { + return nFT_Get_Kerning(face.address(), left_glyph, right_glyph, kern_mode, akerning.address()); + } + + // --- [ FT_Get_Track_Kerning ] --- + + public static int nFT_Get_Track_Kerning(long face, long point_size, int degree, long akerning) { + long __functionAddress = Functions.Get_Track_Kerning; + return invokePNPI(face, point_size, degree, akerning, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_Track_Kerning(FT_Face face, @NativeType("FT_Fixed") long point_size, @NativeType("FT_Int") int degree, @NativeType("FT_Fixed *") CLongBuffer akerning) { + if (CHECKS) { + check(akerning, 1); + } + return nFT_Get_Track_Kerning(face.address(), point_size, degree, memAddress(akerning)); + } + + // --- [ FT_Select_Charmap ] --- + + public static int nFT_Select_Charmap(long face, int encoding) { + long __functionAddress = Functions.Select_Charmap; + return invokePI(face, encoding, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Select_Charmap(FT_Face face, @NativeType("FT_Encoding") int encoding) { + return nFT_Select_Charmap(face.address(), encoding); + } + + // --- [ FT_Set_Charmap ] --- + + public static int nFT_Set_Charmap(long face, long charmap) { + long __functionAddress = Functions.Set_Charmap; + return invokePPI(face, charmap, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Set_Charmap(FT_Face face, FT_CharMap charmap) { + return nFT_Set_Charmap(face.address(), charmap.address()); + } + + // --- [ FT_Get_Charmap_Index ] --- + + public static int nFT_Get_Charmap_Index(long charmap) { + long __functionAddress = Functions.Get_Charmap_Index; + return invokePI(charmap, __functionAddress); + } + + @NativeType("FT_Int") + public static int FT_Get_Charmap_Index(FT_CharMap charmap) { + return nFT_Get_Charmap_Index(charmap.address()); + } + + // --- [ FT_Get_Char_Index ] --- + + public static int nFT_Get_Char_Index(long face, long charcode) { + long __functionAddress = Functions.Get_Char_Index; + return invokePNI(face, charcode, __functionAddress); + } + + @NativeType("FT_UInt") + public static int FT_Get_Char_Index(FT_Face face, @NativeType("FT_ULong") long charcode) { + return nFT_Get_Char_Index(face.address(), charcode); + } + + // --- [ FT_Get_First_Char ] --- + + public static long nFT_Get_First_Char(long face, long agindex) { + long __functionAddress = Functions.Get_First_Char; + return invokePPN(face, agindex, __functionAddress); + } + + @NativeType("FT_ULong") + public static long FT_Get_First_Char(FT_Face face, @NativeType("FT_UInt *") IntBuffer agindex) { + if (CHECKS) { + check(agindex, 1); + } + return nFT_Get_First_Char(face.address(), memAddress(agindex)); + } + + // --- [ FT_Get_Next_Char ] --- + + /** Unsafe version of: {@link #FT_Get_Next_Char Get_Next_Char} */ + public static long nFT_Get_Next_Char(long face, long char_code, long agindex) { + long __functionAddress = Functions.Get_Next_Char; + return invokePNPN(face, char_code, agindex, __functionAddress); + } + + /** @return : The charmap's next character code */ + @NativeType("FT_ULong") + public static long FT_Get_Next_Char(FT_Face face, @NativeType("FT_ULong") long char_code, @NativeType("FT_UInt *") IntBuffer agindex) { + if (CHECKS) { + check(agindex, 1); + } + return nFT_Get_Next_Char(face.address(), char_code, memAddress(agindex)); + } + + // --- [ FT_Face_Properties ] --- + + public static int nFT_Face_Properties(long face, int num_properties, long properties) { + long __functionAddress = Functions.Face_Properties; + return invokePPI(face, num_properties, properties, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Face_Properties(FT_Face face, @NativeType("FT_Parameter *") FT_Parameter.Buffer properties) { + return nFT_Face_Properties(face.address(), properties.remaining(), properties.address()); + } + + // --- [ FT_Get_Name_Index ] --- + + public static int nFT_Get_Name_Index(long face, long glyph_name) { + long __functionAddress = Functions.Get_Name_Index; + return invokePPI(face, glyph_name, __functionAddress); + } + + @NativeType("FT_UInt") + public static int FT_Get_Name_Index(FT_Face face, @NativeType("FT_String const *") ByteBuffer glyph_name) { + if (CHECKS) { + checkNT1(glyph_name); + } + return nFT_Get_Name_Index(face.address(), memAddress(glyph_name)); + } + + @NativeType("FT_UInt") + public static int FT_Get_Name_Index(FT_Face face, @NativeType("FT_String const *") CharSequence glyph_name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(glyph_name, true); + long glyph_nameEncoded = stack.getPointerAddress(); + return nFT_Get_Name_Index(face.address(), glyph_nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ FT_Get_Glyph_Name ] --- + + public static int nFT_Get_Glyph_Name(long face, int glyph_index, long buffer, int buffer_max) { + long __functionAddress = Functions.Get_Glyph_Name; + return invokePPI(face, glyph_index, buffer, buffer_max, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_Glyph_Name(FT_Face face, @NativeType("FT_UInt") int glyph_index, @NativeType("FT_Pointer") ByteBuffer buffer) { + return nFT_Get_Glyph_Name(face.address(), glyph_index, memAddress(buffer), buffer.remaining()); + } + + // --- [ FT_Get_Postscript_Name ] --- + + public static long nFT_Get_Postscript_Name(long face) { + long __functionAddress = Functions.Get_Postscript_Name; + return invokePP(face, __functionAddress); + } + + @Nullable + @NativeType("char const *") + public static String FT_Get_Postscript_Name(FT_Face face) { + long __result = nFT_Get_Postscript_Name(face.address()); + return memASCIISafe(__result); + } + + // --- [ FT_Get_SubGlyph_Info ] --- + + public static int nFT_Get_SubGlyph_Info(long glyph, int sub_index, long p_index, long p_flags, long p_arg1, long p_arg2, long p_transform) { + long __functionAddress = Functions.Get_SubGlyph_Info; + return invokePPPPPPI(glyph, sub_index, p_index, p_flags, p_arg1, p_arg2, p_transform, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_SubGlyph_Info(FT_GlyphSlot glyph, @NativeType("FT_UInt") int sub_index, @NativeType("FT_Int *") IntBuffer p_index, @NativeType("FT_UInt *") IntBuffer p_flags, @NativeType("FT_Int *") IntBuffer p_arg1, @NativeType("FT_Int *") IntBuffer p_arg2, @NativeType("FT_Matrix *") FT_Matrix p_transform) { + if (CHECKS) { + check(p_index, 1); + check(p_flags, 1); + check(p_arg1, 1); + check(p_arg2, 1); + } + return nFT_Get_SubGlyph_Info(glyph.address(), sub_index, memAddress(p_index), memAddress(p_flags), memAddress(p_arg1), memAddress(p_arg2), p_transform.address()); + } + + // --- [ FT_Get_FSType_Flags ] --- + + public static short nFT_Get_FSType_Flags(long face) { + long __functionAddress = Functions.Get_FSType_Flags; + return invokePC(face, __functionAddress); + } + + @NativeType("FT_UShort") + public static short FT_Get_FSType_Flags(FT_Face face) { + return nFT_Get_FSType_Flags(face.address()); + } + + // --- [ FT_Face_GetCharVariantIndex ] --- + + public static int nFT_Face_GetCharVariantIndex(long face, long charcode, long variantSelector) { + long __functionAddress = Functions.Face_GetCharVariantIndex; + return invokePNNI(face, charcode, variantSelector, __functionAddress); + } + + @NativeType("FT_UInt") + public static int FT_Face_GetCharVariantIndex(FT_Face face, @NativeType("FT_ULong") long charcode, @NativeType("FT_ULong") long variantSelector) { + return nFT_Face_GetCharVariantIndex(face.address(), charcode, variantSelector); + } + + // --- [ FT_Face_GetCharVariantIsDefault ] --- + + public static int nFT_Face_GetCharVariantIsDefault(long face, long charcode, long variantSelector) { + long __functionAddress = Functions.Face_GetCharVariantIsDefault; + return invokePNNI(face, charcode, variantSelector, __functionAddress); + } + + @NativeType("FT_Int") + public static int FT_Face_GetCharVariantIsDefault(FT_Face face, @NativeType("FT_ULong") long charcode, @NativeType("FT_ULong") long variantSelector) { + return nFT_Face_GetCharVariantIsDefault(face.address(), charcode, variantSelector); + } + + // --- [ FT_Face_GetVariantSelectors ] --- + + public static long nFT_Face_GetVariantSelectors(long face) { + long __functionAddress = Functions.Face_GetVariantSelectors; + return invokePP(face, __functionAddress); + } + + @NativeType("FT_UInt32 *") + public static long FT_Face_GetVariantSelectors(FT_Face face) { + return nFT_Face_GetVariantSelectors(face.address()); + } + + // --- [ FT_Face_GetVariantsOfChar ] --- + + public static long nFT_Face_GetVariantsOfChar(long face, long charcode) { + long __functionAddress = Functions.Face_GetVariantsOfChar; + return invokePNP(face, charcode, __functionAddress); + } + + @NativeType("FT_UInt32 *") + public static long FT_Face_GetVariantsOfChar(FT_Face face, @NativeType("FT_ULong") long charcode) { + return nFT_Face_GetVariantsOfChar(face.address(), charcode); + } + + // --- [ FT_Face_GetCharsOfVariant ] --- + + public static long nFT_Face_GetCharsOfVariant(long face, long variantSelector) { + long __functionAddress = Functions.Face_GetCharsOfVariant; + return invokePNP(face, variantSelector, __functionAddress); + } + + @NativeType("FT_UInt32 *") + public static long FT_Face_GetCharsOfVariant(FT_Face face, @NativeType("FT_ULong") long variantSelector) { + return nFT_Face_GetCharsOfVariant(face.address(), variantSelector); + } + + // --- [ FT_MulDiv ] --- + + @NativeType("FT_Long") + public static long FT_MulDiv(@NativeType("FT_Long") long a, @NativeType("FT_Long") long b, @NativeType("FT_Long") long c) { + long __functionAddress = Functions.MulDiv; + return invokeNNNN(a, b, c, __functionAddress); + } + + // --- [ FT_MulFix ] --- + + @NativeType("FT_Long") + public static long FT_MulFix(@NativeType("FT_Long") long a, @NativeType("FT_Long") long b) { + long __functionAddress = Functions.MulFix; + return invokeNNN(a, b, __functionAddress); + } + + // --- [ FT_DivFix ] --- + + @NativeType("FT_Long") + public static long FT_DivFix(@NativeType("FT_Long") long a, @NativeType("FT_Long") long b) { + long __functionAddress = Functions.DivFix; + return invokeNNN(a, b, __functionAddress); + } + + // --- [ FT_RoundFix ] --- + + @NativeType("FT_Fixed") + public static long FT_RoundFix(@NativeType("FT_Fixed") long a) { + long __functionAddress = Functions.RoundFix; + return invokeNN(a, __functionAddress); + } + + // --- [ FT_CeilFix ] --- + + @NativeType("FT_Fixed") + public static long FT_CeilFix(@NativeType("FT_Fixed") long a) { + long __functionAddress = Functions.CeilFix; + return invokeNN(a, __functionAddress); + } + + // --- [ FT_FloorFix ] --- + + @NativeType("FT_Fixed") + public static long FT_FloorFix(@NativeType("FT_Fixed") long a) { + long __functionAddress = Functions.FloorFix; + return invokeNN(a, __functionAddress); + } + + // --- [ FT_Vector_Transform ] --- + + public static void nFT_Vector_Transform(long vector, long matrix) { + long __functionAddress = Functions.Vector_Transform; + invokePPV(vector, matrix, __functionAddress); + } + + public static void FT_Vector_Transform(@NativeType("FT_Vector *") FT_Vector vector, @NativeType("FT_Matrix const *") FT_Matrix matrix) { + nFT_Vector_Transform(vector.address(), matrix.address()); + } + + // --- [ FT_Library_Version ] --- + + public static void nFT_Library_Version(long library, long amajor, long aminor, long apatch) { + long __functionAddress = Functions.Library_Version; + if (CHECKS) { + check(library); + } + invokePPPPV(library, amajor, aminor, apatch, __functionAddress); + } + + public static void FT_Library_Version(@NativeType("FT_Library") long library, @NativeType("FT_Int *") IntBuffer amajor, @NativeType("FT_Int *") IntBuffer aminor, @NativeType("FT_Int *") IntBuffer apatch) { + if (CHECKS) { + check(amajor, 1); + check(aminor, 1); + check(apatch, 1); + } + nFT_Library_Version(library, memAddress(amajor), memAddress(aminor), memAddress(apatch)); + } + + // --- [ FT_Face_CheckTrueTypePatents ] --- + + public static boolean nFT_Face_CheckTrueTypePatents(long face) { + long __functionAddress = Functions.Face_CheckTrueTypePatents; + return invokePZ(face, __functionAddress); + } + + @NativeType("FT_Bool") + public static boolean FT_Face_CheckTrueTypePatents(FT_Face face) { + return nFT_Face_CheckTrueTypePatents(face.address()); + } + + // --- [ FT_Face_SetUnpatentedHinting ] --- + + public static boolean nFT_Face_SetUnpatentedHinting(long face, boolean value) { + long __functionAddress = Functions.Face_SetUnpatentedHinting; + return invokePZ(face, value, __functionAddress); + } + + @NativeType("FT_Bool") + public static boolean FT_Face_SetUnpatentedHinting(FT_Face face, @NativeType("FT_Bool") boolean value) { + return nFT_Face_SetUnpatentedHinting(face.address(), value); + } + + // --- [ FT_Get_Advance ] --- + + public static int nFT_Get_Advance(long face, int gindex, int load_flags, long padvance) { + long __functionAddress = Functions.Get_Advance; + return invokePPI(face, gindex, load_flags, padvance, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_Advance(FT_Face face, @NativeType("FT_UInt") int gindex, @NativeType("FT_Int32") int load_flags, @NativeType("FT_Fixed *") CLongBuffer padvance) { + if (CHECKS) { + check(padvance, 1); + } + return nFT_Get_Advance(face.address(), gindex, load_flags, memAddress(padvance)); + } + + // --- [ FT_Get_Advances ] --- + + public static int nFT_Get_Advances(long face, int start, int count, int load_flags, long padvances) { + long __functionAddress = Functions.Get_Advances; + return invokePPI(face, start, count, load_flags, padvances, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_Advances(FT_Face face, @NativeType("FT_UInt") int start, @NativeType("FT_Int32") int load_flags, @NativeType("FT_Fixed *") CLongBuffer padvances) { + return nFT_Get_Advances(face.address(), start, padvances.remaining(), load_flags, memAddress(padvances)); + } + + // --- [ FT_Outline_Get_BBox ] --- + + public static int nFT_Outline_Get_BBox(long outline, long abbox) { + long __functionAddress = Functions.Outline_Get_BBox; + return invokePPI(outline, abbox, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Outline_Get_BBox(@NativeType("FT_Outline *") FT_Outline outline, @NativeType("FT_BBox *") FT_BBox abbox) { + return nFT_Outline_Get_BBox(outline.address(), abbox.address()); + } + + // --- [ FT_Get_BDF_Charset_ID ] --- + + public static int nFT_Get_BDF_Charset_ID(long face, long acharset_encoding, long acharset_registry) { + long __functionAddress = Functions.Get_BDF_Charset_ID; + return invokePPPI(face, acharset_encoding, acharset_registry, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_BDF_Charset_ID(FT_Face face, @NativeType("char const **") PointerBuffer acharset_encoding, @NativeType("char const **") PointerBuffer acharset_registry) { + if (CHECKS) { + check(acharset_encoding, 1); + check(acharset_registry, 1); + } + return nFT_Get_BDF_Charset_ID(face.address(), memAddress(acharset_encoding), memAddress(acharset_registry)); + } + + // --- [ FT_Get_BDF_Property ] --- + + public static int nFT_Get_BDF_Property(long face, long prop_name, long aproperty) { + long __functionAddress = Functions.Get_BDF_Property; + return invokePPPI(face, prop_name, aproperty, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_BDF_Property(FT_Face face, @NativeType("char const *") ByteBuffer prop_name, @NativeType("BDF_PropertyRec *") BDF_Property aproperty) { + if (CHECKS) { + checkNT1(prop_name); + } + return nFT_Get_BDF_Property(face.address(), memAddress(prop_name), aproperty.address()); + } + + @NativeType("FT_Error") + public static int FT_Get_BDF_Property(FT_Face face, @NativeType("char const *") CharSequence prop_name, @NativeType("BDF_PropertyRec *") BDF_Property aproperty) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(prop_name, true); + long prop_nameEncoded = stack.getPointerAddress(); + return nFT_Get_BDF_Property(face.address(), prop_nameEncoded, aproperty.address()); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ FT_Bitmap_Init ] --- + + public static void nFT_Bitmap_Init(long abitmap) { + long __functionAddress = Functions.Bitmap_Init; + invokePV(abitmap, __functionAddress); + } + + public static void FT_Bitmap_Init(@NativeType("FT_Bitmap *") FT_Bitmap abitmap) { + nFT_Bitmap_Init(abitmap.address()); + } + + // --- [ FT_Bitmap_Copy ] --- + + public static int nFT_Bitmap_Copy(long library, long source, long target) { + long __functionAddress = Functions.Bitmap_Copy; + if (CHECKS) { + check(library); + } + return invokePPPI(library, source, target, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Bitmap_Copy(@NativeType("FT_Library") long library, @NativeType("FT_Bitmap const *") FT_Bitmap source, @NativeType("FT_Bitmap *") FT_Bitmap target) { + return nFT_Bitmap_Copy(library, source.address(), target.address()); + } + + // --- [ FT_Bitmap_Embolden ] --- + + public static int nFT_Bitmap_Embolden(long library, long bitmap, long xStrength, long yStrength) { + long __functionAddress = Functions.Bitmap_Embolden; + if (CHECKS) { + check(library); + } + return invokePPNNI(library, bitmap, xStrength, yStrength, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Bitmap_Embolden(@NativeType("FT_Library") long library, @NativeType("FT_Bitmap *") FT_Bitmap bitmap, @NativeType("FT_Pos") long xStrength, @NativeType("FT_Pos") long yStrength) { + return nFT_Bitmap_Embolden(library, bitmap.address(), xStrength, yStrength); + } + + // --- [ FT_Bitmap_Convert ] --- + + public static int nFT_Bitmap_Convert(long library, long source, long target, int alignment) { + long __functionAddress = Functions.Bitmap_Convert; + if (CHECKS) { + check(library); + } + return invokePPPI(library, source, target, alignment, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Bitmap_Convert(@NativeType("FT_Library") long library, @NativeType("FT_Bitmap const *") FT_Bitmap source, @NativeType("FT_Bitmap *") FT_Bitmap target, @NativeType("FT_Int") int alignment) { + return nFT_Bitmap_Convert(library, source.address(), target.address(), alignment); + } + + // --- [ FT_Bitmap_Blend ] --- + + private static final FFICIF FT_Bitmap_BlendCIF = apiCreateCIF( + FFI_DEFAULT_ABI, ffi_type_sint32, + ffi_type_pointer, ffi_type_pointer, apiCreateStruct(ffi_type_slong, ffi_type_slong), ffi_type_pointer, ffi_type_pointer, apiCreateStruct(ffi_type_uint8, ffi_type_uint8, ffi_type_uint8, ffi_type_uint8) + ); + + public static int nFT_Bitmap_Blend(long library, long source, long source_offset, long target, long atarget_offset, long color) { + long __functionAddress = Functions.Bitmap_Blend; + if (CHECKS) { + check(library); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + long __result = stack.nint(0); + long arguments = stack.nmalloc(POINTER_SIZE, POINTER_SIZE * 6); + memPutAddress(arguments, stack.npointer(library)); + memPutAddress(arguments + POINTER_SIZE, stack.npointer(source)); + memPutAddress(arguments + 2 * POINTER_SIZE, source_offset); + memPutAddress(arguments + 3 * POINTER_SIZE, stack.npointer(target)); + memPutAddress(arguments + 4 * POINTER_SIZE, stack.npointer(atarget_offset)); + memPutAddress(arguments + 5 * POINTER_SIZE, color); + + nffi_call(FT_Bitmap_BlendCIF.address(), __functionAddress, __result, arguments); + + return memGetInt(__result); + } finally { + stack.setPointer(stackPointer); + } + } + + @NativeType("FT_Error") + public static int FT_Bitmap_Blend(@NativeType("FT_Library") long library, @NativeType("FT_Bitmap const *") FT_Bitmap source, @NativeType("FT_Vector const") FT_Vector source_offset, @NativeType("FT_Bitmap *") FT_Bitmap target, @NativeType("FT_Vector *") FT_Vector atarget_offset, FT_Color color) { + return nFT_Bitmap_Blend(library, source.address(), source_offset.address(), target.address(), atarget_offset.address(), color.address()); + } + + // --- [ FT_GlyphSlot_Own_Bitmap ] --- + + public static int nFT_GlyphSlot_Own_Bitmap(long slot) { + long __functionAddress = Functions.GlyphSlot_Own_Bitmap; + return invokePI(slot, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_GlyphSlot_Own_Bitmap(FT_GlyphSlot slot) { + return nFT_GlyphSlot_Own_Bitmap(slot.address()); + } + + // --- [ FT_Bitmap_Done ] --- + + public static int nFT_Bitmap_Done(long library, long bitmap) { + long __functionAddress = Functions.Bitmap_Done; + if (CHECKS) { + check(library); + } + return invokePPI(library, bitmap, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Bitmap_Done(@NativeType("FT_Library") long library, @NativeType("FT_Bitmap *") FT_Bitmap bitmap) { + return nFT_Bitmap_Done(library, bitmap.address()); + } + + // --- [ FT_Stream_OpenBzip2 ] --- + + public static int nFT_Stream_OpenBzip2(long stream, long source) { + long __functionAddress = Functions.Stream_OpenBzip2; + if (CHECKS) { + check(__functionAddress); + } + return invokePPI(stream, source, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Stream_OpenBzip2(FT_Stream stream, FT_Stream source) { + return nFT_Stream_OpenBzip2(stream.address(), source.address()); + } + + // --- [ FTC_Manager_New ] --- + + public static int nFTC_Manager_New(long library, int max_faces, int max_sizes, long max_bytes, long requester, long req_data, long amanager) { + long __functionAddress = Functions.FTC_Manager_New; + if (CHECKS) { + check(library); + } + return invokePNPPPI(library, max_faces, max_sizes, max_bytes, requester, req_data, amanager, __functionAddress); + } + + @NativeType("FT_Error") + public static int FTC_Manager_New(@NativeType("FT_Library") long library, @NativeType("FT_UInt") int max_faces, @NativeType("FT_UInt") int max_sizes, @NativeType("FT_ULong") long max_bytes, @NativeType("FTC_Face_Requester") FTC_Face_RequesterI requester, @Nullable @NativeType("FT_Pointer") ByteBuffer req_data, @NativeType("FTC_Manager *") PointerBuffer amanager) { + if (CHECKS) { + check(amanager, 1); + } + return nFTC_Manager_New(library, max_faces, max_sizes, max_bytes, requester.address(), memAddressSafe(req_data), memAddress(amanager)); + } + + // --- [ FTC_Manager_Reset ] --- + + public static void FTC_Manager_Reset(@NativeType("FTC_Manager") long manager) { + long __functionAddress = Functions.FTC_Manager_Reset; + if (CHECKS) { + check(manager); + } + invokePV(manager, __functionAddress); + } + + // --- [ FTC_Manager_Done ] --- + + public static void FTC_Manager_Done(@NativeType("FTC_Manager") long manager) { + long __functionAddress = Functions.FTC_Manager_Done; + if (CHECKS) { + check(manager); + } + invokePV(manager, __functionAddress); + } + + // --- [ FTC_Manager_LookupFace ] --- + + public static int nFTC_Manager_LookupFace(long manager, long face_id, long aface) { + long __functionAddress = Functions.FTC_Manager_LookupFace; + if (CHECKS) { + check(manager); + check(face_id); + } + return invokePPPI(manager, face_id, aface, __functionAddress); + } + + @NativeType("FT_Error") + public static int FTC_Manager_LookupFace(@NativeType("FTC_Manager") long manager, @NativeType("FTC_FaceID") long face_id, @NativeType("FT_Face *") PointerBuffer aface) { + if (CHECKS) { + check(aface, 1); + } + return nFTC_Manager_LookupFace(manager, face_id, memAddress(aface)); + } + + // --- [ FTC_Manager_LookupSize ] --- + + public static int nFTC_Manager_LookupSize(long manager, long scaler, long asize) { + long __functionAddress = Functions.FTC_Manager_LookupSize; + if (CHECKS) { + check(manager); + } + return invokePPPI(manager, scaler, asize, __functionAddress); + } + + @NativeType("FT_Error") + public static int FTC_Manager_LookupSize(@NativeType("FTC_Manager") long manager, FTC_Scaler scaler, @NativeType("FT_Size *") PointerBuffer asize) { + if (CHECKS) { + check(asize, 1); + } + return nFTC_Manager_LookupSize(manager, scaler.address(), memAddress(asize)); + } + + // --- [ FTC_Node_Unref ] --- + + public static void FTC_Node_Unref(@NativeType("FTC_Node") long node, @NativeType("FTC_Manager") long manager) { + long __functionAddress = Functions.FTC_Node_Unref; + if (CHECKS) { + check(node); + check(manager); + } + invokePPV(node, manager, __functionAddress); + } + + // --- [ FTC_Manager_RemoveFaceID ] --- + + public static void FTC_Manager_RemoveFaceID(@NativeType("FTC_Manager") long manager, @NativeType("FTC_FaceID") long face_id) { + long __functionAddress = Functions.FTC_Manager_RemoveFaceID; + if (CHECKS) { + check(manager); + check(face_id); + } + invokePPV(manager, face_id, __functionAddress); + } + + // --- [ FTC_CMapCache_New ] --- + + public static int nFTC_CMapCache_New(long manager, long acache) { + long __functionAddress = Functions.FTC_CMapCache_New; + if (CHECKS) { + check(manager); + } + return invokePPI(manager, acache, __functionAddress); + } + + @NativeType("FT_Error") + public static int FTC_CMapCache_New(@NativeType("FTC_Manager") long manager, @NativeType("FTC_CMapCache *") PointerBuffer acache) { + if (CHECKS) { + check(acache, 1); + } + return nFTC_CMapCache_New(manager, memAddress(acache)); + } + + // --- [ FTC_CMapCache_Lookup ] --- + + @NativeType("FT_UInt") + public static int FTC_CMapCache_Lookup(@NativeType("FTC_CMapCache") long cache, @NativeType("FTC_FaceID") long face_id, @NativeType("FT_Int") int cmap_index, @NativeType("FT_UInt32") int char_code) { + long __functionAddress = Functions.FTC_CMapCache_Lookup; + if (CHECKS) { + check(cache); + check(face_id); + } + return invokePPI(cache, face_id, cmap_index, char_code, __functionAddress); + } + + // --- [ FTC_ImageCache_New ] --- + + public static int nFTC_ImageCache_New(long manager, long acache) { + long __functionAddress = Functions.FTC_ImageCache_New; + if (CHECKS) { + check(manager); + } + return invokePPI(manager, acache, __functionAddress); + } + + @NativeType("FT_Error") + public static int FTC_ImageCache_New(@NativeType("FTC_Manager") long manager, @NativeType("FTC_ImageCache *") PointerBuffer acache) { + if (CHECKS) { + check(acache, 1); + } + return nFTC_ImageCache_New(manager, memAddress(acache)); + } + + // --- [ FTC_ImageCache_Lookup ] --- + + public static int nFTC_ImageCache_Lookup(long cache, long type, int gindex, long aglyph, long anode) { + long __functionAddress = Functions.FTC_ImageCache_Lookup; + if (CHECKS) { + check(cache); + } + return invokePPPPI(cache, type, gindex, aglyph, anode, __functionAddress); + } + + @NativeType("FT_Error") + public static int FTC_ImageCache_Lookup(@NativeType("FTC_ImageCache") long cache, FTC_ImageType type, @NativeType("FT_UInt") int gindex, @NativeType("FT_Glyph *") PointerBuffer aglyph, @Nullable @NativeType("FTC_Node *") PointerBuffer anode) { + if (CHECKS) { + check(aglyph, 1); + checkSafe(anode, 1); + } + return nFTC_ImageCache_Lookup(cache, type.address(), gindex, memAddress(aglyph), memAddressSafe(anode)); + } + + // --- [ FTC_ImageCache_LookupScaler ] --- + + public static int nFTC_ImageCache_LookupScaler(long cache, long scaler, long load_flags, int gindex, long aglyph, long anode) { + long __functionAddress = Functions.FTC_ImageCache_LookupScaler; + if (CHECKS) { + check(cache); + } + return invokePPNPPI(cache, scaler, load_flags, gindex, aglyph, anode, __functionAddress); + } + + @NativeType("FT_Error") + public static int FTC_ImageCache_LookupScaler(@NativeType("FTC_ImageCache") long cache, FTC_Scaler scaler, @NativeType("FT_ULong") long load_flags, @NativeType("FT_UInt") int gindex, @NativeType("FT_Glyph *") PointerBuffer aglyph, @Nullable @NativeType("FTC_Node *") PointerBuffer anode) { + if (CHECKS) { + check(aglyph, 1); + checkSafe(anode, 1); + } + return nFTC_ImageCache_LookupScaler(cache, scaler.address(), load_flags, gindex, memAddress(aglyph), memAddressSafe(anode)); + } + + // --- [ FTC_SBitCache_New ] --- + + public static int nFTC_SBitCache_New(long manager, long acache) { + long __functionAddress = Functions.FTC_SBitCache_New; + if (CHECKS) { + check(manager); + } + return invokePPI(manager, acache, __functionAddress); + } + + @NativeType("FT_Error") + public static int FTC_SBitCache_New(@NativeType("FTC_Manager") long manager, @NativeType("FTC_SBitCache *") PointerBuffer acache) { + if (CHECKS) { + check(acache, 1); + } + return nFTC_SBitCache_New(manager, memAddress(acache)); + } + + // --- [ FTC_SBitCache_Lookup ] --- + + public static int nFTC_SBitCache_Lookup(long cache, long type, int gindex, long sbit, long anode) { + long __functionAddress = Functions.FTC_SBitCache_Lookup; + if (CHECKS) { + check(cache); + } + return invokePPPPI(cache, type, gindex, sbit, anode, __functionAddress); + } + + @NativeType("FT_Error") + public static int FTC_SBitCache_Lookup(@NativeType("FTC_SBitCache") long cache, FTC_ImageType type, @NativeType("FT_UInt") int gindex, @NativeType("FTC_SBit *") PointerBuffer sbit, @Nullable @NativeType("FTC_Node *") PointerBuffer anode) { + if (CHECKS) { + check(sbit, 1); + checkSafe(anode, 1); + } + return nFTC_SBitCache_Lookup(cache, type.address(), gindex, memAddress(sbit), memAddressSafe(anode)); + } + + // --- [ FTC_SBitCache_LookupScaler ] --- + + public static int nFTC_SBitCache_LookupScaler(long cache, long scaler, long load_flags, int gindex, long sbit, long anode) { + long __functionAddress = Functions.FTC_SBitCache_LookupScaler; + if (CHECKS) { + check(cache); + } + return invokePPNPPI(cache, scaler, load_flags, gindex, sbit, anode, __functionAddress); + } + + @NativeType("FT_Error") + public static int FTC_SBitCache_LookupScaler(@NativeType("FTC_SBitCache") long cache, FTC_Scaler scaler, @NativeType("FT_ULong") long load_flags, @NativeType("FT_UInt") int gindex, @NativeType("FTC_SBit *") PointerBuffer sbit, @Nullable @NativeType("FTC_Node *") PointerBuffer anode) { + if (CHECKS) { + check(sbit, 1); + checkSafe(anode, 1); + } + return nFTC_SBitCache_LookupScaler(cache, scaler.address(), load_flags, gindex, memAddress(sbit), memAddressSafe(anode)); + } + + // --- [ FT_Get_CID_Registry_Ordering_Supplement ] --- + + public static int nFT_Get_CID_Registry_Ordering_Supplement(long face, long registry, long ordering, long supplement) { + long __functionAddress = Functions.Get_CID_Registry_Ordering_Supplement; + return invokePPPPI(face, registry, ordering, supplement, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_CID_Registry_Ordering_Supplement(FT_Face face, @NativeType("char const **") PointerBuffer registry, @NativeType("char const **") PointerBuffer ordering, @NativeType("FT_Int *") IntBuffer supplement) { + if (CHECKS) { + check(registry, 1); + check(ordering, 1); + check(supplement, 1); + } + return nFT_Get_CID_Registry_Ordering_Supplement(face.address(), memAddress(registry), memAddress(ordering), memAddress(supplement)); + } + + // --- [ FT_Get_CID_Is_Internally_CID_Keyed ] --- + + public static int nFT_Get_CID_Is_Internally_CID_Keyed(long face, long is_cid) { + long __functionAddress = Functions.Get_CID_Is_Internally_CID_Keyed; + return invokePPI(face, is_cid, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_CID_Is_Internally_CID_Keyed(FT_Face face, @NativeType("FT_Bool *") ByteBuffer is_cid) { + if (CHECKS) { + check(is_cid, 1); + } + return nFT_Get_CID_Is_Internally_CID_Keyed(face.address(), memAddress(is_cid)); + } + + // --- [ FT_Get_CID_From_Glyph_Index ] --- + + public static int nFT_Get_CID_From_Glyph_Index(long face, int glyph_index, long cid) { + long __functionAddress = Functions.Get_CID_From_Glyph_Index; + return invokePPI(face, glyph_index, cid, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_CID_From_Glyph_Index(FT_Face face, @NativeType("FT_UInt") int glyph_index, @NativeType("FT_UInt *") IntBuffer cid) { + if (CHECKS) { + check(cid, 1); + } + return nFT_Get_CID_From_Glyph_Index(face.address(), glyph_index, memAddress(cid)); + } + + // --- [ FT_Palette_Data_Get ] --- + + public static int nFT_Palette_Data_Get(long face, long apalette) { + long __functionAddress = Functions.Palette_Data_Get; + return invokePPI(face, apalette, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Palette_Data_Get(FT_Face face, @NativeType("FT_Palette_Data *") FT_Palette_Data apalette) { + return nFT_Palette_Data_Get(face.address(), apalette.address()); + } + + // --- [ FT_Palette_Select ] --- + + public static int nFT_Palette_Select(long face, short palette_index, long apalette) { + long __functionAddress = Functions.Palette_Select; + return invokePCPI(face, palette_index, apalette, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Palette_Select(FT_Face face, @NativeType("FT_UShort") short palette_index, @Nullable @NativeType("FT_Color **") PointerBuffer apalette) { + if (CHECKS) { + checkSafe(apalette, 1); + } + return nFT_Palette_Select(face.address(), palette_index, memAddressSafe(apalette)); + } + + // --- [ FT_Palette_Set_Foreground_Color ] --- + + private static final FFICIF FT_Palette_Set_Foreground_ColorCIF = apiCreateCIF( + FFI_DEFAULT_ABI, ffi_type_sint32, + ffi_type_pointer, apiCreateStruct(ffi_type_uint8, ffi_type_uint8, ffi_type_uint8, ffi_type_uint8) + ); + + public static int nFT_Palette_Set_Foreground_Color(long face, long foreground_color) { + long __functionAddress = Functions.Palette_Set_Foreground_Color; + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + long __result = stack.nint(0); + long arguments = stack.nmalloc(POINTER_SIZE, POINTER_SIZE * 2); + memPutAddress(arguments, stack.npointer(face)); + memPutAddress(arguments + POINTER_SIZE, foreground_color); + + nffi_call(FT_Palette_Set_Foreground_ColorCIF.address(), __functionAddress, __result, arguments); + + return memGetInt(__result); + } finally { + stack.setPointer(stackPointer); + } + } + + @NativeType("FT_Error") + public static int FT_Palette_Set_Foreground_Color(FT_Face face, FT_Color foreground_color) { + return nFT_Palette_Set_Foreground_Color(face.address(), foreground_color.address()); + } + + // --- [ FT_Get_Color_Glyph_Layer ] --- + + public static boolean nFT_Get_Color_Glyph_Layer(long face, int base_glyph, long aglyph_index, long acolor_index, long iterator) { + long __functionAddress = Functions.Get_Color_Glyph_Layer; + return invokePPPPZ(face, base_glyph, aglyph_index, acolor_index, iterator, __functionAddress); + } + + @NativeType("FT_Bool") + public static boolean FT_Get_Color_Glyph_Layer(FT_Face face, @NativeType("FT_UInt") int base_glyph, @NativeType("FT_UInt *") IntBuffer aglyph_index, @NativeType("FT_UInt *") IntBuffer acolor_index, @NativeType("FT_LayerIterator *") FT_LayerIterator iterator) { + if (CHECKS) { + check(aglyph_index, 1); + check(acolor_index, 1); + } + return nFT_Get_Color_Glyph_Layer(face.address(), base_glyph, memAddress(aglyph_index), memAddress(acolor_index), iterator.address()); + } + + // --- [ FT_Get_Color_Glyph_Paint ] --- + + public static boolean nFT_Get_Color_Glyph_Paint(long face, int base_glyph, int root_transform, long paint) { + long __functionAddress = Functions.Get_Color_Glyph_Paint; + return invokePPZ(face, base_glyph, root_transform, paint, __functionAddress); + } + + @NativeType("FT_Bool") + public static boolean FT_Get_Color_Glyph_Paint(FT_Face face, @NativeType("FT_UInt") int base_glyph, @NativeType("FT_Color_Root_Transform") int root_transform, @NativeType("FT_OpaquePaintRec *") FT_OpaquePaint paint) { + return nFT_Get_Color_Glyph_Paint(face.address(), base_glyph, root_transform, paint.address()); + } + + // --- [ FT_Get_Color_Glyph_ClipBox ] --- + + public static boolean nFT_Get_Color_Glyph_ClipBox(long face, int base_glyph, long clip_box) { + long __functionAddress = Functions.Get_Color_Glyph_ClipBox; + return invokePPZ(face, base_glyph, clip_box, __functionAddress); + } + + @NativeType("FT_Bool") + public static boolean FT_Get_Color_Glyph_ClipBox(FT_Face face, @NativeType("FT_UInt") int base_glyph, @NativeType("FT_ClipBox *") FT_ClipBox clip_box) { + return nFT_Get_Color_Glyph_ClipBox(face.address(), base_glyph, clip_box.address()); + } + + // --- [ FT_Get_Paint_Layers ] --- + + public static boolean nFT_Get_Paint_Layers(long face, long iterator, long paint) { + long __functionAddress = Functions.Get_Paint_Layers; + return invokePPPZ(face, iterator, paint, __functionAddress); + } + + @NativeType("FT_Bool") + public static boolean FT_Get_Paint_Layers(FT_Face face, @NativeType("FT_LayerIterator *") FT_LayerIterator iterator, @NativeType("FT_OpaquePaintRec *") FT_OpaquePaint paint) { + return nFT_Get_Paint_Layers(face.address(), iterator.address(), paint.address()); + } + + // --- [ FT_Get_Colorline_Stops ] --- + + public static boolean nFT_Get_Colorline_Stops(long face, long color_stop, long iterator) { + long __functionAddress = Functions.Get_Colorline_Stops; + return invokePPPZ(face, color_stop, iterator, __functionAddress); + } + + @NativeType("FT_Bool") + public static boolean FT_Get_Colorline_Stops(FT_Face face, @NativeType("FT_ColorStop *") FT_ColorStop color_stop, @NativeType("FT_ColorStopIterator *") FT_ColorStopIterator iterator) { + return nFT_Get_Colorline_Stops(face.address(), color_stop.address(), iterator.address()); + } + + // --- [ FT_Get_Paint ] --- + + private static final FFICIF FT_Get_PaintCIF = apiCreateCIF( + FFI_DEFAULT_ABI, ffi_type_uint8, + ffi_type_pointer, apiCreateStruct(ffi_type_pointer, ffi_type_uint8), ffi_type_pointer + ); + + public static boolean nFT_Get_Paint(long face, long opaque_paint, long paint) { + long __functionAddress = Functions.Get_Paint; + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + long __result = stack.nbyte((byte)0); + long arguments = stack.nmalloc(POINTER_SIZE, POINTER_SIZE * 3); + memPutAddress(arguments, stack.npointer(face)); + memPutAddress(arguments + POINTER_SIZE, opaque_paint); + memPutAddress(arguments + 2 * POINTER_SIZE, stack.npointer(paint)); + + nffi_call(FT_Get_PaintCIF.address(), __functionAddress, __result, arguments); + + return memGetByte(__result) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + @NativeType("FT_Bool") + public static boolean FT_Get_Paint(FT_Face face, @NativeType("FT_OpaquePaintRec") FT_OpaquePaint opaque_paint, @NativeType("FT_COLR_Paint *") FT_COLR_Paint paint) { + return nFT_Get_Paint(face.address(), opaque_paint.address(), paint.address()); + } + + // --- [ FT_Error_String ] --- + + public static long nFT_Error_String(int error_code) { + long __functionAddress = Functions.Error_String; + return invokeP(error_code, __functionAddress); + } + + @Nullable + @NativeType("char const *") + public static String FT_Error_String(@NativeType("FT_Error") int error_code) { + long __result = nFT_Error_String(error_code); + return memASCIISafe(__result); + } + + // --- [ FT_Get_Font_Format ] --- + + public static long nFT_Get_Font_Format(long face) { + long __functionAddress = Functions.Get_Font_Format; + return invokePP(face, __functionAddress); + } + + @Nullable + @NativeType("char const *") + public static String FT_Get_Font_Format(FT_Face face) { + long __result = nFT_Get_Font_Format(face.address()); + return memASCIISafe(__result); + } + + // --- [ FT_Get_Gasp ] --- + + public static int nFT_Get_Gasp(long face, int ppem) { + long __functionAddress = Functions.Get_Gasp; + return invokePI(face, ppem, __functionAddress); + } + + @NativeType("FT_Int") + public static int FT_Get_Gasp(FT_Face face, @NativeType("FT_UInt") int ppem) { + return nFT_Get_Gasp(face.address(), ppem); + } + + // --- [ FT_New_Glyph ] --- + + public static int nFT_New_Glyph(long library, int format, long aglyph) { + long __functionAddress = Functions.New_Glyph; + if (CHECKS) { + check(library); + } + return invokePPI(library, format, aglyph, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_New_Glyph(@NativeType("FT_Library") long library, @NativeType("FT_Glyph_Format") int format, @NativeType("FT_Glyph *") PointerBuffer aglyph) { + if (CHECKS) { + check(aglyph, 1); + } + return nFT_New_Glyph(library, format, memAddress(aglyph)); + } + + // --- [ FT_Get_Glyph ] --- + + public static int nFT_Get_Glyph(long slot, long aglyph) { + long __functionAddress = Functions.Get_Glyph; + return invokePPI(slot, aglyph, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_Glyph(FT_GlyphSlot slot, @NativeType("FT_Glyph *") PointerBuffer aglyph) { + if (CHECKS) { + check(aglyph, 1); + } + return nFT_Get_Glyph(slot.address(), memAddress(aglyph)); + } + + // --- [ FT_Glyph_Copy ] --- + + public static int nFT_Glyph_Copy(long source, long target) { + long __functionAddress = Functions.Glyph_Copy; + return invokePPI(source, target, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Glyph_Copy(FT_Glyph source, @NativeType("FT_Glyph *") PointerBuffer target) { + if (CHECKS) { + check(target, 1); + } + return nFT_Glyph_Copy(source.address(), memAddress(target)); + } + + // --- [ FT_Glyph_Transform ] --- + + public static int nFT_Glyph_Transform(long glyph, long matrix, long delta) { + long __functionAddress = Functions.Glyph_Transform; + return invokePPPI(glyph, matrix, delta, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Glyph_Transform(FT_Glyph glyph, @Nullable @NativeType("FT_Matrix const *") FT_Matrix matrix, @Nullable @NativeType("FT_Vector const *") FT_Vector delta) { + return nFT_Glyph_Transform(glyph.address(), memAddressSafe(matrix), memAddressSafe(delta)); + } + + // --- [ FT_Glyph_Get_CBox ] --- + + public static void nFT_Glyph_Get_CBox(long glyph, int bbox_mode, long acbox) { + long __functionAddress = Functions.Glyph_Get_CBox; + invokePPV(glyph, bbox_mode, acbox, __functionAddress); + } + + public static void FT_Glyph_Get_CBox(FT_Glyph glyph, @NativeType("FT_UInt") int bbox_mode, @NativeType("FT_BBox *") FT_BBox acbox) { + nFT_Glyph_Get_CBox(glyph.address(), bbox_mode, acbox.address()); + } + + // --- [ FT_Glyph_To_Bitmap ] --- + + public static int nFT_Glyph_To_Bitmap(long the_glyph, int render_mode, long origin, boolean destroy) { + long __functionAddress = Functions.Glyph_To_Bitmap; + return invokePPI(the_glyph, render_mode, origin, destroy, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Glyph_To_Bitmap(@NativeType("FT_Glyph *") PointerBuffer the_glyph, @NativeType("FT_Render_Mode") int render_mode, @Nullable @NativeType("FT_Vector const *") FT_Vector origin, @NativeType("FT_Bool") boolean destroy) { + if (CHECKS) { + check(the_glyph, 1); + } + return nFT_Glyph_To_Bitmap(memAddress(the_glyph), render_mode, memAddressSafe(origin), destroy); + } + + // --- [ FT_Done_Glyph ] --- + + public static void nFT_Done_Glyph(long glyph) { + long __functionAddress = Functions.Done_Glyph; + invokePV(glyph, __functionAddress); + } + + public static void FT_Done_Glyph(@Nullable FT_Glyph glyph) { + nFT_Done_Glyph(memAddressSafe(glyph)); + } + + // --- [ FT_Matrix_Multiply ] --- + + public static void nFT_Matrix_Multiply(long a, long b) { + long __functionAddress = Functions.Matrix_Multiply; + invokePPV(a, b, __functionAddress); + } + + public static void FT_Matrix_Multiply(@NativeType("FT_Matrix const *") FT_Matrix a, @NativeType("FT_Matrix *") FT_Matrix b) { + nFT_Matrix_Multiply(a.address(), b.address()); + } + + // --- [ FT_Matrix_Invert ] --- + + public static int nFT_Matrix_Invert(long matrix) { + long __functionAddress = Functions.Matrix_Invert; + return invokePI(matrix, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Matrix_Invert(@NativeType("FT_Matrix *") FT_Matrix matrix) { + return nFT_Matrix_Invert(matrix.address()); + } + + // --- [ FT_TrueTypeGX_Validate ] --- + + public static int nFT_TrueTypeGX_Validate(long face, int validation_flags, long tables, int table_length) { + long __functionAddress = Functions.TrueTypeGX_Validate; + return invokePPI(face, validation_flags, tables, table_length, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_TrueTypeGX_Validate(FT_Face face, @NativeType("FT_UInt") int validation_flags, @NativeType("FT_Bytes *") PointerBuffer tables) { + return nFT_TrueTypeGX_Validate(face.address(), validation_flags, memAddress(tables), tables.remaining()); + } + + // --- [ FT_TrueTypeGX_Free ] --- + + public static void nFT_TrueTypeGX_Free(long face, long table) { + long __functionAddress = Functions.TrueTypeGX_Free; + invokePPV(face, table, __functionAddress); + } + + public static void FT_TrueTypeGX_Free(FT_Face face, @NativeType("FT_Bytes") ByteBuffer table) { + nFT_TrueTypeGX_Free(face.address(), memAddress(table)); + } + + // --- [ FT_ClassicKern_Validate ] --- + + public static int nFT_ClassicKern_Validate(long face, int validation_flags, long ckern_table) { + long __functionAddress = Functions.ClassicKern_Validate; + return invokePPI(face, validation_flags, ckern_table, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_ClassicKern_Validate(FT_Face face, @NativeType("FT_UInt") int validation_flags, @NativeType("FT_Bytes *") PointerBuffer ckern_table) { + if (CHECKS) { + check(ckern_table, 1); + } + return nFT_ClassicKern_Validate(face.address(), validation_flags, memAddress(ckern_table)); + } + + // --- [ FT_ClassicKern_Free ] --- + + public static void nFT_ClassicKern_Free(long face, long table) { + long __functionAddress = Functions.ClassicKern_Free; + invokePPV(face, table, __functionAddress); + } + + public static void FT_ClassicKern_Free(FT_Face face, @NativeType("FT_Bytes") ByteBuffer table) { + nFT_ClassicKern_Free(face.address(), memAddress(table)); + } + + // --- [ FT_Stream_OpenGzip ] --- + + public static int nFT_Stream_OpenGzip(long stream, long source) { + long __functionAddress = Functions.Stream_OpenGzip; + return invokePPI(stream, source, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Stream_OpenGzip(FT_Stream stream, FT_Stream source) { + return nFT_Stream_OpenGzip(stream.address(), source.address()); + } + + // --- [ FT_Gzip_Uncompress ] --- + + public static int nFT_Gzip_Uncompress(long memory, long output, long output_len, long input, long input_len) { + long __functionAddress = Functions.Gzip_Uncompress; + return invokePPPPNI(memory, output, output_len, input, input_len, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Gzip_Uncompress(FT_Memory memory, @NativeType("FT_Byte *") ByteBuffer output, @NativeType("FT_ULong *") CLongBuffer output_len, @NativeType("FT_Byte const *") ByteBuffer input) { + if (CHECKS) { + check(output_len, 1); + check(output, output_len.get(output_len.position())); + } + return nFT_Gzip_Uncompress(memory.address(), memAddress(output), memAddress(output_len), memAddress(input), input.remaining()); + } + + // --- [ FT_Library_SetLcdFilter ] --- + + @NativeType("FT_Error") + public static int FT_Library_SetLcdFilter(@NativeType("FT_Library") long library, @NativeType("FT_LcdFilter") int filter) { + long __functionAddress = Functions.Library_SetLcdFilter; + if (CHECKS) { + check(library); + } + return invokePI(library, filter, __functionAddress); + } + + // --- [ FT_Library_SetLcdFilterWeights ] --- + + public static int nFT_Library_SetLcdFilterWeights(long library, long weights) { + long __functionAddress = Functions.Library_SetLcdFilterWeights; + if (CHECKS) { + check(library); + } + return invokePPI(library, weights, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Library_SetLcdFilterWeights(@NativeType("FT_Library") long library, @NativeType("unsigned char *") ByteBuffer weights) { + if (CHECKS) { + check(weights, 5); + } + return nFT_Library_SetLcdFilterWeights(library, memAddress(weights)); + } + + // --- [ FT_Library_SetLcdGeometry ] --- + + public static int nFT_Library_SetLcdGeometry(long library, long sub) { + long __functionAddress = Functions.Library_SetLcdGeometry; + if (CHECKS) { + check(library); + } + return invokePPI(library, sub, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Library_SetLcdGeometry(@NativeType("FT_Library") long library, @NativeType("FT_Vector *") FT_Vector.Buffer sub) { + if (CHECKS) { + check(sub, 3); + } + return nFT_Library_SetLcdGeometry(library, sub.address()); + } + + // --- [ FT_List_Find ] --- + + public static long nFT_List_Find(long list, long data) { + long __functionAddress = Functions.List_Find; + if (CHECKS) { + check(data); + } + return invokePPP(list, data, __functionAddress); + } + + @Nullable + public static FT_ListNode FT_List_Find(FT_List list, @NativeType("void *") long data) { + long __result = nFT_List_Find(list.address(), data); + return FT_ListNode.createSafe(__result); + } + + // --- [ FT_List_Add ] --- + + public static void nFT_List_Add(long list, long node) { + long __functionAddress = Functions.List_Add; + invokePPV(list, node, __functionAddress); + } + + public static void FT_List_Add(FT_List list, FT_ListNode node) { + nFT_List_Add(list.address(), node.address()); + } + + // --- [ FT_List_Insert ] --- + + public static void nFT_List_Insert(long list, long node) { + long __functionAddress = Functions.List_Insert; + invokePPV(list, node, __functionAddress); + } + + public static void FT_List_Insert(FT_List list, FT_ListNode node) { + nFT_List_Insert(list.address(), node.address()); + } + + // --- [ FT_List_Remove ] --- + + public static void nFT_List_Remove(long list, long node) { + long __functionAddress = Functions.List_Remove; + invokePPV(list, node, __functionAddress); + } + + public static void FT_List_Remove(FT_List list, FT_ListNode node) { + nFT_List_Remove(list.address(), node.address()); + } + + // --- [ FT_List_Up ] --- + + public static void nFT_List_Up(long list, long node) { + long __functionAddress = Functions.List_Up; + invokePPV(list, node, __functionAddress); + } + + public static void FT_List_Up(FT_List list, FT_ListNode node) { + nFT_List_Up(list.address(), node.address()); + } + + // --- [ FT_List_Iterate ] --- + + public static int nFT_List_Iterate(long list, long iterator, long user) { + long __functionAddress = Functions.List_Iterate; + return invokePPPI(list, iterator, user, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_List_Iterate(FT_List list, @NativeType("FT_List_Iterator") FT_List_IteratorI iterator, @NativeType("void *") long user) { + return nFT_List_Iterate(list.address(), iterator.address(), user); + } + + // --- [ FT_List_Finalize ] --- + + public static void nFT_List_Finalize(long list, long destroy, long memory, long user) { + long __functionAddress = Functions.List_Finalize; + invokePPPPV(list, destroy, memory, user, __functionAddress); + } + + public static void FT_List_Finalize(FT_List list, @Nullable @NativeType("FT_List_Destructor") FT_List_DestructorI destroy, FT_Memory memory, @NativeType("void *") long user) { + nFT_List_Finalize(list.address(), memAddressSafe(destroy), memory.address(), user); + } + + // --- [ FT_Stream_OpenLZW ] --- + + public static int nFT_Stream_OpenLZW(long stream, long source) { + long __functionAddress = Functions.Stream_OpenLZW; + return invokePPI(stream, source, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Stream_OpenLZW(FT_Stream stream, FT_Stream source) { + return nFT_Stream_OpenLZW(stream.address(), source.address()); + } + + // --- [ FT_Get_Multi_Master ] --- + + public static int nFT_Get_Multi_Master(long face, long amaster) { + long __functionAddress = Functions.Get_Multi_Master; + return invokePPI(face, amaster, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_Multi_Master(FT_Face face, @NativeType("FT_Multi_Master *") FT_Multi_Master amaster) { + return nFT_Get_Multi_Master(face.address(), amaster.address()); + } + + // --- [ FT_Get_MM_Var ] --- + + public static int nFT_Get_MM_Var(long face, long amaster) { + long __functionAddress = Functions.Get_MM_Var; + return invokePPI(face, amaster, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_MM_Var(FT_Face face, @NativeType("FT_MM_Var **") PointerBuffer amaster) { + if (CHECKS) { + check(amaster, 1); + } + return nFT_Get_MM_Var(face.address(), memAddress(amaster)); + } + + // --- [ FT_Done_MM_Var ] --- + + public static int nFT_Done_MM_Var(long library, long amaster) { + long __functionAddress = Functions.Done_MM_Var; + if (CHECKS) { + check(library); + } + return invokePPI(library, amaster, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Done_MM_Var(@NativeType("FT_Library") long library, @NativeType("FT_MM_Var *") FT_MM_Var amaster) { + return nFT_Done_MM_Var(library, amaster.address()); + } + + // --- [ FT_Set_MM_Design_Coordinates ] --- + + public static int nFT_Set_MM_Design_Coordinates(long face, int num_coords, long coords) { + long __functionAddress = Functions.Set_MM_Design_Coordinates; + return invokePPI(face, num_coords, coords, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Set_MM_Design_Coordinates(FT_Face face, @NativeType("FT_Long *") CLongBuffer coords) { + return nFT_Set_MM_Design_Coordinates(face.address(), coords.remaining(), memAddress(coords)); + } + + // --- [ FT_Set_Var_Design_Coordinates ] --- + + public static int nFT_Set_Var_Design_Coordinates(long face, int num_coords, long coords) { + long __functionAddress = Functions.Set_Var_Design_Coordinates; + return invokePPI(face, num_coords, coords, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Set_Var_Design_Coordinates(FT_Face face, @NativeType("FT_Fixed *") CLongBuffer coords) { + return nFT_Set_Var_Design_Coordinates(face.address(), coords.remaining(), memAddress(coords)); + } + + // --- [ FT_Get_Var_Design_Coordinates ] --- + + public static int nFT_Get_Var_Design_Coordinates(long face, int num_coords, long coords) { + long __functionAddress = Functions.Get_Var_Design_Coordinates; + return invokePPI(face, num_coords, coords, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_Var_Design_Coordinates(FT_Face face, @NativeType("FT_Fixed *") CLongBuffer coords) { + return nFT_Get_Var_Design_Coordinates(face.address(), coords.remaining(), memAddress(coords)); + } + + // --- [ FT_Set_MM_Blend_Coordinates ] --- + + public static int nFT_Set_MM_Blend_Coordinates(long face, int num_coords, long coords) { + long __functionAddress = Functions.Set_MM_Blend_Coordinates; + return invokePPI(face, num_coords, coords, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Set_MM_Blend_Coordinates(FT_Face face, @NativeType("FT_Fixed *") CLongBuffer coords) { + return nFT_Set_MM_Blend_Coordinates(face.address(), coords.remaining(), memAddress(coords)); + } + + // --- [ FT_Get_MM_Blend_Coordinates ] --- + + public static int nFT_Get_MM_Blend_Coordinates(long face, int num_coords, long coords) { + long __functionAddress = Functions.Get_MM_Blend_Coordinates; + return invokePPI(face, num_coords, coords, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_MM_Blend_Coordinates(FT_Face face, @NativeType("FT_Fixed *") CLongBuffer coords) { + return nFT_Get_MM_Blend_Coordinates(face.address(), coords.remaining(), memAddress(coords)); + } + + // --- [ FT_Set_Var_Blend_Coordinates ] --- + + public static int nFT_Set_Var_Blend_Coordinates(long face, int num_coords, long coords) { + long __functionAddress = Functions.Set_Var_Blend_Coordinates; + return invokePPI(face, num_coords, coords, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Set_Var_Blend_Coordinates(FT_Face face, @NativeType("FT_Fixed *") CLongBuffer coords) { + return nFT_Set_Var_Blend_Coordinates(face.address(), coords.remaining(), memAddress(coords)); + } + + // --- [ FT_Get_Var_Blend_Coordinates ] --- + + public static int nFT_Get_Var_Blend_Coordinates(long face, int num_coords, long coords) { + long __functionAddress = Functions.Get_Var_Blend_Coordinates; + return invokePPI(face, num_coords, coords, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_Var_Blend_Coordinates(FT_Face face, @NativeType("FT_Fixed *") CLongBuffer coords) { + return nFT_Get_Var_Blend_Coordinates(face.address(), coords.remaining(), memAddress(coords)); + } + + // --- [ FT_Set_MM_WeightVector ] --- + + /** Unsafe version of: {@link #FT_Set_MM_WeightVector Set_MM_WeightVector} */ + public static int nFT_Set_MM_WeightVector(long face, int len, long weightvector) { + long __functionAddress = Functions.Set_MM_WeightVector; + return invokePPI(face, len, weightvector, __functionAddress); + } + + /** @return : FreeType error code. 0~means success. */ + @NativeType("FT_Error") + public static int FT_Set_MM_WeightVector(FT_Face face, @Nullable @NativeType("FT_Fixed *") CLongBuffer weightvector) { + return nFT_Set_MM_WeightVector(face.address(), remainingSafe(weightvector), memAddressSafe(weightvector)); + } + + // --- [ FT_Get_MM_WeightVector ] --- + + public static int nFT_Get_MM_WeightVector(long face, long len, long weightvector) { + long __functionAddress = Functions.Get_MM_WeightVector; + return invokePPPI(face, len, weightvector, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_MM_WeightVector(FT_Face face, @NativeType("FT_UInt *") IntBuffer len, @NativeType("FT_Fixed *") CLongBuffer weightvector) { + if (CHECKS) { + check(len, 1); + check(weightvector, len.get(len.position())); + } + return nFT_Get_MM_WeightVector(face.address(), memAddress(len), memAddress(weightvector)); + } + + // --- [ FT_Get_Var_Axis_Flags ] --- + + public static int nFT_Get_Var_Axis_Flags(long master, int axis_index, long flags) { + long __functionAddress = Functions.Get_Var_Axis_Flags; + return invokePPI(master, axis_index, flags, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_Var_Axis_Flags(@NativeType("FT_MM_Var *") FT_MM_Var master, @NativeType("FT_UInt") int axis_index, @NativeType("FT_UInt *") IntBuffer flags) { + if (CHECKS) { + check(flags, 1); + } + return nFT_Get_Var_Axis_Flags(master.address(), axis_index, memAddress(flags)); + } + + // --- [ FT_Set_Named_Instance ] --- + + public static int nFT_Set_Named_Instance(long face, int instance_index) { + long __functionAddress = Functions.Set_Named_Instance; + return invokePI(face, instance_index, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Set_Named_Instance(FT_Face face, @NativeType("FT_UInt") int instance_index) { + return nFT_Set_Named_Instance(face.address(), instance_index); + } + + // --- [ FT_Get_Default_Named_Instance ] --- + + public static int nFT_Get_Default_Named_Instance(long face, long instance_index) { + long __functionAddress = Functions.Get_Default_Named_Instance; + return invokePPI(face, instance_index, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_Default_Named_Instance(FT_Face face, @NativeType("FT_UInt *") IntBuffer instance_index) { + if (CHECKS) { + check(instance_index, 1); + } + return nFT_Get_Default_Named_Instance(face.address(), memAddress(instance_index)); + } + + // --- [ FT_Add_Module ] --- + + public static int nFT_Add_Module(long library, long clazz) { + long __functionAddress = Functions.Add_Module; + if (CHECKS) { + check(library); + FT_Module_Class.validate(clazz); + } + return invokePPI(library, clazz, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Add_Module(@NativeType("FT_Library") long library, @NativeType("FT_Module_Class const *") FT_Module_Class clazz) { + return nFT_Add_Module(library, clazz.address()); + } + + // --- [ FT_Get_Module ] --- + + public static long nFT_Get_Module(long library, long module_name) { + long __functionAddress = Functions.Get_Module; + if (CHECKS) { + check(library); + } + return invokePPP(library, module_name, __functionAddress); + } + + @NativeType("FT_Module") + public static long FT_Get_Module(@NativeType("FT_Library") long library, @NativeType("char const *") ByteBuffer module_name) { + if (CHECKS) { + checkNT1(module_name); + } + return nFT_Get_Module(library, memAddress(module_name)); + } + + @NativeType("FT_Module") + public static long FT_Get_Module(@NativeType("FT_Library") long library, @NativeType("char const *") CharSequence module_name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(module_name, true); + long module_nameEncoded = stack.getPointerAddress(); + return nFT_Get_Module(library, module_nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ FT_Remove_Module ] --- + + @NativeType("FT_Error") + public static int FT_Remove_Module(@NativeType("FT_Library") long library, @NativeType("FT_Module") long module) { + long __functionAddress = Functions.Remove_Module; + if (CHECKS) { + check(library); + check(module); + } + return invokePPI(library, module, __functionAddress); + } + + // --- [ FT_Property_Set ] --- + + public static int nFT_Property_Set(long library, long module_name, long property_name, long value) { + long __functionAddress = Functions.Property_Set; + if (CHECKS) { + check(library); + } + return invokePPPPI(library, module_name, property_name, value, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Property_Set(@NativeType("FT_Library") long library, @NativeType("FT_String const *") ByteBuffer module_name, @NativeType("FT_String const *") ByteBuffer property_name, @NativeType("void const *") ByteBuffer value) { + if (CHECKS) { + checkNT1(module_name); + checkNT1(property_name); + } + return nFT_Property_Set(library, memAddress(module_name), memAddress(property_name), memAddress(value)); + } + + @NativeType("FT_Error") + public static int FT_Property_Set(@NativeType("FT_Library") long library, @NativeType("FT_String const *") CharSequence module_name, @NativeType("FT_String const *") CharSequence property_name, @NativeType("void const *") ByteBuffer value) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(module_name, true); + long module_nameEncoded = stack.getPointerAddress(); + stack.nUTF8(property_name, true); + long property_nameEncoded = stack.getPointerAddress(); + return nFT_Property_Set(library, module_nameEncoded, property_nameEncoded, memAddress(value)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ FT_Property_Get ] --- + + public static int nFT_Property_Get(long library, long module_name, long property_name, long value) { + long __functionAddress = Functions.Property_Get; + if (CHECKS) { + check(library); + } + return invokePPPPI(library, module_name, property_name, value, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Property_Get(@NativeType("FT_Library") long library, @NativeType("FT_String const *") ByteBuffer module_name, @NativeType("FT_String const *") ByteBuffer property_name, @NativeType("void *") ByteBuffer value) { + if (CHECKS) { + checkNT1(module_name); + checkNT1(property_name); + } + return nFT_Property_Get(library, memAddress(module_name), memAddress(property_name), memAddress(value)); + } + + @NativeType("FT_Error") + public static int FT_Property_Get(@NativeType("FT_Library") long library, @NativeType("FT_String const *") CharSequence module_name, @NativeType("FT_String const *") CharSequence property_name, @NativeType("void *") ByteBuffer value) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(module_name, true); + long module_nameEncoded = stack.getPointerAddress(); + stack.nUTF8(property_name, true); + long property_nameEncoded = stack.getPointerAddress(); + return nFT_Property_Get(library, module_nameEncoded, property_nameEncoded, memAddress(value)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ FT_Set_Default_Properties ] --- + + public static void FT_Set_Default_Properties(@NativeType("FT_Library") long library) { + long __functionAddress = Functions.Set_Default_Properties; + if (CHECKS) { + check(library); + } + invokePV(library, __functionAddress); + } + + // --- [ FT_Reference_Library ] --- + + @NativeType("FT_Error") + public static int FT_Reference_Library(@NativeType("FT_Library") long library) { + long __functionAddress = Functions.Reference_Library; + if (CHECKS) { + check(library); + } + return invokePI(library, __functionAddress); + } + + // --- [ FT_New_Library ] --- + + public static int nFT_New_Library(long memory, long alibrary) { + long __functionAddress = Functions.New_Library; + return invokePPI(memory, alibrary, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_New_Library(FT_Memory memory, @NativeType("FT_Library *") PointerBuffer alibrary) { + if (CHECKS) { + check(alibrary, 1); + } + return nFT_New_Library(memory.address(), memAddress(alibrary)); + } + + // --- [ FT_Done_Library ] --- + + @NativeType("FT_Error") + public static int FT_Done_Library(@NativeType("FT_Library") long library) { + long __functionAddress = Functions.Done_Library; + if (CHECKS) { + check(library); + } + return invokePI(library, __functionAddress); + } + + // --- [ FT_Set_Debug_Hook ] --- + + public static void nFT_Set_Debug_Hook(long library, int hook_index, long debug_hook) { + long __functionAddress = Functions.Set_Debug_Hook; + if (CHECKS) { + check(library); + } + invokePPV(library, hook_index, debug_hook, __functionAddress); + } + + public static void FT_Set_Debug_Hook(@NativeType("FT_Library") long library, @NativeType("FT_UInt") int hook_index, @Nullable @NativeType("FT_DebugHook_Func") FT_DebugHook_FuncI debug_hook) { + nFT_Set_Debug_Hook(library, hook_index, memAddressSafe(debug_hook)); + } + + // --- [ FT_Add_Default_Modules ] --- + + public static void FT_Add_Default_Modules(@NativeType("FT_Library") long library) { + long __functionAddress = Functions.Add_Default_Modules; + if (CHECKS) { + check(library); + } + invokePV(library, __functionAddress); + } + + // --- [ FT_Get_TrueType_Engine_Type ] --- + + @NativeType("FT_TrueTypeEngineType") + public static int FT_Get_TrueType_Engine_Type(@NativeType("FT_Library") long library) { + long __functionAddress = Functions.Get_TrueType_Engine_Type; + if (CHECKS) { + check(library); + } + return invokePI(library, __functionAddress); + } + + // --- [ FT_OpenType_Validate ] --- + + public static int nFT_OpenType_Validate(long face, int validation_flags, long BASE_table, long GDEF_table, long GPOS_table, long GSUB_table, long JSTF_table) { + long __functionAddress = Functions.OpenType_Validate; + return invokePPPPPPI(face, validation_flags, BASE_table, GDEF_table, GPOS_table, GSUB_table, JSTF_table, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_OpenType_Validate(FT_Face face, @NativeType("FT_UInt") int validation_flags, @NativeType("FT_Bytes *") PointerBuffer BASE_table, @NativeType("FT_Bytes *") PointerBuffer GDEF_table, @NativeType("FT_Bytes *") PointerBuffer GPOS_table, @NativeType("FT_Bytes *") PointerBuffer GSUB_table, @NativeType("FT_Bytes *") PointerBuffer JSTF_table) { + if (CHECKS) { + check(BASE_table, 1); + check(GDEF_table, 1); + check(GPOS_table, 1); + check(GSUB_table, 1); + check(JSTF_table, 1); + } + return nFT_OpenType_Validate(face.address(), validation_flags, memAddress(BASE_table), memAddress(GDEF_table), memAddress(GPOS_table), memAddress(GSUB_table), memAddress(JSTF_table)); + } + + // --- [ FT_OpenType_Free ] --- + + public static void nFT_OpenType_Free(long face, long table) { + long __functionAddress = Functions.OpenType_Free; + invokePPV(face, table, __functionAddress); + } + + public static void FT_OpenType_Free(FT_Face face, @NativeType("FT_Bytes") ByteBuffer table) { + nFT_OpenType_Free(face.address(), memAddress(table)); + } + + // --- [ FT_Outline_Decompose ] --- + + public static int nFT_Outline_Decompose(long outline, long func_interface, long user) { + long __functionAddress = Functions.Outline_Decompose; + return invokePPPI(outline, func_interface, user, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Outline_Decompose(@NativeType("FT_Outline *") FT_Outline outline, @NativeType("FT_Outline_Funcs const *") FT_Outline_Funcs func_interface, @NativeType("void *") long user) { + return nFT_Outline_Decompose(outline.address(), func_interface.address(), user); + } + + // --- [ FT_Outline_New ] --- + + public static int nFT_Outline_New(long library, int numPoints, int numContours, long anoutline) { + long __functionAddress = Functions.Outline_New; + if (CHECKS) { + check(library); + } + return invokePPI(library, numPoints, numContours, anoutline, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Outline_New(@NativeType("FT_Library") long library, @NativeType("FT_UInt") int numPoints, @NativeType("FT_Int") int numContours, @NativeType("FT_Outline *") FT_Outline anoutline) { + return nFT_Outline_New(library, numPoints, numContours, anoutline.address()); + } + + // --- [ FT_Outline_Done ] --- + + public static int nFT_Outline_Done(long library, long outline) { + long __functionAddress = Functions.Outline_Done; + if (CHECKS) { + check(library); + } + return invokePPI(library, outline, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Outline_Done(@NativeType("FT_Library") long library, @NativeType("FT_Outline *") FT_Outline outline) { + return nFT_Outline_Done(library, outline.address()); + } + + // --- [ FT_Outline_Check ] --- + + public static int nFT_Outline_Check(long outline) { + long __functionAddress = Functions.Outline_Check; + return invokePI(outline, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Outline_Check(@NativeType("FT_Outline *") FT_Outline outline) { + return nFT_Outline_Check(outline.address()); + } + + // --- [ FT_Outline_Get_CBox ] --- + + public static void nFT_Outline_Get_CBox(long outline, long acbox) { + long __functionAddress = Functions.Outline_Get_CBox; + invokePPV(outline, acbox, __functionAddress); + } + + public static void FT_Outline_Get_CBox(@NativeType("FT_Outline const *") FT_Outline outline, @NativeType("FT_BBox *") FT_BBox acbox) { + nFT_Outline_Get_CBox(outline.address(), acbox.address()); + } + + // --- [ FT_Outline_Translate ] --- + + public static void nFT_Outline_Translate(long outline, long xOffset, long yOffset) { + long __functionAddress = Functions.Outline_Translate; + invokePNNV(outline, xOffset, yOffset, __functionAddress); + } + + public static void FT_Outline_Translate(@NativeType("FT_Outline const *") FT_Outline outline, @NativeType("FT_Pos") long xOffset, @NativeType("FT_Pos") long yOffset) { + nFT_Outline_Translate(outline.address(), xOffset, yOffset); + } + + // --- [ FT_Outline_Copy ] --- + + public static int nFT_Outline_Copy(long source, long target) { + long __functionAddress = Functions.Outline_Copy; + return invokePPI(source, target, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Outline_Copy(@NativeType("FT_Outline const *") FT_Outline source, @NativeType("FT_Outline *") FT_Outline target) { + return nFT_Outline_Copy(source.address(), target.address()); + } + + // --- [ FT_Outline_Transform ] --- + + public static void nFT_Outline_Transform(long outline, long matrix) { + long __functionAddress = Functions.Outline_Transform; + invokePPV(outline, matrix, __functionAddress); + } + + public static void FT_Outline_Transform(@NativeType("FT_Outline const *") FT_Outline outline, @NativeType("FT_Matrix const *") FT_Matrix matrix) { + nFT_Outline_Transform(outline.address(), matrix.address()); + } + + // --- [ FT_Outline_Embolden ] --- + + public static int nFT_Outline_Embolden(long outline, long strength) { + long __functionAddress = Functions.Outline_Embolden; + return invokePNI(outline, strength, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Outline_Embolden(@NativeType("FT_Outline *") FT_Outline outline, @NativeType("FT_Pos") long strength) { + return nFT_Outline_Embolden(outline.address(), strength); + } + + // --- [ FT_Outline_EmboldenXY ] --- + + public static int nFT_Outline_EmboldenXY(long outline, long xstrength, long ystrength) { + long __functionAddress = Functions.Outline_EmboldenXY; + return invokePNNI(outline, xstrength, ystrength, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Outline_EmboldenXY(@NativeType("FT_Outline *") FT_Outline outline, @NativeType("FT_Pos") long xstrength, @NativeType("FT_Pos") long ystrength) { + return nFT_Outline_EmboldenXY(outline.address(), xstrength, ystrength); + } + + // --- [ FT_Outline_Reverse ] --- + + public static void nFT_Outline_Reverse(long outline) { + long __functionAddress = Functions.Outline_Reverse; + invokePV(outline, __functionAddress); + } + + public static void FT_Outline_Reverse(@NativeType("FT_Outline *") FT_Outline outline) { + nFT_Outline_Reverse(outline.address()); + } + + // --- [ FT_Outline_Get_Bitmap ] --- + + public static int nFT_Outline_Get_Bitmap(long library, long outline, long abitmap) { + long __functionAddress = Functions.Outline_Get_Bitmap; + if (CHECKS) { + check(library); + } + return invokePPPI(library, outline, abitmap, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Outline_Get_Bitmap(@NativeType("FT_Library") long library, @NativeType("FT_Outline *") FT_Outline outline, @NativeType("FT_Bitmap const *") FT_Bitmap abitmap) { + return nFT_Outline_Get_Bitmap(library, outline.address(), abitmap.address()); + } + + // --- [ FT_Outline_Render ] --- + + public static int nFT_Outline_Render(long library, long outline, long params) { + long __functionAddress = Functions.Outline_Render; + if (CHECKS) { + check(library); + } + return invokePPPI(library, outline, params, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Outline_Render(@NativeType("FT_Library") long library, @NativeType("FT_Outline *") FT_Outline outline, @NativeType("FT_Raster_Params *") FT_Raster_Params params) { + return nFT_Outline_Render(library, outline.address(), params.address()); + } + + // --- [ FT_Outline_Get_Orientation ] --- + + public static int nFT_Outline_Get_Orientation(long outline) { + long __functionAddress = Functions.Outline_Get_Orientation; + return invokePI(outline, __functionAddress); + } + + @NativeType("FT_Orientation") + public static int FT_Outline_Get_Orientation(@NativeType("FT_Outline *") FT_Outline outline) { + return nFT_Outline_Get_Orientation(outline.address()); + } + + // --- [ FT_Get_PFR_Metrics ] --- + + public static int nFT_Get_PFR_Metrics(long face, long aoutline_resolution, long ametrics_resolution, long ametrics_x_scale, long ametrics_y_scale) { + long __functionAddress = Functions.Get_PFR_Metrics; + return invokePPPPPI(face, aoutline_resolution, ametrics_resolution, ametrics_x_scale, ametrics_y_scale, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_PFR_Metrics(FT_Face face, @Nullable @NativeType("FT_UInt *") IntBuffer aoutline_resolution, @Nullable @NativeType("FT_UInt *") IntBuffer ametrics_resolution, @Nullable @NativeType("FT_Fixed *") CLongBuffer ametrics_x_scale, @Nullable @NativeType("FT_Fixed *") CLongBuffer ametrics_y_scale) { + if (CHECKS) { + checkSafe(aoutline_resolution, 1); + checkSafe(ametrics_resolution, 1); + checkSafe(ametrics_x_scale, 1); + checkSafe(ametrics_y_scale, 1); + } + return nFT_Get_PFR_Metrics(face.address(), memAddressSafe(aoutline_resolution), memAddressSafe(ametrics_resolution), memAddressSafe(ametrics_x_scale), memAddressSafe(ametrics_y_scale)); + } + + // --- [ FT_Get_PFR_Kerning ] --- + + public static int nFT_Get_PFR_Kerning(long face, int left, int right, long avector) { + long __functionAddress = Functions.Get_PFR_Kerning; + return invokePPI(face, left, right, avector, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_PFR_Kerning(FT_Face face, @NativeType("FT_UInt") int left, @NativeType("FT_UInt") int right, @NativeType("FT_Vector *") FT_Vector avector) { + return nFT_Get_PFR_Kerning(face.address(), left, right, avector.address()); + } + + // --- [ FT_Get_PFR_Advance ] --- + + public static int nFT_Get_PFR_Advance(long face, int gindex, long aadvance) { + long __functionAddress = Functions.Get_PFR_Advance; + return invokePPI(face, gindex, aadvance, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_PFR_Advance(FT_Face face, @NativeType("FT_UInt") int gindex, @NativeType("FT_Pos *") CLongBuffer aadvance) { + if (CHECKS) { + check(aadvance, 1); + } + return nFT_Get_PFR_Advance(face.address(), gindex, memAddress(aadvance)); + } + + // --- [ FT_Get_Renderer ] --- + + @NativeType("FT_Renderer") + public static long FT_Get_Renderer(@NativeType("FT_Library") long library, @NativeType("FT_Glyph_Format") int format) { + long __functionAddress = Functions.Get_Renderer; + if (CHECKS) { + check(library); + } + return invokePP(library, format, __functionAddress); + } + + // --- [ FT_Set_Renderer ] --- + + public static int nFT_Set_Renderer(long library, long renderer, int num_params, long parameters) { + long __functionAddress = Functions.Set_Renderer; + if (CHECKS) { + check(library); + check(renderer); + } + return invokePPPI(library, renderer, num_params, parameters, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Set_Renderer(@NativeType("FT_Library") long library, @NativeType("FT_Renderer") long renderer, @NativeType("FT_Parameter *") FT_Parameter.Buffer parameters) { + return nFT_Set_Renderer(library, renderer, parameters.remaining(), parameters.address()); + } + + // --- [ FT_New_Size ] --- + + public static int nFT_New_Size(long face, long size) { + long __functionAddress = Functions.New_Size; + return invokePPI(face, size, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_New_Size(FT_Face face, @NativeType("FT_Size *") PointerBuffer size) { + if (CHECKS) { + check(size, 1); + } + return nFT_New_Size(face.address(), memAddress(size)); + } + + // --- [ FT_Done_Size ] --- + + public static int nFT_Done_Size(long size) { + long __functionAddress = Functions.Done_Size; + return invokePI(size, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Done_Size(FT_Size size) { + return nFT_Done_Size(size.address()); + } + + // --- [ FT_Activate_Size ] --- + + public static int nFT_Activate_Size(long size) { + long __functionAddress = Functions.Activate_Size; + return invokePI(size, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Activate_Size(FT_Size size) { + return nFT_Activate_Size(size.address()); + } + + // --- [ FT_Get_Sfnt_Name_Count ] --- + + public static int nFT_Get_Sfnt_Name_Count(long face) { + long __functionAddress = Functions.Get_Sfnt_Name_Count; + return invokePI(face, __functionAddress); + } + + @NativeType("FT_UInt") + public static int FT_Get_Sfnt_Name_Count(FT_Face face) { + return nFT_Get_Sfnt_Name_Count(face.address()); + } + + // --- [ FT_Get_Sfnt_Name ] --- + + public static int nFT_Get_Sfnt_Name(long face, int idx, long aname) { + long __functionAddress = Functions.Get_Sfnt_Name; + return invokePPI(face, idx, aname, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_Sfnt_Name(FT_Face face, @NativeType("FT_UInt") int idx, @NativeType("FT_SfntName *") FT_SfntName aname) { + return nFT_Get_Sfnt_Name(face.address(), idx, aname.address()); + } + + // --- [ FT_Get_Sfnt_LangTag ] --- + + public static int nFT_Get_Sfnt_LangTag(long face, int langID, long alangTag) { + long __functionAddress = Functions.Get_Sfnt_LangTag; + return invokePPI(face, langID, alangTag, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_Sfnt_LangTag(FT_Face face, @NativeType("FT_UInt") int langID, @NativeType("FT_SfntLangTag *") FT_SfntLangTag alangTag) { + return nFT_Get_Sfnt_LangTag(face.address(), langID, alangTag.address()); + } + + // --- [ FT_Outline_GetInsideBorder ] --- + + public static int nFT_Outline_GetInsideBorder(long outline) { + long __functionAddress = Functions.Outline_GetInsideBorder; + return invokePI(outline, __functionAddress); + } + + @NativeType("FT_StrokerBorder") + public static int FT_Outline_GetInsideBorder(@NativeType("FT_Outline *") FT_Outline outline) { + return nFT_Outline_GetInsideBorder(outline.address()); + } + + // --- [ FT_Outline_GetOutsideBorder ] --- + + public static int nFT_Outline_GetOutsideBorder(long outline) { + long __functionAddress = Functions.Outline_GetOutsideBorder; + return invokePI(outline, __functionAddress); + } + + @NativeType("FT_StrokerBorder") + public static int FT_Outline_GetOutsideBorder(@NativeType("FT_Outline *") FT_Outline outline) { + return nFT_Outline_GetOutsideBorder(outline.address()); + } + + // --- [ FT_Stroker_New ] --- + + public static int nFT_Stroker_New(long library, long astroker) { + long __functionAddress = Functions.Stroker_New; + if (CHECKS) { + check(library); + } + return invokePPI(library, astroker, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Stroker_New(@NativeType("FT_Library") long library, @NativeType("FT_Stroker *") PointerBuffer astroker) { + if (CHECKS) { + check(astroker, 1); + } + return nFT_Stroker_New(library, memAddress(astroker)); + } + + // --- [ FT_Stroker_Set ] --- + + public static void FT_Stroker_Set(@NativeType("FT_Stroker") long stroker, @NativeType("FT_Fixed") long radius, @NativeType("FT_Stroker_LineCap") int line_cap, @NativeType("FT_Stroker_LineJoin") int line_join, @NativeType("FT_Fixed") long miter_limit) { + long __functionAddress = Functions.Stroker_Set; + if (CHECKS) { + check(stroker); + } + invokePNNV(stroker, radius, line_cap, line_join, miter_limit, __functionAddress); + } + + // --- [ FT_Stroker_Rewind ] --- + + public static void FT_Stroker_Rewind(@NativeType("FT_Stroker") long stroker) { + long __functionAddress = Functions.Stroker_Rewind; + if (CHECKS) { + check(stroker); + } + invokePV(stroker, __functionAddress); + } + + // --- [ FT_Stroker_ParseOutline ] --- + + public static int nFT_Stroker_ParseOutline(long stroker, long outline, boolean opened) { + long __functionAddress = Functions.Stroker_ParseOutline; + if (CHECKS) { + check(stroker); + } + return invokePPI(stroker, outline, opened, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Stroker_ParseOutline(@NativeType("FT_Stroker") long stroker, @NativeType("FT_Outline *") FT_Outline outline, @NativeType("FT_Bool") boolean opened) { + return nFT_Stroker_ParseOutline(stroker, outline.address(), opened); + } + + // --- [ FT_Stroker_BeginSubPath ] --- + + public static int nFT_Stroker_BeginSubPath(long stroker, long to, boolean open) { + long __functionAddress = Functions.Stroker_BeginSubPath; + if (CHECKS) { + check(stroker); + } + return invokePPI(stroker, to, open, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Stroker_BeginSubPath(@NativeType("FT_Stroker") long stroker, @NativeType("FT_Vector *") FT_Vector to, @NativeType("FT_Bool") boolean open) { + return nFT_Stroker_BeginSubPath(stroker, to.address(), open); + } + + // --- [ FT_Stroker_EndSubPath ] --- + + @NativeType("FT_Error") + public static int FT_Stroker_EndSubPath(@NativeType("FT_Stroker") long stroker) { + long __functionAddress = Functions.Stroker_EndSubPath; + if (CHECKS) { + check(stroker); + } + return invokePI(stroker, __functionAddress); + } + + // --- [ FT_Stroker_LineTo ] --- + + public static int nFT_Stroker_LineTo(long stroker, long to) { + long __functionAddress = Functions.Stroker_LineTo; + if (CHECKS) { + check(stroker); + } + return invokePPI(stroker, to, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Stroker_LineTo(@NativeType("FT_Stroker") long stroker, @NativeType("FT_Vector *") FT_Vector to) { + return nFT_Stroker_LineTo(stroker, to.address()); + } + + // --- [ FT_Stroker_ConicTo ] --- + + public static int nFT_Stroker_ConicTo(long stroker, long control, long to) { + long __functionAddress = Functions.Stroker_ConicTo; + if (CHECKS) { + check(stroker); + } + return invokePPPI(stroker, control, to, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Stroker_ConicTo(@NativeType("FT_Stroker") long stroker, @NativeType("FT_Vector *") FT_Vector control, @NativeType("FT_Vector *") FT_Vector to) { + return nFT_Stroker_ConicTo(stroker, control.address(), to.address()); + } + + // --- [ FT_Stroker_CubicTo ] --- + + public static int nFT_Stroker_CubicTo(long stroker, long control1, long control2, long to) { + long __functionAddress = Functions.Stroker_CubicTo; + if (CHECKS) { + check(stroker); + } + return invokePPPPI(stroker, control1, control2, to, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Stroker_CubicTo(@NativeType("FT_Stroker") long stroker, @NativeType("FT_Vector *") FT_Vector control1, @NativeType("FT_Vector *") FT_Vector control2, @NativeType("FT_Vector *") FT_Vector to) { + return nFT_Stroker_CubicTo(stroker, control1.address(), control2.address(), to.address()); + } + + // --- [ FT_Stroker_GetBorderCounts ] --- + + public static int nFT_Stroker_GetBorderCounts(long stroker, int border, long anum_points, long anum_contours) { + long __functionAddress = Functions.Stroker_GetBorderCounts; + if (CHECKS) { + check(stroker); + } + return invokePPPI(stroker, border, anum_points, anum_contours, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Stroker_GetBorderCounts(@NativeType("FT_Stroker") long stroker, @NativeType("FT_StrokerBorder") int border, @NativeType("FT_UInt *") IntBuffer anum_points, @NativeType("FT_UInt *") IntBuffer anum_contours) { + if (CHECKS) { + check(anum_points, 1); + check(anum_contours, 1); + } + return nFT_Stroker_GetBorderCounts(stroker, border, memAddress(anum_points), memAddress(anum_contours)); + } + + // --- [ FT_Stroker_ExportBorder ] --- + + public static void nFT_Stroker_ExportBorder(long stroker, int border, long outline) { + long __functionAddress = Functions.Stroker_ExportBorder; + if (CHECKS) { + check(stroker); + } + invokePPV(stroker, border, outline, __functionAddress); + } + + public static void FT_Stroker_ExportBorder(@NativeType("FT_Stroker") long stroker, @NativeType("FT_StrokerBorder") int border, @NativeType("FT_Outline *") FT_Outline outline) { + nFT_Stroker_ExportBorder(stroker, border, outline.address()); + } + + // --- [ FT_Stroker_GetCounts ] --- + + public static int nFT_Stroker_GetCounts(long stroker, long anum_points, long anum_contours) { + long __functionAddress = Functions.Stroker_GetCounts; + if (CHECKS) { + check(stroker); + } + return invokePPPI(stroker, anum_points, anum_contours, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Stroker_GetCounts(@NativeType("FT_Stroker") long stroker, @NativeType("FT_UInt *") IntBuffer anum_points, @NativeType("FT_UInt *") IntBuffer anum_contours) { + if (CHECKS) { + check(anum_points, 1); + check(anum_contours, 1); + } + return nFT_Stroker_GetCounts(stroker, memAddress(anum_points), memAddress(anum_contours)); + } + + // --- [ FT_Stroker_Export ] --- + + public static void nFT_Stroker_Export(long stroker, long outline) { + long __functionAddress = Functions.Stroker_Export; + if (CHECKS) { + check(stroker); + } + invokePPV(stroker, outline, __functionAddress); + } + + public static void FT_Stroker_Export(@NativeType("FT_Stroker") long stroker, @NativeType("FT_Outline *") FT_Outline outline) { + nFT_Stroker_Export(stroker, outline.address()); + } + + // --- [ FT_Stroker_Done ] --- + + public static void FT_Stroker_Done(@NativeType("FT_Stroker") long stroker) { + long __functionAddress = Functions.Stroker_Done; + if (CHECKS) { + check(stroker); + } + invokePV(stroker, __functionAddress); + } + + // --- [ FT_Glyph_Stroke ] --- + + public static int nFT_Glyph_Stroke(long pglyph, long stroker, boolean destroy) { + long __functionAddress = Functions.Glyph_Stroke; + if (CHECKS) { + check(stroker); + } + return invokePPI(pglyph, stroker, destroy, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Glyph_Stroke(@NativeType("FT_Glyph *") PointerBuffer pglyph, @NativeType("FT_Stroker") long stroker, @NativeType("FT_Bool") boolean destroy) { + if (CHECKS) { + check(pglyph, 1); + } + return nFT_Glyph_Stroke(memAddress(pglyph), stroker, destroy); + } + + // --- [ FT_Glyph_StrokeBorder ] --- + + public static int nFT_Glyph_StrokeBorder(long pglyph, long stroker, boolean inside, boolean destroy) { + long __functionAddress = Functions.Glyph_StrokeBorder; + if (CHECKS) { + check(stroker); + } + return invokePPI(pglyph, stroker, inside, destroy, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Glyph_StrokeBorder(@NativeType("FT_Glyph *") PointerBuffer pglyph, @NativeType("FT_Stroker") long stroker, @NativeType("FT_Bool") boolean inside, @NativeType("FT_Bool") boolean destroy) { + if (CHECKS) { + check(pglyph, 1); + } + return nFT_Glyph_StrokeBorder(memAddress(pglyph), stroker, inside, destroy); + } + + // --- [ FT_GlyphSlot_Embolden ] --- + + public static void nFT_GlyphSlot_Embolden(long slot) { + long __functionAddress = Functions.GlyphSlot_Embolden; + invokePV(slot, __functionAddress); + } + + public static void FT_GlyphSlot_Embolden(FT_GlyphSlot slot) { + nFT_GlyphSlot_Embolden(slot.address()); + } + + // --- [ FT_GlyphSlot_AdjustWeight ] --- + + public static void nFT_GlyphSlot_AdjustWeight(long slot, long xdelta, long ydelta) { + long __functionAddress = Functions.GlyphSlot_AdjustWeight; + invokePNNV(slot, xdelta, ydelta, __functionAddress); + } + + public static void FT_GlyphSlot_AdjustWeight(FT_GlyphSlot slot, @NativeType("FT_Fixed") long xdelta, @NativeType("FT_Fixed") long ydelta) { + nFT_GlyphSlot_AdjustWeight(slot.address(), xdelta, ydelta); + } + + // --- [ FT_GlyphSlot_Oblique ] --- + + public static void nFT_GlyphSlot_Oblique(long slot) { + long __functionAddress = Functions.GlyphSlot_Oblique; + invokePV(slot, __functionAddress); + } + + public static void FT_GlyphSlot_Oblique(FT_GlyphSlot slot) { + nFT_GlyphSlot_Oblique(slot.address()); + } + + // --- [ FT_GlyphSlot_Slant ] --- + + public static void nFT_GlyphSlot_Slant(long slot, long xslant, long yslant) { + long __functionAddress = Functions.GlyphSlot_Slant; + invokePNNV(slot, xslant, yslant, __functionAddress); + } + + public static void FT_GlyphSlot_Slant(FT_GlyphSlot slot, @NativeType("FT_Fixed") long xslant, @NativeType("FT_Fixed") long yslant) { + nFT_GlyphSlot_Slant(slot.address(), xslant, yslant); + } + + // --- [ FT_Sin ] --- + + @NativeType("FT_Fixed") + public static long FT_Sin(@NativeType("FT_Angle") long angle) { + long __functionAddress = Functions.Sin; + return invokeNN(angle, __functionAddress); + } + + // --- [ FT_Cos ] --- + + @NativeType("FT_Fixed") + public static long FT_Cos(@NativeType("FT_Angle") long angle) { + long __functionAddress = Functions.Cos; + return invokeNN(angle, __functionAddress); + } + + // --- [ FT_Tan ] --- + + @NativeType("FT_Fixed") + public static long FT_Tan(@NativeType("FT_Angle") long angle) { + long __functionAddress = Functions.Tan; + return invokeNN(angle, __functionAddress); + } + + // --- [ FT_Atan2 ] --- + + @NativeType("FT_Angle") + public static long FT_Atan2(@NativeType("FT_Fixed") long x, @NativeType("FT_Fixed") long y) { + long __functionAddress = Functions.Atan2; + return invokeNNN(x, y, __functionAddress); + } + + // --- [ FT_Angle_Diff ] --- + + @NativeType("FT_Angle") + public static long FT_Angle_Diff(@NativeType("FT_Angle") long angle1, @NativeType("FT_Angle") long angle2) { + long __functionAddress = Functions.Angle_Diff; + return invokeNNN(angle1, angle2, __functionAddress); + } + + // --- [ FT_Vector_Unit ] --- + + public static void nFT_Vector_Unit(long vec, long angle) { + long __functionAddress = Functions.Vector_Unit; + invokePNV(vec, angle, __functionAddress); + } + + public static void FT_Vector_Unit(@NativeType("FT_Vector *") FT_Vector vec, @NativeType("FT_Angle") long angle) { + nFT_Vector_Unit(vec.address(), angle); + } + + // --- [ FT_Vector_Rotate ] --- + + public static void nFT_Vector_Rotate(long vec, long angle) { + long __functionAddress = Functions.Vector_Rotate; + invokePNV(vec, angle, __functionAddress); + } + + public static void FT_Vector_Rotate(@NativeType("FT_Vector *") FT_Vector vec, @NativeType("FT_Angle") long angle) { + nFT_Vector_Rotate(vec.address(), angle); + } + + // --- [ FT_Vector_Length ] --- + + public static long nFT_Vector_Length(long vec) { + long __functionAddress = Functions.Vector_Length; + return invokePN(vec, __functionAddress); + } + + @NativeType("FT_Fixed") + public static long FT_Vector_Length(@NativeType("FT_Vector *") FT_Vector vec) { + return nFT_Vector_Length(vec.address()); + } + + // --- [ FT_Vector_Polarize ] --- + + public static void nFT_Vector_Polarize(long vec, long length, long angle) { + long __functionAddress = Functions.Vector_Polarize; + invokePPPV(vec, length, angle, __functionAddress); + } + + public static void FT_Vector_Polarize(@NativeType("FT_Vector *") FT_Vector vec, @NativeType("FT_Fixed *") CLongBuffer length, @NativeType("FT_Angle *") CLongBuffer angle) { + if (CHECKS) { + check(length, 1); + check(angle, 1); + } + nFT_Vector_Polarize(vec.address(), memAddress(length), memAddress(angle)); + } + + // --- [ FT_Vector_From_Polar ] --- + + public static void nFT_Vector_From_Polar(long vec, long length, long angle) { + long __functionAddress = Functions.Vector_From_Polar; + invokePNNV(vec, length, angle, __functionAddress); + } + + public static void FT_Vector_From_Polar(@NativeType("FT_Vector *") FT_Vector vec, @NativeType("FT_Fixed") long length, @NativeType("FT_Angle") long angle) { + nFT_Vector_From_Polar(vec.address(), length, angle); + } + + // --- [ FT_Has_PS_Glyph_Names ] --- + + public static int nFT_Has_PS_Glyph_Names(long face) { + long __functionAddress = Functions.Has_PS_Glyph_Names; + return invokePI(face, __functionAddress); + } + + @NativeType("FT_Int") + public static int FT_Has_PS_Glyph_Names(FT_Face face) { + return nFT_Has_PS_Glyph_Names(face.address()); + } + + // --- [ FT_Get_PS_Font_Info ] --- + + public static int nFT_Get_PS_Font_Info(long face, long afont_info) { + long __functionAddress = Functions.Get_PS_Font_Info; + return invokePPI(face, afont_info, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_PS_Font_Info(FT_Face face, PS_FontInfo afont_info) { + return nFT_Get_PS_Font_Info(face.address(), afont_info.address()); + } + + // --- [ FT_Get_PS_Font_Private ] --- + + public static int nFT_Get_PS_Font_Private(long face, long afont_private) { + long __functionAddress = Functions.Get_PS_Font_Private; + if (CHECKS) { + check(afont_private); + } + return invokePPI(face, afont_private, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Get_PS_Font_Private(FT_Face face, @NativeType("PS_Private") long afont_private) { + return nFT_Get_PS_Font_Private(face.address(), afont_private); + } + + // --- [ FT_Get_PS_Font_Value ] --- + + public static long nFT_Get_PS_Font_Value(long face, int key, int idx, long value, long value_len) { + long __functionAddress = Functions.Get_PS_Font_Value; + return invokePPNN(face, key, idx, value, value_len, __functionAddress); + } + + @NativeType("FT_Long") + public static long FT_Get_PS_Font_Value(FT_Face face, @NativeType("PS_Dict_Keys") int key, @NativeType("FT_UInt") int idx, @Nullable @NativeType("void *") ByteBuffer value) { + return nFT_Get_PS_Font_Value(face.address(), key, idx, memAddressSafe(value), remainingSafe(value)); + } + + // --- [ FT_Get_Sfnt_Table ] --- + + public static long nFT_Get_Sfnt_Table(long face, int tag) { + long __functionAddress = Functions.Get_Sfnt_Table; + return invokePP(face, tag, __functionAddress); + } + + @NativeType("void *") + public static long FT_Get_Sfnt_Table(FT_Face face, @NativeType("FT_Sfnt_Tag") int tag) { + return nFT_Get_Sfnt_Table(face.address(), tag); + } + + // --- [ FT_Load_Sfnt_Table ] --- + + public static int nFT_Load_Sfnt_Table(long face, long tag, long offset, long buffer, long length) { + long __functionAddress = Functions.Load_Sfnt_Table; + return invokePNNPPI(face, tag, offset, buffer, length, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Load_Sfnt_Table(FT_Face face, @NativeType("FT_ULong") long tag, @NativeType("FT_Long") long offset, @Nullable @NativeType("FT_Byte *") ByteBuffer buffer, @Nullable @NativeType("FT_ULong *") CLongBuffer length) { + if (CHECKS) { + checkSafe(length, 1); + } + return nFT_Load_Sfnt_Table(face.address(), tag, offset, memAddressSafe(buffer), memAddressSafe(length)); + } + + // --- [ FT_Sfnt_Table_Info ] --- + + public static int nFT_Sfnt_Table_Info(long face, int table_index, long tag, long length) { + long __functionAddress = Functions.Sfnt_Table_Info; + return invokePPPI(face, table_index, tag, length, __functionAddress); + } + + @NativeType("FT_Error") + public static int FT_Sfnt_Table_Info(FT_Face face, @NativeType("FT_UInt") int table_index, @Nullable @NativeType("FT_ULong *") CLongBuffer tag, @Nullable @NativeType("FT_ULong *") CLongBuffer length) { + if (CHECKS) { + checkSafe(length, 1); + } + return nFT_Sfnt_Table_Info(face.address(), table_index, memAddressSafe(tag), memAddressSafe(length)); + } + + // --- [ FT_Get_CMap_Language_ID ] --- + + public static long nFT_Get_CMap_Language_ID(long charmap) { + long __functionAddress = Functions.Get_CMap_Language_ID; + return invokePN(charmap, __functionAddress); + } + + @NativeType("FT_ULong") + public static long FT_Get_CMap_Language_ID(FT_CharMap charmap) { + return nFT_Get_CMap_Language_ID(charmap.address()); + } + + // --- [ FT_Get_CMap_Format ] --- + + public static long nFT_Get_CMap_Format(long charmap) { + long __functionAddress = Functions.Get_CMap_Format; + return invokePN(charmap, __functionAddress); + } + + @NativeType("FT_Long") + public static long FT_Get_CMap_Format(FT_CharMap charmap) { + return nFT_Get_CMap_Format(charmap.address()); + } + + public static int FT_ENC_TAG(int a, int b, int c, int d) { + return ((a & 0xFF) << 24) | ((b & 0xFF) << 16) | ((c & 0xFF) << 8) | (d & 0xFF); + } + + public static boolean FT_HAS_HORIZONTAL(FT_Face face) { + return (face.face_flags() & FT_FACE_FLAG_HORIZONTAL) != 0; + } + + public static boolean FT_HAS_VERTICAL(FT_Face face) { + return (face.face_flags() & FT_FACE_FLAG_VERTICAL) != 0; + } + + public static boolean FT_HAS_KERNING(FT_Face face) { + return (face.face_flags() & FT_FACE_FLAG_KERNING) != 0; + } + + public static boolean FT_IS_SCALABLE(FT_Face face) { + return (face.face_flags() & FT_FACE_FLAG_SCALABLE) != 0; + } + + public static boolean FT_IS_SFNT(FT_Face face) { + return (face.face_flags() & FT_FACE_FLAG_SFNT) != 0; + } + + public static boolean FT_IS_FIXED_WIDTH(FT_Face face) { + return (face.face_flags() & FT_FACE_FLAG_FIXED_WIDTH) != 0; + } + + public static boolean FT_HAS_FIXED_SIZES(FT_Face face) { + return (face.face_flags() & FT_FACE_FLAG_FIXED_SIZES) != 0; + } + + public static boolean FT_HAS_GLYPH_NAMES(FT_Face face) { + return (face.face_flags() & FT_FACE_FLAG_GLYPH_NAMES) != 0; + } + + public static boolean FT_HAS_MULTIPLE_MASTERS(FT_Face face) { + return (face.face_flags() & FT_FACE_FLAG_MULTIPLE_MASTERS) != 0; + } + + public static boolean FT_IS_NAMED_INSTANCE(FT_Face face) { + return (face.face_index() & 0x7FFF0000) != 0; + } + + public static boolean FT_IS_VARIATION(FT_Face face) { + return (face.face_flags() & FT_FACE_FLAG_VARIATION) != 0; + } + + public static boolean FT_IS_CID_KEYED(FT_Face face) { + return (face.face_flags() & FT_FACE_FLAG_CID_KEYED) != 0; + } + + public static boolean FT_IS_TRICKY(FT_Face face) { + return (face.face_flags() & FT_FACE_FLAG_TRICKY) != 0; + } + + public static boolean FT_HAS_COLOR(FT_Face face) { + return (face.face_flags() & FT_FACE_FLAG_COLOR) != 0; + } + + public static boolean FT_HAS_SVG(FT_Face face) { + return (face.face_flags() & FT_FACE_FLAG_SVG) != 0; + } + + public static boolean FT_HAS_SBIX(FT_Face face) { + return (face.face_flags() & FT_FACE_FLAG_SBIX) != 0; + } + + public static boolean FT_HAS_SBIX_OVERLAY(FT_Face face) { + return (face.face_flags() & FT_FACE_FLAG_SBIX_OVERLAY) != 0; + } + + private static int FT_LOAD_TARGET_(int x) { + return (x & 15) << 16; + } + + public static int FT_LOAD_TARGET_MODE(int x) { + return (x >> 16) & 15; + } + + public static boolean FTC_IMAGE_TYPE_COMPARE(FTC_ImageType d1, FTC_ImageType d2) { + return d1.face_id() == d2.face_id() && d1.width() == d2.width() && d1.flags() == d2.flags(); + } + + public static int FT_CURVE_TAG(int flag) { + return flag & 0x03; + } + + public static int FT_IMAGE_TAG(int _x1, int _x2, int _x3, int _x4) { + return ((_x1 & 0xFF) << 24) | ((_x2 & 0xFF) << 16) | ((_x3 & 0xFF) << 8) | (_x4 & 0xFF); + } + + public static int FT_MAKE_TAG(int _x1, int _x2, int _x3, int _x4) { + return ((_x1 & 0xFF) << 24) | ((_x2 & 0xFF) << 16) | ((_x3 & 0xFF) << 8) | (_x4 & 0xFF); + } + + public static boolean FT_IS_EMPTY(FT_List list) { + return list.head() == null; + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/PS_FontInfo.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/PS_FontInfo.java new file mode 100644 index 00000000..b76630e3 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/PS_FontInfo.java @@ -0,0 +1,290 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure used to model a Type~1 or Type~2 FontInfo dictionary. Note that for Multiple Master fonts, each instance has its own FontInfo dictionary. + * + *

Layout

+ * + *

+ * struct PS_FontInfoRec {
+ *     FT_String * version;
+ *     FT_String * notice;
+ *     FT_String * full_name;
+ *     FT_String * family_name;
+ *     FT_String * weight;
+ *     FT_Long italic_angle;
+ *     FT_Bool is_fixed_pitch;
+ *     FT_Short underline_position;
+ *     FT_UShort underline_thickness;
+ * }
+ */ +@NativeType("struct PS_FontInfoRec") +public class PS_FontInfo extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + VERSION, + NOTICE, + FULL_NAME, + FAMILY_NAME, + WEIGHT, + ITALIC_ANGLE, + IS_FIXED_PITCH, + UNDERLINE_POSITION, + UNDERLINE_THICKNESS; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(1), + __member(2), + __member(2) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + VERSION = layout.offsetof(0); + NOTICE = layout.offsetof(1); + FULL_NAME = layout.offsetof(2); + FAMILY_NAME = layout.offsetof(3); + WEIGHT = layout.offsetof(4); + ITALIC_ANGLE = layout.offsetof(5); + IS_FIXED_PITCH = layout.offsetof(6); + UNDERLINE_POSITION = layout.offsetof(7); + UNDERLINE_THICKNESS = layout.offsetof(8); + } + + protected PS_FontInfo(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected PS_FontInfo create(long address, @Nullable ByteBuffer container) { + return new PS_FontInfo(address, container); + } + + /** + * Creates a {@code PS_FontInfo} instance at the current position of the specified {@link 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 PS_FontInfo(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code version} field. */ + @NativeType("FT_String *") + public ByteBuffer version() { return nversion(address()); } + /** @return the null-terminated string pointed to by the {@code version} field. */ + @NativeType("FT_String *") + public String versionString() { return nversionString(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code notice} field. */ + @NativeType("FT_String *") + public ByteBuffer notice() { return nnotice(address()); } + /** @return the null-terminated string pointed to by the {@code notice} field. */ + @NativeType("FT_String *") + public String noticeString() { return nnoticeString(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code full_name} field. */ + @NativeType("FT_String *") + public ByteBuffer full_name() { return nfull_name(address()); } + /** @return the null-terminated string pointed to by the {@code full_name} field. */ + @NativeType("FT_String *") + public String full_nameString() { return nfull_nameString(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code family_name} field. */ + @NativeType("FT_String *") + public ByteBuffer family_name() { return nfamily_name(address()); } + /** @return the null-terminated string pointed to by the {@code family_name} field. */ + @NativeType("FT_String *") + public String family_nameString() { return nfamily_nameString(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code weight} field. */ + @NativeType("FT_String *") + public ByteBuffer weight() { return nweight(address()); } + /** @return the null-terminated string pointed to by the {@code weight} field. */ + @NativeType("FT_String *") + public String weightString() { return nweightString(address()); } + /** @return the value of the {@code italic_angle} field. */ + @NativeType("FT_Long") + public long italic_angle() { return nitalic_angle(address()); } + /** @return the value of the {@code is_fixed_pitch} field. */ + @NativeType("FT_Bool") + public boolean is_fixed_pitch() { return nis_fixed_pitch(address()); } + /** @return the value of the {@code underline_position} field. */ + @NativeType("FT_Short") + public short underline_position() { return nunderline_position(address()); } + /** @return the value of the {@code underline_thickness} field. */ + @NativeType("FT_UShort") + public short underline_thickness() { return nunderline_thickness(address()); } + + // ----------------------------------- + + /** Returns a new {@code PS_FontInfo} instance for the specified memory address. */ + public static PS_FontInfo create(long address) { + return new PS_FontInfo(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static PS_FontInfo createSafe(long address) { + return address == NULL ? null : new PS_FontInfo(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #version}. */ + public static ByteBuffer nversion(long struct) { return memByteBufferNT1(memGetAddress(struct + PS_FontInfo.VERSION)); } + /** Unsafe version of {@link #versionString}. */ + public static String nversionString(long struct) { return memUTF8(memGetAddress(struct + PS_FontInfo.VERSION)); } + /** Unsafe version of {@link #notice}. */ + public static ByteBuffer nnotice(long struct) { return memByteBufferNT1(memGetAddress(struct + PS_FontInfo.NOTICE)); } + /** Unsafe version of {@link #noticeString}. */ + public static String nnoticeString(long struct) { return memUTF8(memGetAddress(struct + PS_FontInfo.NOTICE)); } + /** Unsafe version of {@link #full_name}. */ + public static ByteBuffer nfull_name(long struct) { return memByteBufferNT1(memGetAddress(struct + PS_FontInfo.FULL_NAME)); } + /** Unsafe version of {@link #full_nameString}. */ + public static String nfull_nameString(long struct) { return memUTF8(memGetAddress(struct + PS_FontInfo.FULL_NAME)); } + /** Unsafe version of {@link #family_name}. */ + public static ByteBuffer nfamily_name(long struct) { return memByteBufferNT1(memGetAddress(struct + PS_FontInfo.FAMILY_NAME)); } + /** Unsafe version of {@link #family_nameString}. */ + public static String nfamily_nameString(long struct) { return memUTF8(memGetAddress(struct + PS_FontInfo.FAMILY_NAME)); } + /** Unsafe version of {@link #weight}. */ + public static ByteBuffer nweight(long struct) { return memByteBufferNT1(memGetAddress(struct + PS_FontInfo.WEIGHT)); } + /** Unsafe version of {@link #weightString}. */ + public static String nweightString(long struct) { return memUTF8(memGetAddress(struct + PS_FontInfo.WEIGHT)); } + /** Unsafe version of {@link #italic_angle}. */ + public static long nitalic_angle(long struct) { return memGetCLong(struct + PS_FontInfo.ITALIC_ANGLE); } + /** Unsafe version of {@link #is_fixed_pitch}. */ + public static boolean nis_fixed_pitch(long struct) { return UNSAFE.getByte(null, struct + PS_FontInfo.IS_FIXED_PITCH) != 0; } + /** Unsafe version of {@link #underline_position}. */ + public static short nunderline_position(long struct) { return UNSAFE.getShort(null, struct + PS_FontInfo.UNDERLINE_POSITION); } + /** Unsafe version of {@link #underline_thickness}. */ + public static short nunderline_thickness(long struct) { return UNSAFE.getShort(null, struct + PS_FontInfo.UNDERLINE_THICKNESS); } + + // ----------------------------------- + + /** An array of {@link PS_FontInfo} structs. */ + public static class Buffer extends StructBuffer { + + private static final PS_FontInfo ELEMENT_FACTORY = PS_FontInfo.create(-1L); + + /** + * Creates a new {@code PS_FontInfo.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 {@link PS_FontInfo#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected PS_FontInfo getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code version} field. */ + @NativeType("FT_String *") + public ByteBuffer version() { return PS_FontInfo.nversion(address()); } + /** @return the null-terminated string pointed to by the {@code version} field. */ + @NativeType("FT_String *") + public String versionString() { return PS_FontInfo.nversionString(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code notice} field. */ + @NativeType("FT_String *") + public ByteBuffer notice() { return PS_FontInfo.nnotice(address()); } + /** @return the null-terminated string pointed to by the {@code notice} field. */ + @NativeType("FT_String *") + public String noticeString() { return PS_FontInfo.nnoticeString(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code full_name} field. */ + @NativeType("FT_String *") + public ByteBuffer full_name() { return PS_FontInfo.nfull_name(address()); } + /** @return the null-terminated string pointed to by the {@code full_name} field. */ + @NativeType("FT_String *") + public String full_nameString() { return PS_FontInfo.nfull_nameString(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code family_name} field. */ + @NativeType("FT_String *") + public ByteBuffer family_name() { return PS_FontInfo.nfamily_name(address()); } + /** @return the null-terminated string pointed to by the {@code family_name} field. */ + @NativeType("FT_String *") + public String family_nameString() { return PS_FontInfo.nfamily_nameString(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code weight} field. */ + @NativeType("FT_String *") + public ByteBuffer weight() { return PS_FontInfo.nweight(address()); } + /** @return the null-terminated string pointed to by the {@code weight} field. */ + @NativeType("FT_String *") + public String weightString() { return PS_FontInfo.nweightString(address()); } + /** @return the value of the {@code italic_angle} field. */ + @NativeType("FT_Long") + public long italic_angle() { return PS_FontInfo.nitalic_angle(address()); } + /** @return the value of the {@code is_fixed_pitch} field. */ + @NativeType("FT_Bool") + public boolean is_fixed_pitch() { return PS_FontInfo.nis_fixed_pitch(address()); } + /** @return the value of the {@code underline_position} field. */ + @NativeType("FT_Short") + public short underline_position() { return PS_FontInfo.nunderline_position(address()); } + /** @return the value of the {@code underline_thickness} field. */ + @NativeType("FT_UShort") + public short underline_thickness() { return PS_FontInfo.nunderline_thickness(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/PS_Private.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/PS_Private.java new file mode 100644 index 00000000..b399ba89 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/PS_Private.java @@ -0,0 +1,533 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure used to model a Type~1 or Type~2 private dictionary. Note that for Multiple Master fonts, each instance has its own Private dictionary. + * + *

Layout

+ * + *

+ * struct PS_PrivateRec {
+ *     FT_Int unique_id;
+ *     FT_Int lenIV;
+ *     FT_Byte num_blue_values;
+ *     FT_Byte num_other_blues;
+ *     FT_Byte num_family_blues;
+ *     FT_Byte num_family_other_blues;
+ *     FT_Short blue_values[14];
+ *     FT_Short other_blues[10];
+ *     FT_Short family_blues[14];
+ *     FT_Short family_other_blues[10];
+ *     FT_Fixed blue_scale;
+ *     FT_Int blue_shift;
+ *     FT_Int blue_fuzz;
+ *     FT_UShort standard_width[1];
+ *     FT_UShort standard_height[1];
+ *     FT_Byte num_snap_widths;
+ *     FT_Byte num_snap_heights;
+ *     FT_Bool force_bold;
+ *     FT_Bool round_stem_up;
+ *     FT_Short {@link #snap_widths}[13];
+ *     FT_Short {@link #snap_heights}[13];
+ *     FT_Fixed expansion_factor;
+ *     FT_Long language_group;
+ *     FT_Long password;
+ *     FT_Short min_feature[2];
+ * }
+ */ +@NativeType("struct PS_PrivateRec") +public class PS_Private extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + UNIQUE_ID, + LENIV, + NUM_BLUE_VALUES, + NUM_OTHER_BLUES, + NUM_FAMILY_BLUES, + NUM_FAMILY_OTHER_BLUES, + BLUE_VALUES, + OTHER_BLUES, + FAMILY_BLUES, + FAMILY_OTHER_BLUES, + BLUE_SCALE, + BLUE_SHIFT, + BLUE_FUZZ, + STANDARD_WIDTH, + STANDARD_HEIGHT, + NUM_SNAP_WIDTHS, + NUM_SNAP_HEIGHTS, + FORCE_BOLD, + ROUND_STEM_UP, + SNAP_WIDTHS, + SNAP_HEIGHTS, + EXPANSION_FACTOR, + LANGUAGE_GROUP, + PASSWORD, + MIN_FEATURE; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __member(1), + __member(1), + __member(1), + __member(1), + __array(2, 14), + __array(2, 10), + __array(2, 14), + __array(2, 10), + __member(CLONG_SIZE), + __member(4), + __member(4), + __array(2, 1), + __array(2, 1), + __member(1), + __member(1), + __member(1), + __member(1), + __array(2, 13), + __array(2, 13), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __array(2, 2) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + UNIQUE_ID = layout.offsetof(0); + LENIV = layout.offsetof(1); + NUM_BLUE_VALUES = layout.offsetof(2); + NUM_OTHER_BLUES = layout.offsetof(3); + NUM_FAMILY_BLUES = layout.offsetof(4); + NUM_FAMILY_OTHER_BLUES = layout.offsetof(5); + BLUE_VALUES = layout.offsetof(6); + OTHER_BLUES = layout.offsetof(7); + FAMILY_BLUES = layout.offsetof(8); + FAMILY_OTHER_BLUES = layout.offsetof(9); + BLUE_SCALE = layout.offsetof(10); + BLUE_SHIFT = layout.offsetof(11); + BLUE_FUZZ = layout.offsetof(12); + STANDARD_WIDTH = layout.offsetof(13); + STANDARD_HEIGHT = layout.offsetof(14); + NUM_SNAP_WIDTHS = layout.offsetof(15); + NUM_SNAP_HEIGHTS = layout.offsetof(16); + FORCE_BOLD = layout.offsetof(17); + ROUND_STEM_UP = layout.offsetof(18); + SNAP_WIDTHS = layout.offsetof(19); + SNAP_HEIGHTS = layout.offsetof(20); + EXPANSION_FACTOR = layout.offsetof(21); + LANGUAGE_GROUP = layout.offsetof(22); + PASSWORD = layout.offsetof(23); + MIN_FEATURE = layout.offsetof(24); + } + + protected PS_Private(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected PS_Private create(long address, @Nullable ByteBuffer container) { + return new PS_Private(address, container); + } + + /** + * Creates a {@code PS_Private} instance at the current position of the specified {@link 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 PS_Private(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code unique_id} field. */ + @NativeType("FT_Int") + public int unique_id() { return nunique_id(address()); } + /** @return the value of the {@code lenIV} field. */ + @NativeType("FT_Int") + public int lenIV() { return nlenIV(address()); } + /** @return the value of the {@code num_blue_values} field. */ + @NativeType("FT_Byte") + public byte num_blue_values() { return nnum_blue_values(address()); } + /** @return the value of the {@code num_other_blues} field. */ + @NativeType("FT_Byte") + public byte num_other_blues() { return nnum_other_blues(address()); } + /** @return the value of the {@code num_family_blues} field. */ + @NativeType("FT_Byte") + public byte num_family_blues() { return nnum_family_blues(address()); } + /** @return the value of the {@code num_family_other_blues} field. */ + @NativeType("FT_Byte") + public byte num_family_other_blues() { return nnum_family_other_blues(address()); } + /** @return a {@link ShortBuffer} view of the {@code blue_values} field. */ + @NativeType("FT_Short[14]") + public ShortBuffer blue_values() { return nblue_values(address()); } + /** @return the value at the specified index of the {@code blue_values} field. */ + @NativeType("FT_Short") + public short blue_values(int index) { return nblue_values(address(), index); } + /** @return a {@link ShortBuffer} view of the {@code other_blues} field. */ + @NativeType("FT_Short[10]") + public ShortBuffer other_blues() { return nother_blues(address()); } + /** @return the value at the specified index of the {@code other_blues} field. */ + @NativeType("FT_Short") + public short other_blues(int index) { return nother_blues(address(), index); } + /** @return a {@link ShortBuffer} view of the {@code family_blues} field. */ + @NativeType("FT_Short[14]") + public ShortBuffer family_blues() { return nfamily_blues(address()); } + /** @return the value at the specified index of the {@code family_blues} field. */ + @NativeType("FT_Short") + public short family_blues(int index) { return nfamily_blues(address(), index); } + /** @return a {@link ShortBuffer} view of the {@code family_other_blues} field. */ + @NativeType("FT_Short[10]") + public ShortBuffer family_other_blues() { return nfamily_other_blues(address()); } + /** @return the value at the specified index of the {@code family_other_blues} field. */ + @NativeType("FT_Short") + public short family_other_blues(int index) { return nfamily_other_blues(address(), index); } + /** @return the value of the {@code blue_scale} field. */ + @NativeType("FT_Fixed") + public long blue_scale() { return nblue_scale(address()); } + /** @return the value of the {@code blue_shift} field. */ + @NativeType("FT_Int") + public int blue_shift() { return nblue_shift(address()); } + /** @return the value of the {@code blue_fuzz} field. */ + @NativeType("FT_Int") + public int blue_fuzz() { return nblue_fuzz(address()); } + /** @return a {@link ShortBuffer} view of the {@code standard_width} field. */ + @NativeType("FT_UShort[1]") + public ShortBuffer standard_width() { return nstandard_width(address()); } + /** @return the value at the specified index of the {@code standard_width} field. */ + @NativeType("FT_UShort") + public short standard_width(int index) { return nstandard_width(address(), index); } + /** @return a {@link ShortBuffer} view of the {@code standard_height} field. */ + @NativeType("FT_UShort[1]") + public ShortBuffer standard_height() { return nstandard_height(address()); } + /** @return the value at the specified index of the {@code standard_height} field. */ + @NativeType("FT_UShort") + public short standard_height(int index) { return nstandard_height(address(), index); } + /** @return the value of the {@code num_snap_widths} field. */ + @NativeType("FT_Byte") + public byte num_snap_widths() { return nnum_snap_widths(address()); } + /** @return the value of the {@code num_snap_heights} field. */ + @NativeType("FT_Byte") + public byte num_snap_heights() { return nnum_snap_heights(address()); } + /** @return the value of the {@code force_bold} field. */ + @NativeType("FT_Bool") + public boolean force_bold() { return nforce_bold(address()); } + /** @return the value of the {@code round_stem_up} field. */ + @NativeType("FT_Bool") + public boolean round_stem_up() { return nround_stem_up(address()); } + /** including std width */ + @NativeType("FT_Short[13]") + public ShortBuffer snap_widths() { return nsnap_widths(address()); } + /** including std width */ + @NativeType("FT_Short") + public short snap_widths(int index) { return nsnap_widths(address(), index); } + /** including std height */ + @NativeType("FT_Short[13]") + public ShortBuffer snap_heights() { return nsnap_heights(address()); } + /** including std height */ + @NativeType("FT_Short") + public short snap_heights(int index) { return nsnap_heights(address(), index); } + /** @return the value of the {@code expansion_factor} field. */ + @NativeType("FT_Fixed") + public long expansion_factor() { return nexpansion_factor(address()); } + /** @return the value of the {@code language_group} field. */ + @NativeType("FT_Long") + public long language_group() { return nlanguage_group(address()); } + /** @return the value of the {@code password} field. */ + @NativeType("FT_Long") + public long password() { return npassword(address()); } + /** @return a {@link ShortBuffer} view of the {@code min_feature} field. */ + @NativeType("FT_Short[2]") + public ShortBuffer min_feature() { return nmin_feature(address()); } + /** @return the value at the specified index of the {@code min_feature} field. */ + @NativeType("FT_Short") + public short min_feature(int index) { return nmin_feature(address(), index); } + + // ----------------------------------- + + /** Returns a new {@code PS_Private} instance for the specified memory address. */ + public static PS_Private create(long address) { + return new PS_Private(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static PS_Private createSafe(long address) { + return address == NULL ? null : new PS_Private(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #unique_id}. */ + public static int nunique_id(long struct) { return UNSAFE.getInt(null, struct + PS_Private.UNIQUE_ID); } + /** Unsafe version of {@link #lenIV}. */ + public static int nlenIV(long struct) { return UNSAFE.getInt(null, struct + PS_Private.LENIV); } + /** Unsafe version of {@link #num_blue_values}. */ + public static byte nnum_blue_values(long struct) { return UNSAFE.getByte(null, struct + PS_Private.NUM_BLUE_VALUES); } + /** Unsafe version of {@link #num_other_blues}. */ + public static byte nnum_other_blues(long struct) { return UNSAFE.getByte(null, struct + PS_Private.NUM_OTHER_BLUES); } + /** Unsafe version of {@link #num_family_blues}. */ + public static byte nnum_family_blues(long struct) { return UNSAFE.getByte(null, struct + PS_Private.NUM_FAMILY_BLUES); } + /** Unsafe version of {@link #num_family_other_blues}. */ + public static byte nnum_family_other_blues(long struct) { return UNSAFE.getByte(null, struct + PS_Private.NUM_FAMILY_OTHER_BLUES); } + /** Unsafe version of {@link #blue_values}. */ + public static ShortBuffer nblue_values(long struct) { return memShortBuffer(struct + PS_Private.BLUE_VALUES, 14); } + /** Unsafe version of {@link #blue_values(int) blue_values}. */ + public static short nblue_values(long struct, int index) { + return UNSAFE.getShort(null, struct + PS_Private.BLUE_VALUES + check(index, 14) * 2); + } + /** Unsafe version of {@link #other_blues}. */ + public static ShortBuffer nother_blues(long struct) { return memShortBuffer(struct + PS_Private.OTHER_BLUES, 10); } + /** Unsafe version of {@link #other_blues(int) other_blues}. */ + public static short nother_blues(long struct, int index) { + return UNSAFE.getShort(null, struct + PS_Private.OTHER_BLUES + check(index, 10) * 2); + } + /** Unsafe version of {@link #family_blues}. */ + public static ShortBuffer nfamily_blues(long struct) { return memShortBuffer(struct + PS_Private.FAMILY_BLUES, 14); } + /** Unsafe version of {@link #family_blues(int) family_blues}. */ + public static short nfamily_blues(long struct, int index) { + return UNSAFE.getShort(null, struct + PS_Private.FAMILY_BLUES + check(index, 14) * 2); + } + /** Unsafe version of {@link #family_other_blues}. */ + public static ShortBuffer nfamily_other_blues(long struct) { return memShortBuffer(struct + PS_Private.FAMILY_OTHER_BLUES, 10); } + /** Unsafe version of {@link #family_other_blues(int) family_other_blues}. */ + public static short nfamily_other_blues(long struct, int index) { + return UNSAFE.getShort(null, struct + PS_Private.FAMILY_OTHER_BLUES + check(index, 10) * 2); + } + /** Unsafe version of {@link #blue_scale}. */ + public static long nblue_scale(long struct) { return memGetCLong(struct + PS_Private.BLUE_SCALE); } + /** Unsafe version of {@link #blue_shift}. */ + public static int nblue_shift(long struct) { return UNSAFE.getInt(null, struct + PS_Private.BLUE_SHIFT); } + /** Unsafe version of {@link #blue_fuzz}. */ + public static int nblue_fuzz(long struct) { return UNSAFE.getInt(null, struct + PS_Private.BLUE_FUZZ); } + /** Unsafe version of {@link #standard_width}. */ + public static ShortBuffer nstandard_width(long struct) { return memShortBuffer(struct + PS_Private.STANDARD_WIDTH, 1); } + /** Unsafe version of {@link #standard_width(int) standard_width}. */ + public static short nstandard_width(long struct, int index) { + return UNSAFE.getShort(null, struct + PS_Private.STANDARD_WIDTH + check(index, 1) * 2); + } + /** Unsafe version of {@link #standard_height}. */ + public static ShortBuffer nstandard_height(long struct) { return memShortBuffer(struct + PS_Private.STANDARD_HEIGHT, 1); } + /** Unsafe version of {@link #standard_height(int) standard_height}. */ + public static short nstandard_height(long struct, int index) { + return UNSAFE.getShort(null, struct + PS_Private.STANDARD_HEIGHT + check(index, 1) * 2); + } + /** Unsafe version of {@link #num_snap_widths}. */ + public static byte nnum_snap_widths(long struct) { return UNSAFE.getByte(null, struct + PS_Private.NUM_SNAP_WIDTHS); } + /** Unsafe version of {@link #num_snap_heights}. */ + public static byte nnum_snap_heights(long struct) { return UNSAFE.getByte(null, struct + PS_Private.NUM_SNAP_HEIGHTS); } + /** Unsafe version of {@link #force_bold}. */ + public static boolean nforce_bold(long struct) { return UNSAFE.getByte(null, struct + PS_Private.FORCE_BOLD) != 0; } + /** Unsafe version of {@link #round_stem_up}. */ + public static boolean nround_stem_up(long struct) { return UNSAFE.getByte(null, struct + PS_Private.ROUND_STEM_UP) != 0; } + /** Unsafe version of {@link #snap_widths}. */ + public static ShortBuffer nsnap_widths(long struct) { return memShortBuffer(struct + PS_Private.SNAP_WIDTHS, 13); } + /** Unsafe version of {@link #snap_widths(int) snap_widths}. */ + public static short nsnap_widths(long struct, int index) { + return UNSAFE.getShort(null, struct + PS_Private.SNAP_WIDTHS + check(index, 13) * 2); + } + /** Unsafe version of {@link #snap_heights}. */ + public static ShortBuffer nsnap_heights(long struct) { return memShortBuffer(struct + PS_Private.SNAP_HEIGHTS, 13); } + /** Unsafe version of {@link #snap_heights(int) snap_heights}. */ + public static short nsnap_heights(long struct, int index) { + return UNSAFE.getShort(null, struct + PS_Private.SNAP_HEIGHTS + check(index, 13) * 2); + } + /** Unsafe version of {@link #expansion_factor}. */ + public static long nexpansion_factor(long struct) { return memGetCLong(struct + PS_Private.EXPANSION_FACTOR); } + /** Unsafe version of {@link #language_group}. */ + public static long nlanguage_group(long struct) { return memGetCLong(struct + PS_Private.LANGUAGE_GROUP); } + /** Unsafe version of {@link #password}. */ + public static long npassword(long struct) { return memGetCLong(struct + PS_Private.PASSWORD); } + /** Unsafe version of {@link #min_feature}. */ + public static ShortBuffer nmin_feature(long struct) { return memShortBuffer(struct + PS_Private.MIN_FEATURE, 2); } + /** Unsafe version of {@link #min_feature(int) min_feature}. */ + public static short nmin_feature(long struct, int index) { + return UNSAFE.getShort(null, struct + PS_Private.MIN_FEATURE + check(index, 2) * 2); + } + + // ----------------------------------- + + /** An array of {@link PS_Private} structs. */ + public static class Buffer extends StructBuffer { + + private static final PS_Private ELEMENT_FACTORY = PS_Private.create(-1L); + + /** + * Creates a new {@code PS_Private.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 {@link PS_Private#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected PS_Private getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code unique_id} field. */ + @NativeType("FT_Int") + public int unique_id() { return PS_Private.nunique_id(address()); } + /** @return the value of the {@code lenIV} field. */ + @NativeType("FT_Int") + public int lenIV() { return PS_Private.nlenIV(address()); } + /** @return the value of the {@code num_blue_values} field. */ + @NativeType("FT_Byte") + public byte num_blue_values() { return PS_Private.nnum_blue_values(address()); } + /** @return the value of the {@code num_other_blues} field. */ + @NativeType("FT_Byte") + public byte num_other_blues() { return PS_Private.nnum_other_blues(address()); } + /** @return the value of the {@code num_family_blues} field. */ + @NativeType("FT_Byte") + public byte num_family_blues() { return PS_Private.nnum_family_blues(address()); } + /** @return the value of the {@code num_family_other_blues} field. */ + @NativeType("FT_Byte") + public byte num_family_other_blues() { return PS_Private.nnum_family_other_blues(address()); } + /** @return a {@link ShortBuffer} view of the {@code blue_values} field. */ + @NativeType("FT_Short[14]") + public ShortBuffer blue_values() { return PS_Private.nblue_values(address()); } + /** @return the value at the specified index of the {@code blue_values} field. */ + @NativeType("FT_Short") + public short blue_values(int index) { return PS_Private.nblue_values(address(), index); } + /** @return a {@link ShortBuffer} view of the {@code other_blues} field. */ + @NativeType("FT_Short[10]") + public ShortBuffer other_blues() { return PS_Private.nother_blues(address()); } + /** @return the value at the specified index of the {@code other_blues} field. */ + @NativeType("FT_Short") + public short other_blues(int index) { return PS_Private.nother_blues(address(), index); } + /** @return a {@link ShortBuffer} view of the {@code family_blues} field. */ + @NativeType("FT_Short[14]") + public ShortBuffer family_blues() { return PS_Private.nfamily_blues(address()); } + /** @return the value at the specified index of the {@code family_blues} field. */ + @NativeType("FT_Short") + public short family_blues(int index) { return PS_Private.nfamily_blues(address(), index); } + /** @return a {@link ShortBuffer} view of the {@code family_other_blues} field. */ + @NativeType("FT_Short[10]") + public ShortBuffer family_other_blues() { return PS_Private.nfamily_other_blues(address()); } + /** @return the value at the specified index of the {@code family_other_blues} field. */ + @NativeType("FT_Short") + public short family_other_blues(int index) { return PS_Private.nfamily_other_blues(address(), index); } + /** @return the value of the {@code blue_scale} field. */ + @NativeType("FT_Fixed") + public long blue_scale() { return PS_Private.nblue_scale(address()); } + /** @return the value of the {@code blue_shift} field. */ + @NativeType("FT_Int") + public int blue_shift() { return PS_Private.nblue_shift(address()); } + /** @return the value of the {@code blue_fuzz} field. */ + @NativeType("FT_Int") + public int blue_fuzz() { return PS_Private.nblue_fuzz(address()); } + /** @return a {@link ShortBuffer} view of the {@code standard_width} field. */ + @NativeType("FT_UShort[1]") + public ShortBuffer standard_width() { return PS_Private.nstandard_width(address()); } + /** @return the value at the specified index of the {@code standard_width} field. */ + @NativeType("FT_UShort") + public short standard_width(int index) { return PS_Private.nstandard_width(address(), index); } + /** @return a {@link ShortBuffer} view of the {@code standard_height} field. */ + @NativeType("FT_UShort[1]") + public ShortBuffer standard_height() { return PS_Private.nstandard_height(address()); } + /** @return the value at the specified index of the {@code standard_height} field. */ + @NativeType("FT_UShort") + public short standard_height(int index) { return PS_Private.nstandard_height(address(), index); } + /** @return the value of the {@code num_snap_widths} field. */ + @NativeType("FT_Byte") + public byte num_snap_widths() { return PS_Private.nnum_snap_widths(address()); } + /** @return the value of the {@code num_snap_heights} field. */ + @NativeType("FT_Byte") + public byte num_snap_heights() { return PS_Private.nnum_snap_heights(address()); } + /** @return the value of the {@code force_bold} field. */ + @NativeType("FT_Bool") + public boolean force_bold() { return PS_Private.nforce_bold(address()); } + /** @return the value of the {@code round_stem_up} field. */ + @NativeType("FT_Bool") + public boolean round_stem_up() { return PS_Private.nround_stem_up(address()); } + /** @return a {@link ShortBuffer} view of the {@link PS_Private#snap_widths} field. */ + @NativeType("FT_Short[13]") + public ShortBuffer snap_widths() { return PS_Private.nsnap_widths(address()); } + /** @return the value at the specified index of the {@link PS_Private#snap_widths} field. */ + @NativeType("FT_Short") + public short snap_widths(int index) { return PS_Private.nsnap_widths(address(), index); } + /** @return a {@link ShortBuffer} view of the {@link PS_Private#snap_heights} field. */ + @NativeType("FT_Short[13]") + public ShortBuffer snap_heights() { return PS_Private.nsnap_heights(address()); } + /** @return the value at the specified index of the {@link PS_Private#snap_heights} field. */ + @NativeType("FT_Short") + public short snap_heights(int index) { return PS_Private.nsnap_heights(address(), index); } + /** @return the value of the {@code expansion_factor} field. */ + @NativeType("FT_Fixed") + public long expansion_factor() { return PS_Private.nexpansion_factor(address()); } + /** @return the value of the {@code language_group} field. */ + @NativeType("FT_Long") + public long language_group() { return PS_Private.nlanguage_group(address()); } + /** @return the value of the {@code password} field. */ + @NativeType("FT_Long") + public long password() { return PS_Private.npassword(address()); } + /** @return a {@link ShortBuffer} view of the {@code min_feature} field. */ + @NativeType("FT_Short[2]") + public ShortBuffer min_feature() { return PS_Private.nmin_feature(address()); } + /** @return the value at the specified index of the {@code min_feature} field. */ + @NativeType("FT_Short") + public short min_feature(int index) { return PS_Private.nmin_feature(address(), index); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Free_Func.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Free_Func.java new file mode 100644 index 00000000..b94c78aa --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Free_Func.java @@ -0,0 +1,73 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     FT_Pointer *data_pointer
+ * )
+ */ +public abstract class SVG_Lib_Free_Func extends Callback implements SVG_Lib_Free_FuncI { + + /** + * Creates a {@code SVG_Lib_Free_Func} instance from the specified function pointer. + * + * @return the new {@code SVG_Lib_Free_Func} + */ + public static SVG_Lib_Free_Func create(long functionPointer) { + SVG_Lib_Free_FuncI instance = Callback.get(functionPointer); + return instance instanceof SVG_Lib_Free_Func + ? (SVG_Lib_Free_Func)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static SVG_Lib_Free_Func createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code SVG_Lib_Free_Func} instance that delegates to the specified {@code SVG_Lib_Free_FuncI} instance. */ + public static SVG_Lib_Free_Func create(SVG_Lib_Free_FuncI instance) { + return instance instanceof SVG_Lib_Free_Func + ? (SVG_Lib_Free_Func)instance + : new Container(instance.address(), instance); + } + + protected SVG_Lib_Free_Func() { + super(CIF); + } + + SVG_Lib_Free_Func(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends SVG_Lib_Free_Func { + + private final SVG_Lib_Free_FuncI delegate; + + Container(long functionPointer, SVG_Lib_Free_FuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long data_pointer) { + delegate.invoke(data_pointer); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Free_FuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Free_FuncI.java new file mode 100644 index 00000000..5af5b89c --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Free_FuncI.java @@ -0,0 +1,46 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     FT_Pointer *data_pointer
+ * )
+ */ +@FunctionalInterface +@NativeType("SVG_Lib_Free_Func") +public interface SVG_Lib_Free_FuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_void, + ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + invoke( + memGetAddress(memGetAddress(args)) + ); + } + + /** A callback that is called when the {@code ot-svg} module is being freed. */ + void invoke(@NativeType("FT_Pointer *") long data_pointer); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Init_Func.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Init_Func.java new file mode 100644 index 00000000..8a040daa --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Init_Func.java @@ -0,0 +1,73 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * FT_Error (*{@link #invoke}) (
+ *     FT_Pointer *data_pointer
+ * )
+ */ +public abstract class SVG_Lib_Init_Func extends Callback implements SVG_Lib_Init_FuncI { + + /** + * Creates a {@code SVG_Lib_Init_Func} instance from the specified function pointer. + * + * @return the new {@code SVG_Lib_Init_Func} + */ + public static SVG_Lib_Init_Func create(long functionPointer) { + SVG_Lib_Init_FuncI instance = Callback.get(functionPointer); + return instance instanceof SVG_Lib_Init_Func + ? (SVG_Lib_Init_Func)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static SVG_Lib_Init_Func createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code SVG_Lib_Init_Func} instance that delegates to the specified {@code SVG_Lib_Init_FuncI} instance. */ + public static SVG_Lib_Init_Func create(SVG_Lib_Init_FuncI instance) { + return instance instanceof SVG_Lib_Init_Func + ? (SVG_Lib_Init_Func)instance + : new Container(instance.address(), instance); + } + + protected SVG_Lib_Init_Func() { + super(CIF); + } + + SVG_Lib_Init_Func(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends SVG_Lib_Init_Func { + + private final SVG_Lib_Init_FuncI delegate; + + Container(long functionPointer, SVG_Lib_Init_FuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public int invoke(long data_pointer) { + return delegate.invoke(data_pointer); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Init_FuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Init_FuncI.java new file mode 100644 index 00000000..78171175 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Init_FuncI.java @@ -0,0 +1,47 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * FT_Error (*{@link #invoke}) (
+ *     FT_Pointer *data_pointer
+ * )
+ */ +@FunctionalInterface +@NativeType("SVG_Lib_Init_Func") +public interface SVG_Lib_Init_FuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_sint32, + ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + int __result = invoke( + memGetAddress(memGetAddress(args)) + ); + apiClosureRet(ret, __result); + } + + /** A callback that is called when the first OT-SVG glyph is rendered in the lifetime of an {@code FT_Library} object. */ + @NativeType("FT_Error") int invoke(@NativeType("FT_Pointer *") long data_pointer); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Preset_Slot_Func.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Preset_Slot_Func.java new file mode 100644 index 00000000..fff90782 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Preset_Slot_Func.java @@ -0,0 +1,75 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * FT_Error (*{@link #invoke}) (
+ *     FT_GlyphSlot slot,
+ *     FT_Bool cache,
+ *     FT_Pointer *state
+ * )
+ */ +public abstract class SVG_Lib_Preset_Slot_Func extends Callback implements SVG_Lib_Preset_Slot_FuncI { + + /** + * Creates a {@code SVG_Lib_Preset_Slot_Func} instance from the specified function pointer. + * + * @return the new {@code SVG_Lib_Preset_Slot_Func} + */ + public static SVG_Lib_Preset_Slot_Func create(long functionPointer) { + SVG_Lib_Preset_Slot_FuncI instance = Callback.get(functionPointer); + return instance instanceof SVG_Lib_Preset_Slot_Func + ? (SVG_Lib_Preset_Slot_Func)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static SVG_Lib_Preset_Slot_Func createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code SVG_Lib_Preset_Slot_Func} instance that delegates to the specified {@code SVG_Lib_Preset_Slot_FuncI} instance. */ + public static SVG_Lib_Preset_Slot_Func create(SVG_Lib_Preset_Slot_FuncI instance) { + return instance instanceof SVG_Lib_Preset_Slot_Func + ? (SVG_Lib_Preset_Slot_Func)instance + : new Container(instance.address(), instance); + } + + protected SVG_Lib_Preset_Slot_Func() { + super(CIF); + } + + SVG_Lib_Preset_Slot_Func(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends SVG_Lib_Preset_Slot_Func { + + private final SVG_Lib_Preset_Slot_FuncI delegate; + + Container(long functionPointer, SVG_Lib_Preset_Slot_FuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public int invoke(long slot, boolean cache, long state) { + return delegate.invoke(slot, cache, state); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Preset_Slot_FuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Preset_Slot_FuncI.java new file mode 100644 index 00000000..2a49a415 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Preset_Slot_FuncI.java @@ -0,0 +1,51 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * FT_Error (*{@link #invoke}) (
+ *     FT_GlyphSlot slot,
+ *     FT_Bool cache,
+ *     FT_Pointer *state
+ * )
+ */ +@FunctionalInterface +@NativeType("SVG_Lib_Preset_Slot_Func") +public interface SVG_Lib_Preset_Slot_FuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_sint32, + ffi_type_pointer, ffi_type_uint8, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + int __result = invoke( + memGetAddress(memGetAddress(args)), + memGetByte(memGetAddress(args + POINTER_SIZE)) != 0, + memGetAddress(memGetAddress(args + 2 * POINTER_SIZE)) + ); + apiClosureRet(ret, __result); + } + + /** A callback that is called to preset the glyph slot. */ + @NativeType("FT_Error") int invoke(@NativeType("FT_GlyphSlot") long slot, @NativeType("FT_Bool") boolean cache, @NativeType("FT_Pointer *") long state); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Render_Func.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Render_Func.java new file mode 100644 index 00000000..88c7553c --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Render_Func.java @@ -0,0 +1,74 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * FT_Error (*{@link #invoke}) (
+ *     FT_GlyphSlot slot,
+ *     FT_Pointer *data_pointer
+ * )
+ */ +public abstract class SVG_Lib_Render_Func extends Callback implements SVG_Lib_Render_FuncI { + + /** + * Creates a {@code SVG_Lib_Render_Func} instance from the specified function pointer. + * + * @return the new {@code SVG_Lib_Render_Func} + */ + public static SVG_Lib_Render_Func create(long functionPointer) { + SVG_Lib_Render_FuncI instance = Callback.get(functionPointer); + return instance instanceof SVG_Lib_Render_Func + ? (SVG_Lib_Render_Func)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static SVG_Lib_Render_Func createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code SVG_Lib_Render_Func} instance that delegates to the specified {@code SVG_Lib_Render_FuncI} instance. */ + public static SVG_Lib_Render_Func create(SVG_Lib_Render_FuncI instance) { + return instance instanceof SVG_Lib_Render_Func + ? (SVG_Lib_Render_Func)instance + : new Container(instance.address(), instance); + } + + protected SVG_Lib_Render_Func() { + super(CIF); + } + + SVG_Lib_Render_Func(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends SVG_Lib_Render_Func { + + private final SVG_Lib_Render_FuncI delegate; + + Container(long functionPointer, SVG_Lib_Render_FuncI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public int invoke(long slot, long data_pointer) { + return delegate.invoke(slot, data_pointer); + } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Render_FuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Render_FuncI.java new file mode 100644 index 00000000..5496cb21 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Render_FuncI.java @@ -0,0 +1,49 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * FT_Error (*{@link #invoke}) (
+ *     FT_GlyphSlot slot,
+ *     FT_Pointer *data_pointer
+ * )
+ */ +@FunctionalInterface +@NativeType("SVG_Lib_Render_Func") +public interface SVG_Lib_Render_FuncI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_sint32, + ffi_type_pointer, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + int __result = invoke( + memGetAddress(memGetAddress(args)), + memGetAddress(memGetAddress(args + POINTER_SIZE)) + ); + apiClosureRet(ret, __result); + } + + /** A callback that is called to render an OT-SVG glyph. */ + @NativeType("FT_Error") int invoke(@NativeType("FT_GlyphSlot") long slot, @NativeType("FT_Pointer *") long data_pointer); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_RendererHooks.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_RendererHooks.java new file mode 100644 index 00000000..57109058 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_RendererHooks.java @@ -0,0 +1,332 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A structure that stores the four hooks needed to render OT-SVG glyphs properly. + * + *

Layout

+ * + *

+ * struct SVG_RendererHooks {
+ *     {@link SVG_Lib_Init_FuncI SVG_Lib_Init_Func} init_svg;
+ *     {@link SVG_Lib_Free_FuncI SVG_Lib_Free_Func} free_svg;
+ *     {@link SVG_Lib_Render_FuncI SVG_Lib_Render_Func} render_svg;
+ *     {@link SVG_Lib_Preset_Slot_FuncI SVG_Lib_Preset_Slot_Func} preset_slot;
+ * }
+ */ +public class SVG_RendererHooks extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + INIT_SVG, + FREE_SVG, + RENDER_SVG, + PRESET_SLOT; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + INIT_SVG = layout.offsetof(0); + FREE_SVG = layout.offsetof(1); + RENDER_SVG = layout.offsetof(2); + PRESET_SLOT = layout.offsetof(3); + } + + protected SVG_RendererHooks(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected SVG_RendererHooks create(long address, @Nullable ByteBuffer container) { + return new SVG_RendererHooks(address, container); + } + + /** + * Creates a {@code SVG_RendererHooks} instance at the current position of the specified {@link 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 SVG_RendererHooks(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code init_svg} field. */ + public SVG_Lib_Init_Func init_svg() { return ninit_svg(address()); } + /** @return the value of the {@code free_svg} field. */ + public SVG_Lib_Free_Func free_svg() { return nfree_svg(address()); } + /** @return the value of the {@code render_svg} field. */ + public SVG_Lib_Render_Func render_svg() { return nrender_svg(address()); } + /** @return the value of the {@code preset_slot} field. */ + public SVG_Lib_Preset_Slot_Func preset_slot() { return npreset_slot(address()); } + + /** Sets the specified value to the {@code init_svg} field. */ + public SVG_RendererHooks init_svg(@NativeType("SVG_Lib_Init_Func") SVG_Lib_Init_FuncI value) { ninit_svg(address(), value); return this; } + /** Sets the specified value to the {@code free_svg} field. */ + public SVG_RendererHooks free_svg(@NativeType("SVG_Lib_Free_Func") SVG_Lib_Free_FuncI value) { nfree_svg(address(), value); return this; } + /** Sets the specified value to the {@code render_svg} field. */ + public SVG_RendererHooks render_svg(@NativeType("SVG_Lib_Render_Func") SVG_Lib_Render_FuncI value) { nrender_svg(address(), value); return this; } + /** Sets the specified value to the {@code preset_slot} field. */ + public SVG_RendererHooks preset_slot(@NativeType("SVG_Lib_Preset_Slot_Func") SVG_Lib_Preset_Slot_FuncI value) { npreset_slot(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public SVG_RendererHooks set( + SVG_Lib_Init_FuncI init_svg, + SVG_Lib_Free_FuncI free_svg, + SVG_Lib_Render_FuncI render_svg, + SVG_Lib_Preset_Slot_FuncI preset_slot + ) { + init_svg(init_svg); + free_svg(free_svg); + render_svg(render_svg); + preset_slot(preset_slot); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public SVG_RendererHooks set(SVG_RendererHooks src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code SVG_RendererHooks} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static SVG_RendererHooks malloc() { + return new SVG_RendererHooks(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code SVG_RendererHooks} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static SVG_RendererHooks calloc() { + return new SVG_RendererHooks(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code SVG_RendererHooks} instance allocated with {@link BufferUtils}. */ + public static SVG_RendererHooks create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new SVG_RendererHooks(memAddress(container), container); + } + + /** Returns a new {@code SVG_RendererHooks} instance for the specified memory address. */ + public static SVG_RendererHooks create(long address) { + return new SVG_RendererHooks(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static SVG_RendererHooks createSafe(long address) { + return address == NULL ? null : new SVG_RendererHooks(address, null); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return new Buffer(memAddress(container), container, -1, 0, capacity, capacity); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + /** + * Returns a new {@code SVG_RendererHooks} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static SVG_RendererHooks malloc(MemoryStack stack) { + return new SVG_RendererHooks(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code SVG_RendererHooks} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static SVG_RendererHooks calloc(MemoryStack stack) { + return new SVG_RendererHooks(stack.ncalloc(ALIGNOF, 1, SIZEOF), null); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #init_svg}. */ + public static SVG_Lib_Init_Func ninit_svg(long struct) { return SVG_Lib_Init_Func.create(memGetAddress(struct + SVG_RendererHooks.INIT_SVG)); } + /** Unsafe version of {@link #free_svg}. */ + public static SVG_Lib_Free_Func nfree_svg(long struct) { return SVG_Lib_Free_Func.create(memGetAddress(struct + SVG_RendererHooks.FREE_SVG)); } + /** Unsafe version of {@link #render_svg}. */ + public static SVG_Lib_Render_Func nrender_svg(long struct) { return SVG_Lib_Render_Func.create(memGetAddress(struct + SVG_RendererHooks.RENDER_SVG)); } + /** Unsafe version of {@link #preset_slot}. */ + public static SVG_Lib_Preset_Slot_Func npreset_slot(long struct) { return SVG_Lib_Preset_Slot_Func.create(memGetAddress(struct + SVG_RendererHooks.PRESET_SLOT)); } + + /** Unsafe version of {@link #init_svg(SVG_Lib_Init_FuncI) init_svg}. */ + public static void ninit_svg(long struct, SVG_Lib_Init_FuncI value) { memPutAddress(struct + SVG_RendererHooks.INIT_SVG, value.address()); } + /** Unsafe version of {@link #free_svg(SVG_Lib_Free_FuncI) free_svg}. */ + public static void nfree_svg(long struct, SVG_Lib_Free_FuncI value) { memPutAddress(struct + SVG_RendererHooks.FREE_SVG, value.address()); } + /** Unsafe version of {@link #render_svg(SVG_Lib_Render_FuncI) render_svg}. */ + public static void nrender_svg(long struct, SVG_Lib_Render_FuncI value) { memPutAddress(struct + SVG_RendererHooks.RENDER_SVG, value.address()); } + /** Unsafe version of {@link #preset_slot(SVG_Lib_Preset_Slot_FuncI) preset_slot}. */ + public static void npreset_slot(long struct, SVG_Lib_Preset_Slot_FuncI value) { memPutAddress(struct + SVG_RendererHooks.PRESET_SLOT, value.address()); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + SVG_RendererHooks.INIT_SVG)); + check(memGetAddress(struct + SVG_RendererHooks.FREE_SVG)); + check(memGetAddress(struct + SVG_RendererHooks.RENDER_SVG)); + check(memGetAddress(struct + SVG_RendererHooks.PRESET_SLOT)); + } + + // ----------------------------------- + + /** An array of {@link SVG_RendererHooks} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final SVG_RendererHooks ELEMENT_FACTORY = SVG_RendererHooks.create(-1L); + + /** + * Creates a new {@code SVG_RendererHooks.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 {@link SVG_RendererHooks#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected SVG_RendererHooks getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code init_svg} field. */ + public SVG_Lib_Init_Func init_svg() { return SVG_RendererHooks.ninit_svg(address()); } + /** @return the value of the {@code free_svg} field. */ + public SVG_Lib_Free_Func free_svg() { return SVG_RendererHooks.nfree_svg(address()); } + /** @return the value of the {@code render_svg} field. */ + public SVG_Lib_Render_Func render_svg() { return SVG_RendererHooks.nrender_svg(address()); } + /** @return the value of the {@code preset_slot} field. */ + public SVG_Lib_Preset_Slot_Func preset_slot() { return SVG_RendererHooks.npreset_slot(address()); } + + /** Sets the specified value to the {@code init_svg} field. */ + public Buffer init_svg(@NativeType("SVG_Lib_Init_Func") SVG_Lib_Init_FuncI value) { SVG_RendererHooks.ninit_svg(address(), value); return this; } + /** Sets the specified value to the {@code free_svg} field. */ + public Buffer free_svg(@NativeType("SVG_Lib_Free_Func") SVG_Lib_Free_FuncI value) { SVG_RendererHooks.nfree_svg(address(), value); return this; } + /** Sets the specified value to the {@code render_svg} field. */ + public Buffer render_svg(@NativeType("SVG_Lib_Render_Func") SVG_Lib_Render_FuncI value) { SVG_RendererHooks.nrender_svg(address(), value); return this; } + /** Sets the specified value to the {@code preset_slot} field. */ + public Buffer preset_slot(@NativeType("SVG_Lib_Preset_Slot_Func") SVG_Lib_Preset_Slot_FuncI value) { SVG_RendererHooks.npreset_slot(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_Header.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_Header.java new file mode 100644 index 00000000..733eb1aa --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_Header.java @@ -0,0 +1,367 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure to model a TrueType font header table. + * + *

Layout

+ * + *

+ * struct TT_Header {
+ *     FT_Fixed Table_Version;
+ *     FT_Fixed Font_Revision;
+ *     FT_Long CheckSum_Adjust;
+ *     FT_Long Magic_Number;
+ *     FT_UShort Flags;
+ *     FT_UShort Units_Per_EM;
+ *     FT_ULong Created[2];
+ *     FT_ULong Modified[2];
+ *     FT_Short xMin;
+ *     FT_Short yMin;
+ *     FT_Short xMax;
+ *     FT_Short yMax;
+ *     FT_UShort Mac_Style;
+ *     FT_UShort Lowest_Rec_PPEM;
+ *     FT_Short Font_Direction;
+ *     FT_Short Index_To_Loc_Format;
+ *     FT_Short Glyph_Data_Format;
+ * }
+ */ +public class TT_Header extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TABLE_VERSION, + FONT_REVISION, + CHECKSUM_ADJUST, + MAGIC_NUMBER, + FLAGS, + UNITS_PER_EM, + CREATED, + MODIFIED, + XMIN, + YMIN, + XMAX, + YMAX, + MAC_STYLE, + LOWEST_REC_PPEM, + FONT_DIRECTION, + INDEX_TO_LOC_FORMAT, + GLYPH_DATA_FORMAT; + + static { + Layout layout = __struct( + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(2), + __member(2), + __array(CLONG_SIZE, 2), + __array(CLONG_SIZE, 2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TABLE_VERSION = layout.offsetof(0); + FONT_REVISION = layout.offsetof(1); + CHECKSUM_ADJUST = layout.offsetof(2); + MAGIC_NUMBER = layout.offsetof(3); + FLAGS = layout.offsetof(4); + UNITS_PER_EM = layout.offsetof(5); + CREATED = layout.offsetof(6); + MODIFIED = layout.offsetof(7); + XMIN = layout.offsetof(8); + YMIN = layout.offsetof(9); + XMAX = layout.offsetof(10); + YMAX = layout.offsetof(11); + MAC_STYLE = layout.offsetof(12); + LOWEST_REC_PPEM = layout.offsetof(13); + FONT_DIRECTION = layout.offsetof(14); + INDEX_TO_LOC_FORMAT = layout.offsetof(15); + GLYPH_DATA_FORMAT = layout.offsetof(16); + } + + protected TT_Header(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected TT_Header create(long address, @Nullable ByteBuffer container) { + return new TT_Header(address, container); + } + + /** + * Creates a {@code TT_Header} instance at the current position of the specified {@link 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 TT_Header(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code Table_Version} field. */ + @NativeType("FT_Fixed") + public long Table_Version() { return nTable_Version(address()); } + /** @return the value of the {@code Font_Revision} field. */ + @NativeType("FT_Fixed") + public long Font_Revision() { return nFont_Revision(address()); } + /** @return the value of the {@code CheckSum_Adjust} field. */ + @NativeType("FT_Long") + public long CheckSum_Adjust() { return nCheckSum_Adjust(address()); } + /** @return the value of the {@code Magic_Number} field. */ + @NativeType("FT_Long") + public long Magic_Number() { return nMagic_Number(address()); } + /** @return the value of the {@code Flags} field. */ + @NativeType("FT_UShort") + public short Flags() { return nFlags(address()); } + /** @return the value of the {@code Units_Per_EM} field. */ + @NativeType("FT_UShort") + public short Units_Per_EM() { return nUnits_Per_EM(address()); } + /** @return a {@link CLongBuffer} view of the {@code Created} field. */ + @NativeType("FT_ULong[2]") + public CLongBuffer Created() { return nCreated(address()); } + /** @return the value at the specified index of the {@code Created} field. */ + @NativeType("FT_ULong") + public long Created(int index) { return nCreated(address(), index); } + /** @return a {@link CLongBuffer} view of the {@code Modified} field. */ + @NativeType("FT_ULong[2]") + public CLongBuffer Modified() { return nModified(address()); } + /** @return the value at the specified index of the {@code Modified} field. */ + @NativeType("FT_ULong") + public long Modified(int index) { return nModified(address(), index); } + /** @return the value of the {@code xMin} field. */ + @NativeType("FT_Short") + public short xMin() { return nxMin(address()); } + /** @return the value of the {@code yMin} field. */ + @NativeType("FT_Short") + public short yMin() { return nyMin(address()); } + /** @return the value of the {@code xMax} field. */ + @NativeType("FT_Short") + public short xMax() { return nxMax(address()); } + /** @return the value of the {@code yMax} field. */ + @NativeType("FT_Short") + public short yMax() { return nyMax(address()); } + /** @return the value of the {@code Mac_Style} field. */ + @NativeType("FT_UShort") + public short Mac_Style() { return nMac_Style(address()); } + /** @return the value of the {@code Lowest_Rec_PPEM} field. */ + @NativeType("FT_UShort") + public short Lowest_Rec_PPEM() { return nLowest_Rec_PPEM(address()); } + /** @return the value of the {@code Font_Direction} field. */ + @NativeType("FT_Short") + public short Font_Direction() { return nFont_Direction(address()); } + /** @return the value of the {@code Index_To_Loc_Format} field. */ + @NativeType("FT_Short") + public short Index_To_Loc_Format() { return nIndex_To_Loc_Format(address()); } + /** @return the value of the {@code Glyph_Data_Format} field. */ + @NativeType("FT_Short") + public short Glyph_Data_Format() { return nGlyph_Data_Format(address()); } + + // ----------------------------------- + + /** Returns a new {@code TT_Header} instance for the specified memory address. */ + public static TT_Header create(long address) { + return new TT_Header(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static TT_Header createSafe(long address) { + return address == NULL ? null : new TT_Header(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #Table_Version}. */ + public static long nTable_Version(long struct) { return memGetCLong(struct + TT_Header.TABLE_VERSION); } + /** Unsafe version of {@link #Font_Revision}. */ + public static long nFont_Revision(long struct) { return memGetCLong(struct + TT_Header.FONT_REVISION); } + /** Unsafe version of {@link #CheckSum_Adjust}. */ + public static long nCheckSum_Adjust(long struct) { return memGetCLong(struct + TT_Header.CHECKSUM_ADJUST); } + /** Unsafe version of {@link #Magic_Number}. */ + public static long nMagic_Number(long struct) { return memGetCLong(struct + TT_Header.MAGIC_NUMBER); } + /** Unsafe version of {@link #Flags}. */ + public static short nFlags(long struct) { return UNSAFE.getShort(null, struct + TT_Header.FLAGS); } + /** Unsafe version of {@link #Units_Per_EM}. */ + public static short nUnits_Per_EM(long struct) { return UNSAFE.getShort(null, struct + TT_Header.UNITS_PER_EM); } + /** Unsafe version of {@link #Created}. */ + public static CLongBuffer nCreated(long struct) { return memCLongBuffer(struct + TT_Header.CREATED, 2); } + /** Unsafe version of {@link #Created(int) Created}. */ + public static long nCreated(long struct, int index) { + return memGetCLong(struct + TT_Header.CREATED + check(index, 2) * CLONG_SIZE); + } + /** Unsafe version of {@link #Modified}. */ + public static CLongBuffer nModified(long struct) { return memCLongBuffer(struct + TT_Header.MODIFIED, 2); } + /** Unsafe version of {@link #Modified(int) Modified}. */ + public static long nModified(long struct, int index) { + return memGetCLong(struct + TT_Header.MODIFIED + check(index, 2) * CLONG_SIZE); + } + /** Unsafe version of {@link #xMin}. */ + public static short nxMin(long struct) { return UNSAFE.getShort(null, struct + TT_Header.XMIN); } + /** Unsafe version of {@link #yMin}. */ + public static short nyMin(long struct) { return UNSAFE.getShort(null, struct + TT_Header.YMIN); } + /** Unsafe version of {@link #xMax}. */ + public static short nxMax(long struct) { return UNSAFE.getShort(null, struct + TT_Header.XMAX); } + /** Unsafe version of {@link #yMax}. */ + public static short nyMax(long struct) { return UNSAFE.getShort(null, struct + TT_Header.YMAX); } + /** Unsafe version of {@link #Mac_Style}. */ + public static short nMac_Style(long struct) { return UNSAFE.getShort(null, struct + TT_Header.MAC_STYLE); } + /** Unsafe version of {@link #Lowest_Rec_PPEM}. */ + public static short nLowest_Rec_PPEM(long struct) { return UNSAFE.getShort(null, struct + TT_Header.LOWEST_REC_PPEM); } + /** Unsafe version of {@link #Font_Direction}. */ + public static short nFont_Direction(long struct) { return UNSAFE.getShort(null, struct + TT_Header.FONT_DIRECTION); } + /** Unsafe version of {@link #Index_To_Loc_Format}. */ + public static short nIndex_To_Loc_Format(long struct) { return UNSAFE.getShort(null, struct + TT_Header.INDEX_TO_LOC_FORMAT); } + /** Unsafe version of {@link #Glyph_Data_Format}. */ + public static short nGlyph_Data_Format(long struct) { return UNSAFE.getShort(null, struct + TT_Header.GLYPH_DATA_FORMAT); } + + // ----------------------------------- + + /** An array of {@link TT_Header} structs. */ + public static class Buffer extends StructBuffer { + + private static final TT_Header ELEMENT_FACTORY = TT_Header.create(-1L); + + /** + * Creates a new {@code TT_Header.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 {@link TT_Header#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected TT_Header getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code Table_Version} field. */ + @NativeType("FT_Fixed") + public long Table_Version() { return TT_Header.nTable_Version(address()); } + /** @return the value of the {@code Font_Revision} field. */ + @NativeType("FT_Fixed") + public long Font_Revision() { return TT_Header.nFont_Revision(address()); } + /** @return the value of the {@code CheckSum_Adjust} field. */ + @NativeType("FT_Long") + public long CheckSum_Adjust() { return TT_Header.nCheckSum_Adjust(address()); } + /** @return the value of the {@code Magic_Number} field. */ + @NativeType("FT_Long") + public long Magic_Number() { return TT_Header.nMagic_Number(address()); } + /** @return the value of the {@code Flags} field. */ + @NativeType("FT_UShort") + public short Flags() { return TT_Header.nFlags(address()); } + /** @return the value of the {@code Units_Per_EM} field. */ + @NativeType("FT_UShort") + public short Units_Per_EM() { return TT_Header.nUnits_Per_EM(address()); } + /** @return a {@link CLongBuffer} view of the {@code Created} field. */ + @NativeType("FT_ULong[2]") + public CLongBuffer Created() { return TT_Header.nCreated(address()); } + /** @return the value at the specified index of the {@code Created} field. */ + @NativeType("FT_ULong") + public long Created(int index) { return TT_Header.nCreated(address(), index); } + /** @return a {@link CLongBuffer} view of the {@code Modified} field. */ + @NativeType("FT_ULong[2]") + public CLongBuffer Modified() { return TT_Header.nModified(address()); } + /** @return the value at the specified index of the {@code Modified} field. */ + @NativeType("FT_ULong") + public long Modified(int index) { return TT_Header.nModified(address(), index); } + /** @return the value of the {@code xMin} field. */ + @NativeType("FT_Short") + public short xMin() { return TT_Header.nxMin(address()); } + /** @return the value of the {@code yMin} field. */ + @NativeType("FT_Short") + public short yMin() { return TT_Header.nyMin(address()); } + /** @return the value of the {@code xMax} field. */ + @NativeType("FT_Short") + public short xMax() { return TT_Header.nxMax(address()); } + /** @return the value of the {@code yMax} field. */ + @NativeType("FT_Short") + public short yMax() { return TT_Header.nyMax(address()); } + /** @return the value of the {@code Mac_Style} field. */ + @NativeType("FT_UShort") + public short Mac_Style() { return TT_Header.nMac_Style(address()); } + /** @return the value of the {@code Lowest_Rec_PPEM} field. */ + @NativeType("FT_UShort") + public short Lowest_Rec_PPEM() { return TT_Header.nLowest_Rec_PPEM(address()); } + /** @return the value of the {@code Font_Direction} field. */ + @NativeType("FT_Short") + public short Font_Direction() { return TT_Header.nFont_Direction(address()); } + /** @return the value of the {@code Index_To_Loc_Format} field. */ + @NativeType("FT_Short") + public short Index_To_Loc_Format() { return TT_Header.nIndex_To_Loc_Format(address()); } + /** @return the value of the {@code Glyph_Data_Format} field. */ + @NativeType("FT_Short") + public short Glyph_Data_Format() { return TT_Header.nGlyph_Data_Format(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_HoriHeader.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_HoriHeader.java new file mode 100644 index 00000000..4cd20af4 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_HoriHeader.java @@ -0,0 +1,364 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure to model a TrueType horizontal header, the {@code hhea} table, as well as the corresponding horizontal metrics table, {@code hmtx}. + * + *

Layout

+ * + *

+ * struct TT_HoriHeader {
+ *     FT_Fixed Version;
+ *     FT_Short Ascender;
+ *     FT_Short Descender;
+ *     FT_Short Line_Gap;
+ *     FT_UShort {@link #advance_Width_Max};
+ *     FT_Short {@link #min_Left_Side_Bearing};
+ *     FT_Short {@link #min_Right_Side_Bearing};
+ *     FT_Short {@link #xMax_Extent};
+ *     FT_Short caret_Slope_Rise;
+ *     FT_Short caret_Slope_Run;
+ *     FT_Short caret_Offset;
+ *     FT_Short Reserved[4];
+ *     FT_Short metric_Data_Format;
+ *     FT_UShort number_Of_HMetrics;
+ *     void * long_metrics;
+ *     void * short_metrics;
+ * }
+ */ +public class TT_HoriHeader extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + VERSION, + ASCENDER, + DESCENDER, + LINE_GAP, + ADVANCE_WIDTH_MAX, + MIN_LEFT_SIDE_BEARING, + MIN_RIGHT_SIDE_BEARING, + XMAX_EXTENT, + CARET_SLOPE_RISE, + CARET_SLOPE_RUN, + CARET_OFFSET, + RESERVED, + METRIC_DATA_FORMAT, + NUMBER_OF_HMETRICS, + LONG_METRICS, + SHORT_METRICS; + + static { + Layout layout = __struct( + __member(CLONG_SIZE), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __array(2, 4), + __member(2), + __member(2), + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + VERSION = layout.offsetof(0); + ASCENDER = layout.offsetof(1); + DESCENDER = layout.offsetof(2); + LINE_GAP = layout.offsetof(3); + ADVANCE_WIDTH_MAX = layout.offsetof(4); + MIN_LEFT_SIDE_BEARING = layout.offsetof(5); + MIN_RIGHT_SIDE_BEARING = layout.offsetof(6); + XMAX_EXTENT = layout.offsetof(7); + CARET_SLOPE_RISE = layout.offsetof(8); + CARET_SLOPE_RUN = layout.offsetof(9); + CARET_OFFSET = layout.offsetof(10); + RESERVED = layout.offsetof(11); + METRIC_DATA_FORMAT = layout.offsetof(12); + NUMBER_OF_HMETRICS = layout.offsetof(13); + LONG_METRICS = layout.offsetof(14); + SHORT_METRICS = layout.offsetof(15); + } + + protected TT_HoriHeader(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected TT_HoriHeader create(long address, @Nullable ByteBuffer container) { + return new TT_HoriHeader(address, container); + } + + /** + * Creates a {@code TT_HoriHeader} instance at the current position of the specified {@link 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 TT_HoriHeader(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code Version} field. */ + @NativeType("FT_Fixed") + public long Version() { return nVersion(address()); } + /** @return the value of the {@code Ascender} field. */ + @NativeType("FT_Short") + public short Ascender() { return nAscender(address()); } + /** @return the value of the {@code Descender} field. */ + @NativeType("FT_Short") + public short Descender() { return nDescender(address()); } + /** @return the value of the {@code Line_Gap} field. */ + @NativeType("FT_Short") + public short Line_Gap() { return nLine_Gap(address()); } + /** advance width maximum */ + @NativeType("FT_UShort") + public short advance_Width_Max() { return nadvance_Width_Max(address()); } + /** minimum left-sb */ + @NativeType("FT_Short") + public short min_Left_Side_Bearing() { return nmin_Left_Side_Bearing(address()); } + /** minimum right-sb */ + @NativeType("FT_Short") + public short min_Right_Side_Bearing() { return nmin_Right_Side_Bearing(address()); } + /** xmax extents */ + @NativeType("FT_Short") + public short xMax_Extent() { return nxMax_Extent(address()); } + /** @return the value of the {@code caret_Slope_Rise} field. */ + @NativeType("FT_Short") + public short caret_Slope_Rise() { return ncaret_Slope_Rise(address()); } + /** @return the value of the {@code caret_Slope_Run} field. */ + @NativeType("FT_Short") + public short caret_Slope_Run() { return ncaret_Slope_Run(address()); } + /** @return the value of the {@code caret_Offset} field. */ + @NativeType("FT_Short") + public short caret_Offset() { return ncaret_Offset(address()); } + /** @return a {@link ShortBuffer} view of the {@code Reserved} field. */ + @NativeType("FT_Short[4]") + public ShortBuffer Reserved() { return nReserved(address()); } + /** @return the value at the specified index of the {@code Reserved} field. */ + @NativeType("FT_Short") + public short Reserved(int index) { return nReserved(address(), index); } + /** @return the value of the {@code metric_Data_Format} field. */ + @NativeType("FT_Short") + public short metric_Data_Format() { return nmetric_Data_Format(address()); } + /** @return the value of the {@code number_Of_HMetrics} field. */ + @NativeType("FT_UShort") + public short number_Of_HMetrics() { return nnumber_Of_HMetrics(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code long_metrics} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void *") + public ByteBuffer long_metrics(int capacity) { return nlong_metrics(address(), capacity); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code short_metrics} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void *") + public ByteBuffer short_metrics(int capacity) { return nshort_metrics(address(), capacity); } + + // ----------------------------------- + + /** Returns a new {@code TT_HoriHeader} instance for the specified memory address. */ + public static TT_HoriHeader create(long address) { + return new TT_HoriHeader(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static TT_HoriHeader createSafe(long address) { + return address == NULL ? null : new TT_HoriHeader(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #Version}. */ + public static long nVersion(long struct) { return memGetCLong(struct + TT_HoriHeader.VERSION); } + /** Unsafe version of {@link #Ascender}. */ + public static short nAscender(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.ASCENDER); } + /** Unsafe version of {@link #Descender}. */ + public static short nDescender(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.DESCENDER); } + /** Unsafe version of {@link #Line_Gap}. */ + public static short nLine_Gap(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.LINE_GAP); } + /** Unsafe version of {@link #advance_Width_Max}. */ + public static short nadvance_Width_Max(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.ADVANCE_WIDTH_MAX); } + /** Unsafe version of {@link #min_Left_Side_Bearing}. */ + public static short nmin_Left_Side_Bearing(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.MIN_LEFT_SIDE_BEARING); } + /** Unsafe version of {@link #min_Right_Side_Bearing}. */ + public static short nmin_Right_Side_Bearing(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.MIN_RIGHT_SIDE_BEARING); } + /** Unsafe version of {@link #xMax_Extent}. */ + public static short nxMax_Extent(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.XMAX_EXTENT); } + /** Unsafe version of {@link #caret_Slope_Rise}. */ + public static short ncaret_Slope_Rise(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.CARET_SLOPE_RISE); } + /** Unsafe version of {@link #caret_Slope_Run}. */ + public static short ncaret_Slope_Run(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.CARET_SLOPE_RUN); } + /** Unsafe version of {@link #caret_Offset}. */ + public static short ncaret_Offset(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.CARET_OFFSET); } + /** Unsafe version of {@link #Reserved}. */ + public static ShortBuffer nReserved(long struct) { return memShortBuffer(struct + TT_HoriHeader.RESERVED, 4); } + /** Unsafe version of {@link #Reserved(int) Reserved}. */ + public static short nReserved(long struct, int index) { + return UNSAFE.getShort(null, struct + TT_HoriHeader.RESERVED + check(index, 4) * 2); + } + /** Unsafe version of {@link #metric_Data_Format}. */ + public static short nmetric_Data_Format(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.METRIC_DATA_FORMAT); } + /** Unsafe version of {@link #number_Of_HMetrics}. */ + public static short nnumber_Of_HMetrics(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.NUMBER_OF_HMETRICS); } + /** Unsafe version of {@link #long_metrics(int) long_metrics}. */ + @Nullable public static ByteBuffer nlong_metrics(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + TT_HoriHeader.LONG_METRICS), capacity); } + /** Unsafe version of {@link #short_metrics(int) short_metrics}. */ + @Nullable public static ByteBuffer nshort_metrics(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + TT_HoriHeader.SHORT_METRICS), capacity); } + + // ----------------------------------- + + /** An array of {@link TT_HoriHeader} structs. */ + public static class Buffer extends StructBuffer { + + private static final TT_HoriHeader ELEMENT_FACTORY = TT_HoriHeader.create(-1L); + + /** + * Creates a new {@code TT_HoriHeader.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 {@link TT_HoriHeader#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected TT_HoriHeader getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code Version} field. */ + @NativeType("FT_Fixed") + public long Version() { return TT_HoriHeader.nVersion(address()); } + /** @return the value of the {@code Ascender} field. */ + @NativeType("FT_Short") + public short Ascender() { return TT_HoriHeader.nAscender(address()); } + /** @return the value of the {@code Descender} field. */ + @NativeType("FT_Short") + public short Descender() { return TT_HoriHeader.nDescender(address()); } + /** @return the value of the {@code Line_Gap} field. */ + @NativeType("FT_Short") + public short Line_Gap() { return TT_HoriHeader.nLine_Gap(address()); } + /** @return the value of the {@link TT_HoriHeader#advance_Width_Max} field. */ + @NativeType("FT_UShort") + public short advance_Width_Max() { return TT_HoriHeader.nadvance_Width_Max(address()); } + /** @return the value of the {@link TT_HoriHeader#min_Left_Side_Bearing} field. */ + @NativeType("FT_Short") + public short min_Left_Side_Bearing() { return TT_HoriHeader.nmin_Left_Side_Bearing(address()); } + /** @return the value of the {@link TT_HoriHeader#min_Right_Side_Bearing} field. */ + @NativeType("FT_Short") + public short min_Right_Side_Bearing() { return TT_HoriHeader.nmin_Right_Side_Bearing(address()); } + /** @return the value of the {@link TT_HoriHeader#xMax_Extent} field. */ + @NativeType("FT_Short") + public short xMax_Extent() { return TT_HoriHeader.nxMax_Extent(address()); } + /** @return the value of the {@code caret_Slope_Rise} field. */ + @NativeType("FT_Short") + public short caret_Slope_Rise() { return TT_HoriHeader.ncaret_Slope_Rise(address()); } + /** @return the value of the {@code caret_Slope_Run} field. */ + @NativeType("FT_Short") + public short caret_Slope_Run() { return TT_HoriHeader.ncaret_Slope_Run(address()); } + /** @return the value of the {@code caret_Offset} field. */ + @NativeType("FT_Short") + public short caret_Offset() { return TT_HoriHeader.ncaret_Offset(address()); } + /** @return a {@link ShortBuffer} view of the {@code Reserved} field. */ + @NativeType("FT_Short[4]") + public ShortBuffer Reserved() { return TT_HoriHeader.nReserved(address()); } + /** @return the value at the specified index of the {@code Reserved} field. */ + @NativeType("FT_Short") + public short Reserved(int index) { return TT_HoriHeader.nReserved(address(), index); } + /** @return the value of the {@code metric_Data_Format} field. */ + @NativeType("FT_Short") + public short metric_Data_Format() { return TT_HoriHeader.nmetric_Data_Format(address()); } + /** @return the value of the {@code number_Of_HMetrics} field. */ + @NativeType("FT_UShort") + public short number_Of_HMetrics() { return TT_HoriHeader.nnumber_Of_HMetrics(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code long_metrics} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void *") + public ByteBuffer long_metrics(int capacity) { return TT_HoriHeader.nlong_metrics(address(), capacity); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code short_metrics} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void *") + public ByteBuffer short_metrics(int capacity) { return TT_HoriHeader.nshort_metrics(address(), capacity); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_MaxProfile.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_MaxProfile.java new file mode 100644 index 00000000..d91de98a --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_MaxProfile.java @@ -0,0 +1,321 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The maximum profile ({@code maxp}) table contains many max values, which can be used to pre-allocate arrays for speeding up glyph loading and hinting. + * + *

Layout

+ * + *

+ * struct TT_MaxProfile {
+ *     FT_Fixed version;
+ *     FT_UShort numGlyphs;
+ *     FT_UShort maxPoints;
+ *     FT_UShort maxContours;
+ *     FT_UShort maxCompositePoints;
+ *     FT_UShort maxCompositeContours;
+ *     FT_UShort maxZones;
+ *     FT_UShort maxTwilightPoints;
+ *     FT_UShort maxStorage;
+ *     FT_UShort maxFunctionDefs;
+ *     FT_UShort maxInstructionDefs;
+ *     FT_UShort maxStackElements;
+ *     FT_UShort maxSizeOfInstructions;
+ *     FT_UShort maxComponentElements;
+ *     FT_UShort maxComponentDepth;
+ * }
+ */ +public class TT_MaxProfile extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + VERSION, + NUMGLYPHS, + MAXPOINTS, + MAXCONTOURS, + MAXCOMPOSITEPOINTS, + MAXCOMPOSITECONTOURS, + MAXZONES, + MAXTWILIGHTPOINTS, + MAXSTORAGE, + MAXFUNCTIONDEFS, + MAXINSTRUCTIONDEFS, + MAXSTACKELEMENTS, + MAXSIZEOFINSTRUCTIONS, + MAXCOMPONENTELEMENTS, + MAXCOMPONENTDEPTH; + + static { + Layout layout = __struct( + __member(CLONG_SIZE), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + VERSION = layout.offsetof(0); + NUMGLYPHS = layout.offsetof(1); + MAXPOINTS = layout.offsetof(2); + MAXCONTOURS = layout.offsetof(3); + MAXCOMPOSITEPOINTS = layout.offsetof(4); + MAXCOMPOSITECONTOURS = layout.offsetof(5); + MAXZONES = layout.offsetof(6); + MAXTWILIGHTPOINTS = layout.offsetof(7); + MAXSTORAGE = layout.offsetof(8); + MAXFUNCTIONDEFS = layout.offsetof(9); + MAXINSTRUCTIONDEFS = layout.offsetof(10); + MAXSTACKELEMENTS = layout.offsetof(11); + MAXSIZEOFINSTRUCTIONS = layout.offsetof(12); + MAXCOMPONENTELEMENTS = layout.offsetof(13); + MAXCOMPONENTDEPTH = layout.offsetof(14); + } + + protected TT_MaxProfile(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected TT_MaxProfile create(long address, @Nullable ByteBuffer container) { + return new TT_MaxProfile(address, container); + } + + /** + * Creates a {@code TT_MaxProfile} instance at the current position of the specified {@link 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 TT_MaxProfile(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code version} field. */ + @NativeType("FT_Fixed") + public long version() { return nversion(address()); } + /** @return the value of the {@code numGlyphs} field. */ + @NativeType("FT_UShort") + public short numGlyphs() { return nnumGlyphs(address()); } + /** @return the value of the {@code maxPoints} field. */ + @NativeType("FT_UShort") + public short maxPoints() { return nmaxPoints(address()); } + /** @return the value of the {@code maxContours} field. */ + @NativeType("FT_UShort") + public short maxContours() { return nmaxContours(address()); } + /** @return the value of the {@code maxCompositePoints} field. */ + @NativeType("FT_UShort") + public short maxCompositePoints() { return nmaxCompositePoints(address()); } + /** @return the value of the {@code maxCompositeContours} field. */ + @NativeType("FT_UShort") + public short maxCompositeContours() { return nmaxCompositeContours(address()); } + /** @return the value of the {@code maxZones} field. */ + @NativeType("FT_UShort") + public short maxZones() { return nmaxZones(address()); } + /** @return the value of the {@code maxTwilightPoints} field. */ + @NativeType("FT_UShort") + public short maxTwilightPoints() { return nmaxTwilightPoints(address()); } + /** @return the value of the {@code maxStorage} field. */ + @NativeType("FT_UShort") + public short maxStorage() { return nmaxStorage(address()); } + /** @return the value of the {@code maxFunctionDefs} field. */ + @NativeType("FT_UShort") + public short maxFunctionDefs() { return nmaxFunctionDefs(address()); } + /** @return the value of the {@code maxInstructionDefs} field. */ + @NativeType("FT_UShort") + public short maxInstructionDefs() { return nmaxInstructionDefs(address()); } + /** @return the value of the {@code maxStackElements} field. */ + @NativeType("FT_UShort") + public short maxStackElements() { return nmaxStackElements(address()); } + /** @return the value of the {@code maxSizeOfInstructions} field. */ + @NativeType("FT_UShort") + public short maxSizeOfInstructions() { return nmaxSizeOfInstructions(address()); } + /** @return the value of the {@code maxComponentElements} field. */ + @NativeType("FT_UShort") + public short maxComponentElements() { return nmaxComponentElements(address()); } + /** @return the value of the {@code maxComponentDepth} field. */ + @NativeType("FT_UShort") + public short maxComponentDepth() { return nmaxComponentDepth(address()); } + + // ----------------------------------- + + /** Returns a new {@code TT_MaxProfile} instance for the specified memory address. */ + public static TT_MaxProfile create(long address) { + return new TT_MaxProfile(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static TT_MaxProfile createSafe(long address) { + return address == NULL ? null : new TT_MaxProfile(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #version}. */ + public static long nversion(long struct) { return memGetCLong(struct + TT_MaxProfile.VERSION); } + /** Unsafe version of {@link #numGlyphs}. */ + public static short nnumGlyphs(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.NUMGLYPHS); } + /** Unsafe version of {@link #maxPoints}. */ + public static short nmaxPoints(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXPOINTS); } + /** Unsafe version of {@link #maxContours}. */ + public static short nmaxContours(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXCONTOURS); } + /** Unsafe version of {@link #maxCompositePoints}. */ + public static short nmaxCompositePoints(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXCOMPOSITEPOINTS); } + /** Unsafe version of {@link #maxCompositeContours}. */ + public static short nmaxCompositeContours(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXCOMPOSITECONTOURS); } + /** Unsafe version of {@link #maxZones}. */ + public static short nmaxZones(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXZONES); } + /** Unsafe version of {@link #maxTwilightPoints}. */ + public static short nmaxTwilightPoints(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXTWILIGHTPOINTS); } + /** Unsafe version of {@link #maxStorage}. */ + public static short nmaxStorage(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXSTORAGE); } + /** Unsafe version of {@link #maxFunctionDefs}. */ + public static short nmaxFunctionDefs(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXFUNCTIONDEFS); } + /** Unsafe version of {@link #maxInstructionDefs}. */ + public static short nmaxInstructionDefs(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXINSTRUCTIONDEFS); } + /** Unsafe version of {@link #maxStackElements}. */ + public static short nmaxStackElements(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXSTACKELEMENTS); } + /** Unsafe version of {@link #maxSizeOfInstructions}. */ + public static short nmaxSizeOfInstructions(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXSIZEOFINSTRUCTIONS); } + /** Unsafe version of {@link #maxComponentElements}. */ + public static short nmaxComponentElements(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXCOMPONENTELEMENTS); } + /** Unsafe version of {@link #maxComponentDepth}. */ + public static short nmaxComponentDepth(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXCOMPONENTDEPTH); } + + // ----------------------------------- + + /** An array of {@link TT_MaxProfile} structs. */ + public static class Buffer extends StructBuffer { + + private static final TT_MaxProfile ELEMENT_FACTORY = TT_MaxProfile.create(-1L); + + /** + * Creates a new {@code TT_MaxProfile.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 {@link TT_MaxProfile#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected TT_MaxProfile getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code version} field. */ + @NativeType("FT_Fixed") + public long version() { return TT_MaxProfile.nversion(address()); } + /** @return the value of the {@code numGlyphs} field. */ + @NativeType("FT_UShort") + public short numGlyphs() { return TT_MaxProfile.nnumGlyphs(address()); } + /** @return the value of the {@code maxPoints} field. */ + @NativeType("FT_UShort") + public short maxPoints() { return TT_MaxProfile.nmaxPoints(address()); } + /** @return the value of the {@code maxContours} field. */ + @NativeType("FT_UShort") + public short maxContours() { return TT_MaxProfile.nmaxContours(address()); } + /** @return the value of the {@code maxCompositePoints} field. */ + @NativeType("FT_UShort") + public short maxCompositePoints() { return TT_MaxProfile.nmaxCompositePoints(address()); } + /** @return the value of the {@code maxCompositeContours} field. */ + @NativeType("FT_UShort") + public short maxCompositeContours() { return TT_MaxProfile.nmaxCompositeContours(address()); } + /** @return the value of the {@code maxZones} field. */ + @NativeType("FT_UShort") + public short maxZones() { return TT_MaxProfile.nmaxZones(address()); } + /** @return the value of the {@code maxTwilightPoints} field. */ + @NativeType("FT_UShort") + public short maxTwilightPoints() { return TT_MaxProfile.nmaxTwilightPoints(address()); } + /** @return the value of the {@code maxStorage} field. */ + @NativeType("FT_UShort") + public short maxStorage() { return TT_MaxProfile.nmaxStorage(address()); } + /** @return the value of the {@code maxFunctionDefs} field. */ + @NativeType("FT_UShort") + public short maxFunctionDefs() { return TT_MaxProfile.nmaxFunctionDefs(address()); } + /** @return the value of the {@code maxInstructionDefs} field. */ + @NativeType("FT_UShort") + public short maxInstructionDefs() { return TT_MaxProfile.nmaxInstructionDefs(address()); } + /** @return the value of the {@code maxStackElements} field. */ + @NativeType("FT_UShort") + public short maxStackElements() { return TT_MaxProfile.nmaxStackElements(address()); } + /** @return the value of the {@code maxSizeOfInstructions} field. */ + @NativeType("FT_UShort") + public short maxSizeOfInstructions() { return TT_MaxProfile.nmaxSizeOfInstructions(address()); } + /** @return the value of the {@code maxComponentElements} field. */ + @NativeType("FT_UShort") + public short maxComponentElements() { return TT_MaxProfile.nmaxComponentElements(address()); } + /** @return the value of the {@code maxComponentDepth} field. */ + @NativeType("FT_UShort") + public short maxComponentDepth() { return TT_MaxProfile.nmaxComponentDepth(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_OS2.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_OS2.java new file mode 100644 index 00000000..43de32e4 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_OS2.java @@ -0,0 +1,630 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure to model a TrueType {@code OS/2} table. + * + *

Layout

+ * + *

+ * struct TT_OS2 {
+ *     FT_UShort version;
+ *     FT_Short xAvgCharWidth;
+ *     FT_UShort usWeightClass;
+ *     FT_UShort usWidthClass;
+ *     FT_UShort fsType;
+ *     FT_Short ySubscriptXSize;
+ *     FT_Short ySubscriptYSize;
+ *     FT_Short ySubscriptXOffset;
+ *     FT_Short ySubscriptYOffset;
+ *     FT_Short ySuperscriptXSize;
+ *     FT_Short ySuperscriptYSize;
+ *     FT_Short ySuperscriptXOffset;
+ *     FT_Short ySuperscriptYOffset;
+ *     FT_Short yStrikeoutSize;
+ *     FT_Short yStrikeoutPosition;
+ *     FT_Short sFamilyClass;
+ *     FT_Byte panose[10];
+ *     FT_ULong ulUnicodeRange1;
+ *     FT_ULong ulUnicodeRange2;
+ *     FT_ULong ulUnicodeRange3;
+ *     FT_ULong ulUnicodeRange4;
+ *     FT_Char achVendID[4];
+ *     FT_UShort fsSelection;
+ *     FT_UShort usFirstCharIndex;
+ *     FT_UShort usLastCharIndex;
+ *     FT_Short sTypoAscender;
+ *     FT_Short sTypoDescender;
+ *     FT_Short sTypoLineGap;
+ *     FT_UShort usWinAscent;
+ *     FT_UShort usWinDescent;
+ *     FT_ULong ulCodePageRange1;
+ *     FT_ULong ulCodePageRange2;
+ *     FT_Short sxHeight;
+ *     FT_Short sCapHeight;
+ *     FT_UShort usDefaultChar;
+ *     FT_UShort usBreakChar;
+ *     FT_UShort usMaxContext;
+ *     FT_UShort usLowerOpticalPointSize;
+ *     FT_UShort usUpperOpticalPointSize;
+ * }
+ */ +public class TT_OS2 extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + VERSION, + XAVGCHARWIDTH, + USWEIGHTCLASS, + USWIDTHCLASS, + FSTYPE, + YSUBSCRIPTXSIZE, + YSUBSCRIPTYSIZE, + YSUBSCRIPTXOFFSET, + YSUBSCRIPTYOFFSET, + YSUPERSCRIPTXSIZE, + YSUPERSCRIPTYSIZE, + YSUPERSCRIPTXOFFSET, + YSUPERSCRIPTYOFFSET, + YSTRIKEOUTSIZE, + YSTRIKEOUTPOSITION, + SFAMILYCLASS, + PANOSE, + ULUNICODERANGE1, + ULUNICODERANGE2, + ULUNICODERANGE3, + ULUNICODERANGE4, + ACHVENDID, + FSSELECTION, + USFIRSTCHARINDEX, + USLASTCHARINDEX, + STYPOASCENDER, + STYPODESCENDER, + STYPOLINEGAP, + USWINASCENT, + USWINDESCENT, + ULCODEPAGERANGE1, + ULCODEPAGERANGE2, + SXHEIGHT, + SCAPHEIGHT, + USDEFAULTCHAR, + USBREAKCHAR, + USMAXCONTEXT, + USLOWEROPTICALPOINTSIZE, + USUPPEROPTICALPOINTSIZE; + + static { + Layout layout = __struct( + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __array(1, 10), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __array(1, 4), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + VERSION = layout.offsetof(0); + XAVGCHARWIDTH = layout.offsetof(1); + USWEIGHTCLASS = layout.offsetof(2); + USWIDTHCLASS = layout.offsetof(3); + FSTYPE = layout.offsetof(4); + YSUBSCRIPTXSIZE = layout.offsetof(5); + YSUBSCRIPTYSIZE = layout.offsetof(6); + YSUBSCRIPTXOFFSET = layout.offsetof(7); + YSUBSCRIPTYOFFSET = layout.offsetof(8); + YSUPERSCRIPTXSIZE = layout.offsetof(9); + YSUPERSCRIPTYSIZE = layout.offsetof(10); + YSUPERSCRIPTXOFFSET = layout.offsetof(11); + YSUPERSCRIPTYOFFSET = layout.offsetof(12); + YSTRIKEOUTSIZE = layout.offsetof(13); + YSTRIKEOUTPOSITION = layout.offsetof(14); + SFAMILYCLASS = layout.offsetof(15); + PANOSE = layout.offsetof(16); + ULUNICODERANGE1 = layout.offsetof(17); + ULUNICODERANGE2 = layout.offsetof(18); + ULUNICODERANGE3 = layout.offsetof(19); + ULUNICODERANGE4 = layout.offsetof(20); + ACHVENDID = layout.offsetof(21); + FSSELECTION = layout.offsetof(22); + USFIRSTCHARINDEX = layout.offsetof(23); + USLASTCHARINDEX = layout.offsetof(24); + STYPOASCENDER = layout.offsetof(25); + STYPODESCENDER = layout.offsetof(26); + STYPOLINEGAP = layout.offsetof(27); + USWINASCENT = layout.offsetof(28); + USWINDESCENT = layout.offsetof(29); + ULCODEPAGERANGE1 = layout.offsetof(30); + ULCODEPAGERANGE2 = layout.offsetof(31); + SXHEIGHT = layout.offsetof(32); + SCAPHEIGHT = layout.offsetof(33); + USDEFAULTCHAR = layout.offsetof(34); + USBREAKCHAR = layout.offsetof(35); + USMAXCONTEXT = layout.offsetof(36); + USLOWEROPTICALPOINTSIZE = layout.offsetof(37); + USUPPEROPTICALPOINTSIZE = layout.offsetof(38); + } + + protected TT_OS2(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected TT_OS2 create(long address, @Nullable ByteBuffer container) { + return new TT_OS2(address, container); + } + + /** + * Creates a {@code TT_OS2} instance at the current position of the specified {@link 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 TT_OS2(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code version} field. */ + @NativeType("FT_UShort") + public short version() { return nversion(address()); } + /** @return the value of the {@code xAvgCharWidth} field. */ + @NativeType("FT_Short") + public short xAvgCharWidth() { return nxAvgCharWidth(address()); } + /** @return the value of the {@code usWeightClass} field. */ + @NativeType("FT_UShort") + public short usWeightClass() { return nusWeightClass(address()); } + /** @return the value of the {@code usWidthClass} field. */ + @NativeType("FT_UShort") + public short usWidthClass() { return nusWidthClass(address()); } + /** @return the value of the {@code fsType} field. */ + @NativeType("FT_UShort") + public short fsType() { return nfsType(address()); } + /** @return the value of the {@code ySubscriptXSize} field. */ + @NativeType("FT_Short") + public short ySubscriptXSize() { return nySubscriptXSize(address()); } + /** @return the value of the {@code ySubscriptYSize} field. */ + @NativeType("FT_Short") + public short ySubscriptYSize() { return nySubscriptYSize(address()); } + /** @return the value of the {@code ySubscriptXOffset} field. */ + @NativeType("FT_Short") + public short ySubscriptXOffset() { return nySubscriptXOffset(address()); } + /** @return the value of the {@code ySubscriptYOffset} field. */ + @NativeType("FT_Short") + public short ySubscriptYOffset() { return nySubscriptYOffset(address()); } + /** @return the value of the {@code ySuperscriptXSize} field. */ + @NativeType("FT_Short") + public short ySuperscriptXSize() { return nySuperscriptXSize(address()); } + /** @return the value of the {@code ySuperscriptYSize} field. */ + @NativeType("FT_Short") + public short ySuperscriptYSize() { return nySuperscriptYSize(address()); } + /** @return the value of the {@code ySuperscriptXOffset} field. */ + @NativeType("FT_Short") + public short ySuperscriptXOffset() { return nySuperscriptXOffset(address()); } + /** @return the value of the {@code ySuperscriptYOffset} field. */ + @NativeType("FT_Short") + public short ySuperscriptYOffset() { return nySuperscriptYOffset(address()); } + /** @return the value of the {@code yStrikeoutSize} field. */ + @NativeType("FT_Short") + public short yStrikeoutSize() { return nyStrikeoutSize(address()); } + /** @return the value of the {@code yStrikeoutPosition} field. */ + @NativeType("FT_Short") + public short yStrikeoutPosition() { return nyStrikeoutPosition(address()); } + /** @return the value of the {@code sFamilyClass} field. */ + @NativeType("FT_Short") + public short sFamilyClass() { return nsFamilyClass(address()); } + /** @return a {@link ByteBuffer} view of the {@code panose} field. */ + @NativeType("FT_Byte[10]") + public ByteBuffer panose() { return npanose(address()); } + /** @return the value at the specified index of the {@code panose} field. */ + @NativeType("FT_Byte") + public byte panose(int index) { return npanose(address(), index); } + /** @return the value of the {@code ulUnicodeRange1} field. */ + @NativeType("FT_ULong") + public long ulUnicodeRange1() { return nulUnicodeRange1(address()); } + /** @return the value of the {@code ulUnicodeRange2} field. */ + @NativeType("FT_ULong") + public long ulUnicodeRange2() { return nulUnicodeRange2(address()); } + /** @return the value of the {@code ulUnicodeRange3} field. */ + @NativeType("FT_ULong") + public long ulUnicodeRange3() { return nulUnicodeRange3(address()); } + /** @return the value of the {@code ulUnicodeRange4} field. */ + @NativeType("FT_ULong") + public long ulUnicodeRange4() { return nulUnicodeRange4(address()); } + /** @return a {@link ByteBuffer} view of the {@code achVendID} field. */ + @NativeType("FT_Char[4]") + public ByteBuffer achVendID() { return nachVendID(address()); } + /** @return the value at the specified index of the {@code achVendID} field. */ + @NativeType("FT_Char") + public byte achVendID(int index) { return nachVendID(address(), index); } + /** @return the value of the {@code fsSelection} field. */ + @NativeType("FT_UShort") + public short fsSelection() { return nfsSelection(address()); } + /** @return the value of the {@code usFirstCharIndex} field. */ + @NativeType("FT_UShort") + public short usFirstCharIndex() { return nusFirstCharIndex(address()); } + /** @return the value of the {@code usLastCharIndex} field. */ + @NativeType("FT_UShort") + public short usLastCharIndex() { return nusLastCharIndex(address()); } + /** @return the value of the {@code sTypoAscender} field. */ + @NativeType("FT_Short") + public short sTypoAscender() { return nsTypoAscender(address()); } + /** @return the value of the {@code sTypoDescender} field. */ + @NativeType("FT_Short") + public short sTypoDescender() { return nsTypoDescender(address()); } + /** @return the value of the {@code sTypoLineGap} field. */ + @NativeType("FT_Short") + public short sTypoLineGap() { return nsTypoLineGap(address()); } + /** @return the value of the {@code usWinAscent} field. */ + @NativeType("FT_UShort") + public short usWinAscent() { return nusWinAscent(address()); } + /** @return the value of the {@code usWinDescent} field. */ + @NativeType("FT_UShort") + public short usWinDescent() { return nusWinDescent(address()); } + /** @return the value of the {@code ulCodePageRange1} field. */ + @NativeType("FT_ULong") + public long ulCodePageRange1() { return nulCodePageRange1(address()); } + /** @return the value of the {@code ulCodePageRange2} field. */ + @NativeType("FT_ULong") + public long ulCodePageRange2() { return nulCodePageRange2(address()); } + /** @return the value of the {@code sxHeight} field. */ + @NativeType("FT_Short") + public short sxHeight() { return nsxHeight(address()); } + /** @return the value of the {@code sCapHeight} field. */ + @NativeType("FT_Short") + public short sCapHeight() { return nsCapHeight(address()); } + /** @return the value of the {@code usDefaultChar} field. */ + @NativeType("FT_UShort") + public short usDefaultChar() { return nusDefaultChar(address()); } + /** @return the value of the {@code usBreakChar} field. */ + @NativeType("FT_UShort") + public short usBreakChar() { return nusBreakChar(address()); } + /** @return the value of the {@code usMaxContext} field. */ + @NativeType("FT_UShort") + public short usMaxContext() { return nusMaxContext(address()); } + /** @return the value of the {@code usLowerOpticalPointSize} field. */ + @NativeType("FT_UShort") + public short usLowerOpticalPointSize() { return nusLowerOpticalPointSize(address()); } + /** @return the value of the {@code usUpperOpticalPointSize} field. */ + @NativeType("FT_UShort") + public short usUpperOpticalPointSize() { return nusUpperOpticalPointSize(address()); } + + // ----------------------------------- + + /** Returns a new {@code TT_OS2} instance for the specified memory address. */ + public static TT_OS2 create(long address) { + return new TT_OS2(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static TT_OS2 createSafe(long address) { + return address == NULL ? null : new TT_OS2(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #version}. */ + public static short nversion(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.VERSION); } + /** Unsafe version of {@link #xAvgCharWidth}. */ + public static short nxAvgCharWidth(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.XAVGCHARWIDTH); } + /** Unsafe version of {@link #usWeightClass}. */ + public static short nusWeightClass(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USWEIGHTCLASS); } + /** Unsafe version of {@link #usWidthClass}. */ + public static short nusWidthClass(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USWIDTHCLASS); } + /** Unsafe version of {@link #fsType}. */ + public static short nfsType(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.FSTYPE); } + /** Unsafe version of {@link #ySubscriptXSize}. */ + public static short nySubscriptXSize(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSUBSCRIPTXSIZE); } + /** Unsafe version of {@link #ySubscriptYSize}. */ + public static short nySubscriptYSize(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSUBSCRIPTYSIZE); } + /** Unsafe version of {@link #ySubscriptXOffset}. */ + public static short nySubscriptXOffset(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSUBSCRIPTXOFFSET); } + /** Unsafe version of {@link #ySubscriptYOffset}. */ + public static short nySubscriptYOffset(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSUBSCRIPTYOFFSET); } + /** Unsafe version of {@link #ySuperscriptXSize}. */ + public static short nySuperscriptXSize(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSUPERSCRIPTXSIZE); } + /** Unsafe version of {@link #ySuperscriptYSize}. */ + public static short nySuperscriptYSize(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSUPERSCRIPTYSIZE); } + /** Unsafe version of {@link #ySuperscriptXOffset}. */ + public static short nySuperscriptXOffset(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSUPERSCRIPTXOFFSET); } + /** Unsafe version of {@link #ySuperscriptYOffset}. */ + public static short nySuperscriptYOffset(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSUPERSCRIPTYOFFSET); } + /** Unsafe version of {@link #yStrikeoutSize}. */ + public static short nyStrikeoutSize(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSTRIKEOUTSIZE); } + /** Unsafe version of {@link #yStrikeoutPosition}. */ + public static short nyStrikeoutPosition(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSTRIKEOUTPOSITION); } + /** Unsafe version of {@link #sFamilyClass}. */ + public static short nsFamilyClass(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.SFAMILYCLASS); } + /** Unsafe version of {@link #panose}. */ + public static ByteBuffer npanose(long struct) { return memByteBuffer(struct + TT_OS2.PANOSE, 10); } + /** Unsafe version of {@link #panose(int) panose}. */ + public static byte npanose(long struct, int index) { + return UNSAFE.getByte(null, struct + TT_OS2.PANOSE + check(index, 10) * 1); + } + /** Unsafe version of {@link #ulUnicodeRange1}. */ + public static long nulUnicodeRange1(long struct) { return memGetCLong(struct + TT_OS2.ULUNICODERANGE1); } + /** Unsafe version of {@link #ulUnicodeRange2}. */ + public static long nulUnicodeRange2(long struct) { return memGetCLong(struct + TT_OS2.ULUNICODERANGE2); } + /** Unsafe version of {@link #ulUnicodeRange3}. */ + public static long nulUnicodeRange3(long struct) { return memGetCLong(struct + TT_OS2.ULUNICODERANGE3); } + /** Unsafe version of {@link #ulUnicodeRange4}. */ + public static long nulUnicodeRange4(long struct) { return memGetCLong(struct + TT_OS2.ULUNICODERANGE4); } + /** Unsafe version of {@link #achVendID}. */ + public static ByteBuffer nachVendID(long struct) { return memByteBuffer(struct + TT_OS2.ACHVENDID, 4); } + /** Unsafe version of {@link #achVendID(int) achVendID}. */ + public static byte nachVendID(long struct, int index) { + return UNSAFE.getByte(null, struct + TT_OS2.ACHVENDID + check(index, 4) * 1); + } + /** Unsafe version of {@link #fsSelection}. */ + public static short nfsSelection(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.FSSELECTION); } + /** Unsafe version of {@link #usFirstCharIndex}. */ + public static short nusFirstCharIndex(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USFIRSTCHARINDEX); } + /** Unsafe version of {@link #usLastCharIndex}. */ + public static short nusLastCharIndex(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USLASTCHARINDEX); } + /** Unsafe version of {@link #sTypoAscender}. */ + public static short nsTypoAscender(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.STYPOASCENDER); } + /** Unsafe version of {@link #sTypoDescender}. */ + public static short nsTypoDescender(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.STYPODESCENDER); } + /** Unsafe version of {@link #sTypoLineGap}. */ + public static short nsTypoLineGap(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.STYPOLINEGAP); } + /** Unsafe version of {@link #usWinAscent}. */ + public static short nusWinAscent(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USWINASCENT); } + /** Unsafe version of {@link #usWinDescent}. */ + public static short nusWinDescent(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USWINDESCENT); } + /** Unsafe version of {@link #ulCodePageRange1}. */ + public static long nulCodePageRange1(long struct) { return memGetCLong(struct + TT_OS2.ULCODEPAGERANGE1); } + /** Unsafe version of {@link #ulCodePageRange2}. */ + public static long nulCodePageRange2(long struct) { return memGetCLong(struct + TT_OS2.ULCODEPAGERANGE2); } + /** Unsafe version of {@link #sxHeight}. */ + public static short nsxHeight(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.SXHEIGHT); } + /** Unsafe version of {@link #sCapHeight}. */ + public static short nsCapHeight(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.SCAPHEIGHT); } + /** Unsafe version of {@link #usDefaultChar}. */ + public static short nusDefaultChar(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USDEFAULTCHAR); } + /** Unsafe version of {@link #usBreakChar}. */ + public static short nusBreakChar(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USBREAKCHAR); } + /** Unsafe version of {@link #usMaxContext}. */ + public static short nusMaxContext(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USMAXCONTEXT); } + /** Unsafe version of {@link #usLowerOpticalPointSize}. */ + public static short nusLowerOpticalPointSize(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USLOWEROPTICALPOINTSIZE); } + /** Unsafe version of {@link #usUpperOpticalPointSize}. */ + public static short nusUpperOpticalPointSize(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USUPPEROPTICALPOINTSIZE); } + + // ----------------------------------- + + /** An array of {@link TT_OS2} structs. */ + public static class Buffer extends StructBuffer { + + private static final TT_OS2 ELEMENT_FACTORY = TT_OS2.create(-1L); + + /** + * Creates a new {@code TT_OS2.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 {@link TT_OS2#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected TT_OS2 getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code version} field. */ + @NativeType("FT_UShort") + public short version() { return TT_OS2.nversion(address()); } + /** @return the value of the {@code xAvgCharWidth} field. */ + @NativeType("FT_Short") + public short xAvgCharWidth() { return TT_OS2.nxAvgCharWidth(address()); } + /** @return the value of the {@code usWeightClass} field. */ + @NativeType("FT_UShort") + public short usWeightClass() { return TT_OS2.nusWeightClass(address()); } + /** @return the value of the {@code usWidthClass} field. */ + @NativeType("FT_UShort") + public short usWidthClass() { return TT_OS2.nusWidthClass(address()); } + /** @return the value of the {@code fsType} field. */ + @NativeType("FT_UShort") + public short fsType() { return TT_OS2.nfsType(address()); } + /** @return the value of the {@code ySubscriptXSize} field. */ + @NativeType("FT_Short") + public short ySubscriptXSize() { return TT_OS2.nySubscriptXSize(address()); } + /** @return the value of the {@code ySubscriptYSize} field. */ + @NativeType("FT_Short") + public short ySubscriptYSize() { return TT_OS2.nySubscriptYSize(address()); } + /** @return the value of the {@code ySubscriptXOffset} field. */ + @NativeType("FT_Short") + public short ySubscriptXOffset() { return TT_OS2.nySubscriptXOffset(address()); } + /** @return the value of the {@code ySubscriptYOffset} field. */ + @NativeType("FT_Short") + public short ySubscriptYOffset() { return TT_OS2.nySubscriptYOffset(address()); } + /** @return the value of the {@code ySuperscriptXSize} field. */ + @NativeType("FT_Short") + public short ySuperscriptXSize() { return TT_OS2.nySuperscriptXSize(address()); } + /** @return the value of the {@code ySuperscriptYSize} field. */ + @NativeType("FT_Short") + public short ySuperscriptYSize() { return TT_OS2.nySuperscriptYSize(address()); } + /** @return the value of the {@code ySuperscriptXOffset} field. */ + @NativeType("FT_Short") + public short ySuperscriptXOffset() { return TT_OS2.nySuperscriptXOffset(address()); } + /** @return the value of the {@code ySuperscriptYOffset} field. */ + @NativeType("FT_Short") + public short ySuperscriptYOffset() { return TT_OS2.nySuperscriptYOffset(address()); } + /** @return the value of the {@code yStrikeoutSize} field. */ + @NativeType("FT_Short") + public short yStrikeoutSize() { return TT_OS2.nyStrikeoutSize(address()); } + /** @return the value of the {@code yStrikeoutPosition} field. */ + @NativeType("FT_Short") + public short yStrikeoutPosition() { return TT_OS2.nyStrikeoutPosition(address()); } + /** @return the value of the {@code sFamilyClass} field. */ + @NativeType("FT_Short") + public short sFamilyClass() { return TT_OS2.nsFamilyClass(address()); } + /** @return a {@link ByteBuffer} view of the {@code panose} field. */ + @NativeType("FT_Byte[10]") + public ByteBuffer panose() { return TT_OS2.npanose(address()); } + /** @return the value at the specified index of the {@code panose} field. */ + @NativeType("FT_Byte") + public byte panose(int index) { return TT_OS2.npanose(address(), index); } + /** @return the value of the {@code ulUnicodeRange1} field. */ + @NativeType("FT_ULong") + public long ulUnicodeRange1() { return TT_OS2.nulUnicodeRange1(address()); } + /** @return the value of the {@code ulUnicodeRange2} field. */ + @NativeType("FT_ULong") + public long ulUnicodeRange2() { return TT_OS2.nulUnicodeRange2(address()); } + /** @return the value of the {@code ulUnicodeRange3} field. */ + @NativeType("FT_ULong") + public long ulUnicodeRange3() { return TT_OS2.nulUnicodeRange3(address()); } + /** @return the value of the {@code ulUnicodeRange4} field. */ + @NativeType("FT_ULong") + public long ulUnicodeRange4() { return TT_OS2.nulUnicodeRange4(address()); } + /** @return a {@link ByteBuffer} view of the {@code achVendID} field. */ + @NativeType("FT_Char[4]") + public ByteBuffer achVendID() { return TT_OS2.nachVendID(address()); } + /** @return the value at the specified index of the {@code achVendID} field. */ + @NativeType("FT_Char") + public byte achVendID(int index) { return TT_OS2.nachVendID(address(), index); } + /** @return the value of the {@code fsSelection} field. */ + @NativeType("FT_UShort") + public short fsSelection() { return TT_OS2.nfsSelection(address()); } + /** @return the value of the {@code usFirstCharIndex} field. */ + @NativeType("FT_UShort") + public short usFirstCharIndex() { return TT_OS2.nusFirstCharIndex(address()); } + /** @return the value of the {@code usLastCharIndex} field. */ + @NativeType("FT_UShort") + public short usLastCharIndex() { return TT_OS2.nusLastCharIndex(address()); } + /** @return the value of the {@code sTypoAscender} field. */ + @NativeType("FT_Short") + public short sTypoAscender() { return TT_OS2.nsTypoAscender(address()); } + /** @return the value of the {@code sTypoDescender} field. */ + @NativeType("FT_Short") + public short sTypoDescender() { return TT_OS2.nsTypoDescender(address()); } + /** @return the value of the {@code sTypoLineGap} field. */ + @NativeType("FT_Short") + public short sTypoLineGap() { return TT_OS2.nsTypoLineGap(address()); } + /** @return the value of the {@code usWinAscent} field. */ + @NativeType("FT_UShort") + public short usWinAscent() { return TT_OS2.nusWinAscent(address()); } + /** @return the value of the {@code usWinDescent} field. */ + @NativeType("FT_UShort") + public short usWinDescent() { return TT_OS2.nusWinDescent(address()); } + /** @return the value of the {@code ulCodePageRange1} field. */ + @NativeType("FT_ULong") + public long ulCodePageRange1() { return TT_OS2.nulCodePageRange1(address()); } + /** @return the value of the {@code ulCodePageRange2} field. */ + @NativeType("FT_ULong") + public long ulCodePageRange2() { return TT_OS2.nulCodePageRange2(address()); } + /** @return the value of the {@code sxHeight} field. */ + @NativeType("FT_Short") + public short sxHeight() { return TT_OS2.nsxHeight(address()); } + /** @return the value of the {@code sCapHeight} field. */ + @NativeType("FT_Short") + public short sCapHeight() { return TT_OS2.nsCapHeight(address()); } + /** @return the value of the {@code usDefaultChar} field. */ + @NativeType("FT_UShort") + public short usDefaultChar() { return TT_OS2.nusDefaultChar(address()); } + /** @return the value of the {@code usBreakChar} field. */ + @NativeType("FT_UShort") + public short usBreakChar() { return TT_OS2.nusBreakChar(address()); } + /** @return the value of the {@code usMaxContext} field. */ + @NativeType("FT_UShort") + public short usMaxContext() { return TT_OS2.nusMaxContext(address()); } + /** @return the value of the {@code usLowerOpticalPointSize} field. */ + @NativeType("FT_UShort") + public short usLowerOpticalPointSize() { return TT_OS2.nusLowerOpticalPointSize(address()); } + /** @return the value of the {@code usUpperOpticalPointSize} field. */ + @NativeType("FT_UShort") + public short usUpperOpticalPointSize() { return TT_OS2.nusUpperOpticalPointSize(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_PCLT.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_PCLT.java new file mode 100644 index 00000000..e4534abc --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_PCLT.java @@ -0,0 +1,352 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure to model a TrueType {@code PCLT} table. + * + *

Layout

+ * + *

+ * struct TT_PCLT {
+ *     FT_Fixed Version;
+ *     FT_ULong FontNumber;
+ *     FT_UShort Pitch;
+ *     FT_UShort xHeight;
+ *     FT_UShort Style;
+ *     FT_UShort TypeFamily;
+ *     FT_UShort CapHeight;
+ *     FT_UShort SymbolSet;
+ *     FT_Char TypeFace[16];
+ *     FT_Char CharacterComplement[8];
+ *     FT_Char FileName[6];
+ *     FT_Char StrokeWeight;
+ *     FT_Char WidthType;
+ *     FT_Byte SerifStyle;
+ *     FT_Byte Reserved;
+ * }
+ */ +public class TT_PCLT extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + VERSION, + FONTNUMBER, + PITCH, + XHEIGHT, + STYLE, + TYPEFAMILY, + CAPHEIGHT, + SYMBOLSET, + TYPEFACE, + CHARACTERCOMPLEMENT, + FILENAME, + STROKEWEIGHT, + WIDTHTYPE, + SERIFSTYLE, + RESERVED; + + static { + Layout layout = __struct( + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __array(1, 16), + __array(1, 8), + __array(1, 6), + __member(1), + __member(1), + __member(1), + __member(1) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + VERSION = layout.offsetof(0); + FONTNUMBER = layout.offsetof(1); + PITCH = layout.offsetof(2); + XHEIGHT = layout.offsetof(3); + STYLE = layout.offsetof(4); + TYPEFAMILY = layout.offsetof(5); + CAPHEIGHT = layout.offsetof(6); + SYMBOLSET = layout.offsetof(7); + TYPEFACE = layout.offsetof(8); + CHARACTERCOMPLEMENT = layout.offsetof(9); + FILENAME = layout.offsetof(10); + STROKEWEIGHT = layout.offsetof(11); + WIDTHTYPE = layout.offsetof(12); + SERIFSTYLE = layout.offsetof(13); + RESERVED = layout.offsetof(14); + } + + protected TT_PCLT(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected TT_PCLT create(long address, @Nullable ByteBuffer container) { + return new TT_PCLT(address, container); + } + + /** + * Creates a {@code TT_PCLT} instance at the current position of the specified {@link 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 TT_PCLT(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code Version} field. */ + @NativeType("FT_Fixed") + public long Version() { return nVersion(address()); } + /** @return the value of the {@code FontNumber} field. */ + @NativeType("FT_ULong") + public long FontNumber() { return nFontNumber(address()); } + /** @return the value of the {@code Pitch} field. */ + @NativeType("FT_UShort") + public short Pitch() { return nPitch(address()); } + /** @return the value of the {@code xHeight} field. */ + @NativeType("FT_UShort") + public short xHeight() { return nxHeight(address()); } + /** @return the value of the {@code Style} field. */ + @NativeType("FT_UShort") + public short Style() { return nStyle(address()); } + /** @return the value of the {@code TypeFamily} field. */ + @NativeType("FT_UShort") + public short TypeFamily() { return nTypeFamily(address()); } + /** @return the value of the {@code CapHeight} field. */ + @NativeType("FT_UShort") + public short CapHeight() { return nCapHeight(address()); } + /** @return the value of the {@code SymbolSet} field. */ + @NativeType("FT_UShort") + public short SymbolSet() { return nSymbolSet(address()); } + /** @return a {@link ByteBuffer} view of the {@code TypeFace} field. */ + @NativeType("FT_Char[16]") + public ByteBuffer TypeFace() { return nTypeFace(address()); } + /** @return the value at the specified index of the {@code TypeFace} field. */ + @NativeType("FT_Char") + public byte TypeFace(int index) { return nTypeFace(address(), index); } + /** @return a {@link ByteBuffer} view of the {@code CharacterComplement} field. */ + @NativeType("FT_Char[8]") + public ByteBuffer CharacterComplement() { return nCharacterComplement(address()); } + /** @return the value at the specified index of the {@code CharacterComplement} field. */ + @NativeType("FT_Char") + public byte CharacterComplement(int index) { return nCharacterComplement(address(), index); } + /** @return a {@link ByteBuffer} view of the {@code FileName} field. */ + @NativeType("FT_Char[6]") + public ByteBuffer FileName() { return nFileName(address()); } + /** @return the value at the specified index of the {@code FileName} field. */ + @NativeType("FT_Char") + public byte FileName(int index) { return nFileName(address(), index); } + /** @return the value of the {@code StrokeWeight} field. */ + @NativeType("FT_Char") + public byte StrokeWeight() { return nStrokeWeight(address()); } + /** @return the value of the {@code WidthType} field. */ + @NativeType("FT_Char") + public byte WidthType() { return nWidthType(address()); } + /** @return the value of the {@code SerifStyle} field. */ + @NativeType("FT_Byte") + public byte SerifStyle() { return nSerifStyle(address()); } + /** @return the value of the {@code Reserved} field. */ + @NativeType("FT_Byte") + public byte Reserved() { return nReserved(address()); } + + // ----------------------------------- + + /** Returns a new {@code TT_PCLT} instance for the specified memory address. */ + public static TT_PCLT create(long address) { + return new TT_PCLT(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static TT_PCLT createSafe(long address) { + return address == NULL ? null : new TT_PCLT(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #Version}. */ + public static long nVersion(long struct) { return memGetCLong(struct + TT_PCLT.VERSION); } + /** Unsafe version of {@link #FontNumber}. */ + public static long nFontNumber(long struct) { return memGetCLong(struct + TT_PCLT.FONTNUMBER); } + /** Unsafe version of {@link #Pitch}. */ + public static short nPitch(long struct) { return UNSAFE.getShort(null, struct + TT_PCLT.PITCH); } + /** Unsafe version of {@link #xHeight}. */ + public static short nxHeight(long struct) { return UNSAFE.getShort(null, struct + TT_PCLT.XHEIGHT); } + /** Unsafe version of {@link #Style}. */ + public static short nStyle(long struct) { return UNSAFE.getShort(null, struct + TT_PCLT.STYLE); } + /** Unsafe version of {@link #TypeFamily}. */ + public static short nTypeFamily(long struct) { return UNSAFE.getShort(null, struct + TT_PCLT.TYPEFAMILY); } + /** Unsafe version of {@link #CapHeight}. */ + public static short nCapHeight(long struct) { return UNSAFE.getShort(null, struct + TT_PCLT.CAPHEIGHT); } + /** Unsafe version of {@link #SymbolSet}. */ + public static short nSymbolSet(long struct) { return UNSAFE.getShort(null, struct + TT_PCLT.SYMBOLSET); } + /** Unsafe version of {@link #TypeFace}. */ + public static ByteBuffer nTypeFace(long struct) { return memByteBuffer(struct + TT_PCLT.TYPEFACE, 16); } + /** Unsafe version of {@link #TypeFace(int) TypeFace}. */ + public static byte nTypeFace(long struct, int index) { + return UNSAFE.getByte(null, struct + TT_PCLT.TYPEFACE + check(index, 16) * 1); + } + /** Unsafe version of {@link #CharacterComplement}. */ + public static ByteBuffer nCharacterComplement(long struct) { return memByteBuffer(struct + TT_PCLT.CHARACTERCOMPLEMENT, 8); } + /** Unsafe version of {@link #CharacterComplement(int) CharacterComplement}. */ + public static byte nCharacterComplement(long struct, int index) { + return UNSAFE.getByte(null, struct + TT_PCLT.CHARACTERCOMPLEMENT + check(index, 8) * 1); + } + /** Unsafe version of {@link #FileName}. */ + public static ByteBuffer nFileName(long struct) { return memByteBuffer(struct + TT_PCLT.FILENAME, 6); } + /** Unsafe version of {@link #FileName(int) FileName}. */ + public static byte nFileName(long struct, int index) { + return UNSAFE.getByte(null, struct + TT_PCLT.FILENAME + check(index, 6) * 1); + } + /** Unsafe version of {@link #StrokeWeight}. */ + public static byte nStrokeWeight(long struct) { return UNSAFE.getByte(null, struct + TT_PCLT.STROKEWEIGHT); } + /** Unsafe version of {@link #WidthType}. */ + public static byte nWidthType(long struct) { return UNSAFE.getByte(null, struct + TT_PCLT.WIDTHTYPE); } + /** Unsafe version of {@link #SerifStyle}. */ + public static byte nSerifStyle(long struct) { return UNSAFE.getByte(null, struct + TT_PCLT.SERIFSTYLE); } + /** Unsafe version of {@link #Reserved}. */ + public static byte nReserved(long struct) { return UNSAFE.getByte(null, struct + TT_PCLT.RESERVED); } + + // ----------------------------------- + + /** An array of {@link TT_PCLT} structs. */ + public static class Buffer extends StructBuffer { + + private static final TT_PCLT ELEMENT_FACTORY = TT_PCLT.create(-1L); + + /** + * Creates a new {@code TT_PCLT.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 {@link TT_PCLT#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected TT_PCLT getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code Version} field. */ + @NativeType("FT_Fixed") + public long Version() { return TT_PCLT.nVersion(address()); } + /** @return the value of the {@code FontNumber} field. */ + @NativeType("FT_ULong") + public long FontNumber() { return TT_PCLT.nFontNumber(address()); } + /** @return the value of the {@code Pitch} field. */ + @NativeType("FT_UShort") + public short Pitch() { return TT_PCLT.nPitch(address()); } + /** @return the value of the {@code xHeight} field. */ + @NativeType("FT_UShort") + public short xHeight() { return TT_PCLT.nxHeight(address()); } + /** @return the value of the {@code Style} field. */ + @NativeType("FT_UShort") + public short Style() { return TT_PCLT.nStyle(address()); } + /** @return the value of the {@code TypeFamily} field. */ + @NativeType("FT_UShort") + public short TypeFamily() { return TT_PCLT.nTypeFamily(address()); } + /** @return the value of the {@code CapHeight} field. */ + @NativeType("FT_UShort") + public short CapHeight() { return TT_PCLT.nCapHeight(address()); } + /** @return the value of the {@code SymbolSet} field. */ + @NativeType("FT_UShort") + public short SymbolSet() { return TT_PCLT.nSymbolSet(address()); } + /** @return a {@link ByteBuffer} view of the {@code TypeFace} field. */ + @NativeType("FT_Char[16]") + public ByteBuffer TypeFace() { return TT_PCLT.nTypeFace(address()); } + /** @return the value at the specified index of the {@code TypeFace} field. */ + @NativeType("FT_Char") + public byte TypeFace(int index) { return TT_PCLT.nTypeFace(address(), index); } + /** @return a {@link ByteBuffer} view of the {@code CharacterComplement} field. */ + @NativeType("FT_Char[8]") + public ByteBuffer CharacterComplement() { return TT_PCLT.nCharacterComplement(address()); } + /** @return the value at the specified index of the {@code CharacterComplement} field. */ + @NativeType("FT_Char") + public byte CharacterComplement(int index) { return TT_PCLT.nCharacterComplement(address(), index); } + /** @return a {@link ByteBuffer} view of the {@code FileName} field. */ + @NativeType("FT_Char[6]") + public ByteBuffer FileName() { return TT_PCLT.nFileName(address()); } + /** @return the value at the specified index of the {@code FileName} field. */ + @NativeType("FT_Char") + public byte FileName(int index) { return TT_PCLT.nFileName(address(), index); } + /** @return the value of the {@code StrokeWeight} field. */ + @NativeType("FT_Char") + public byte StrokeWeight() { return TT_PCLT.nStrokeWeight(address()); } + /** @return the value of the {@code WidthType} field. */ + @NativeType("FT_Char") + public byte WidthType() { return TT_PCLT.nWidthType(address()); } + /** @return the value of the {@code SerifStyle} field. */ + @NativeType("FT_Byte") + public byte SerifStyle() { return TT_PCLT.nSerifStyle(address()); } + /** @return the value of the {@code Reserved} field. */ + @NativeType("FT_Byte") + public byte Reserved() { return TT_PCLT.nReserved(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_Postscript.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_Postscript.java new file mode 100644 index 00000000..0268220a --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_Postscript.java @@ -0,0 +1,249 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure to model a TrueType 'post' table. + * + *

Layout

+ * + *

+ * struct TT_Postscript {
+ *     FT_Fixed FormatType;
+ *     FT_Fixed italicAngle;
+ *     FT_Short underlinePosition;
+ *     FT_Short underlineThickness;
+ *     FT_ULong isFixedPitch;
+ *     FT_ULong minMemType42;
+ *     FT_ULong maxMemType42;
+ *     FT_ULong minMemType1;
+ *     FT_ULong maxMemType1;
+ * }
+ */ +public class TT_Postscript extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + FORMATTYPE, + ITALICANGLE, + UNDERLINEPOSITION, + UNDERLINETHICKNESS, + ISFIXEDPITCH, + MINMEMTYPE42, + MAXMEMTYPE42, + MINMEMTYPE1, + MAXMEMTYPE1; + + static { + Layout layout = __struct( + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(2), + __member(2), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + FORMATTYPE = layout.offsetof(0); + ITALICANGLE = layout.offsetof(1); + UNDERLINEPOSITION = layout.offsetof(2); + UNDERLINETHICKNESS = layout.offsetof(3); + ISFIXEDPITCH = layout.offsetof(4); + MINMEMTYPE42 = layout.offsetof(5); + MAXMEMTYPE42 = layout.offsetof(6); + MINMEMTYPE1 = layout.offsetof(7); + MAXMEMTYPE1 = layout.offsetof(8); + } + + protected TT_Postscript(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected TT_Postscript create(long address, @Nullable ByteBuffer container) { + return new TT_Postscript(address, container); + } + + /** + * Creates a {@code TT_Postscript} instance at the current position of the specified {@link 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 TT_Postscript(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code FormatType} field. */ + @NativeType("FT_Fixed") + public long FormatType() { return nFormatType(address()); } + /** @return the value of the {@code italicAngle} field. */ + @NativeType("FT_Fixed") + public long italicAngle() { return nitalicAngle(address()); } + /** @return the value of the {@code underlinePosition} field. */ + @NativeType("FT_Short") + public short underlinePosition() { return nunderlinePosition(address()); } + /** @return the value of the {@code underlineThickness} field. */ + @NativeType("FT_Short") + public short underlineThickness() { return nunderlineThickness(address()); } + /** @return the value of the {@code isFixedPitch} field. */ + @NativeType("FT_ULong") + public long isFixedPitch() { return nisFixedPitch(address()); } + /** @return the value of the {@code minMemType42} field. */ + @NativeType("FT_ULong") + public long minMemType42() { return nminMemType42(address()); } + /** @return the value of the {@code maxMemType42} field. */ + @NativeType("FT_ULong") + public long maxMemType42() { return nmaxMemType42(address()); } + /** @return the value of the {@code minMemType1} field. */ + @NativeType("FT_ULong") + public long minMemType1() { return nminMemType1(address()); } + /** @return the value of the {@code maxMemType1} field. */ + @NativeType("FT_ULong") + public long maxMemType1() { return nmaxMemType1(address()); } + + // ----------------------------------- + + /** Returns a new {@code TT_Postscript} instance for the specified memory address. */ + public static TT_Postscript create(long address) { + return new TT_Postscript(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static TT_Postscript createSafe(long address) { + return address == NULL ? null : new TT_Postscript(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #FormatType}. */ + public static long nFormatType(long struct) { return memGetCLong(struct + TT_Postscript.FORMATTYPE); } + /** Unsafe version of {@link #italicAngle}. */ + public static long nitalicAngle(long struct) { return memGetCLong(struct + TT_Postscript.ITALICANGLE); } + /** Unsafe version of {@link #underlinePosition}. */ + public static short nunderlinePosition(long struct) { return UNSAFE.getShort(null, struct + TT_Postscript.UNDERLINEPOSITION); } + /** Unsafe version of {@link #underlineThickness}. */ + public static short nunderlineThickness(long struct) { return UNSAFE.getShort(null, struct + TT_Postscript.UNDERLINETHICKNESS); } + /** Unsafe version of {@link #isFixedPitch}. */ + public static long nisFixedPitch(long struct) { return memGetCLong(struct + TT_Postscript.ISFIXEDPITCH); } + /** Unsafe version of {@link #minMemType42}. */ + public static long nminMemType42(long struct) { return memGetCLong(struct + TT_Postscript.MINMEMTYPE42); } + /** Unsafe version of {@link #maxMemType42}. */ + public static long nmaxMemType42(long struct) { return memGetCLong(struct + TT_Postscript.MAXMEMTYPE42); } + /** Unsafe version of {@link #minMemType1}. */ + public static long nminMemType1(long struct) { return memGetCLong(struct + TT_Postscript.MINMEMTYPE1); } + /** Unsafe version of {@link #maxMemType1}. */ + public static long nmaxMemType1(long struct) { return memGetCLong(struct + TT_Postscript.MAXMEMTYPE1); } + + // ----------------------------------- + + /** An array of {@link TT_Postscript} structs. */ + public static class Buffer extends StructBuffer { + + private static final TT_Postscript ELEMENT_FACTORY = TT_Postscript.create(-1L); + + /** + * Creates a new {@code TT_Postscript.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 {@link TT_Postscript#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected TT_Postscript getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code FormatType} field. */ + @NativeType("FT_Fixed") + public long FormatType() { return TT_Postscript.nFormatType(address()); } + /** @return the value of the {@code italicAngle} field. */ + @NativeType("FT_Fixed") + public long italicAngle() { return TT_Postscript.nitalicAngle(address()); } + /** @return the value of the {@code underlinePosition} field. */ + @NativeType("FT_Short") + public short underlinePosition() { return TT_Postscript.nunderlinePosition(address()); } + /** @return the value of the {@code underlineThickness} field. */ + @NativeType("FT_Short") + public short underlineThickness() { return TT_Postscript.nunderlineThickness(address()); } + /** @return the value of the {@code isFixedPitch} field. */ + @NativeType("FT_ULong") + public long isFixedPitch() { return TT_Postscript.nisFixedPitch(address()); } + /** @return the value of the {@code minMemType42} field. */ + @NativeType("FT_ULong") + public long minMemType42() { return TT_Postscript.nminMemType42(address()); } + /** @return the value of the {@code maxMemType42} field. */ + @NativeType("FT_ULong") + public long maxMemType42() { return TT_Postscript.nmaxMemType42(address()); } + /** @return the value of the {@code minMemType1} field. */ + @NativeType("FT_ULong") + public long minMemType1() { return TT_Postscript.nminMemType1(address()); } + /** @return the value of the {@code maxMemType1} field. */ + @NativeType("FT_ULong") + public long maxMemType1() { return TT_Postscript.nmaxMemType1(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_VertHeader.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_VertHeader.java new file mode 100644 index 00000000..effba0b0 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_VertHeader.java @@ -0,0 +1,364 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.freetype; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure used to model a TrueType vertical header, the {@code vhea} table, as well as the corresponding vertical metrics table, {@code vmtx}. + * + *

Layout

+ * + *

+ * struct TT_VertHeader {
+ *     FT_Fixed Version;
+ *     FT_Short Ascender;
+ *     FT_Short Descender;
+ *     FT_Short Line_Gap;
+ *     FT_UShort {@link #advance_Height_Max};
+ *     FT_Short {@link #min_Top_Side_Bearing};
+ *     FT_Short {@link #min_Bottom_Side_Bearing};
+ *     FT_Short {@link #yMax_Extent};
+ *     FT_Short caret_Slope_Rise;
+ *     FT_Short caret_Slope_Run;
+ *     FT_Short caret_Offset;
+ *     FT_Short Reserved[4];
+ *     FT_Short metric_Data_Format;
+ *     FT_UShort number_Of_VMetrics;
+ *     void * long_metrics;
+ *     void * short_metrics;
+ * }
+ */ +public class TT_VertHeader extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + VERSION, + ASCENDER, + DESCENDER, + LINE_GAP, + ADVANCE_HEIGHT_MAX, + MIN_TOP_SIDE_BEARING, + MIN_BOTTOM_SIDE_BEARING, + YMAX_EXTENT, + CARET_SLOPE_RISE, + CARET_SLOPE_RUN, + CARET_OFFSET, + RESERVED, + METRIC_DATA_FORMAT, + NUMBER_OF_VMETRICS, + LONG_METRICS, + SHORT_METRICS; + + static { + Layout layout = __struct( + __member(CLONG_SIZE), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __array(2, 4), + __member(2), + __member(2), + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + VERSION = layout.offsetof(0); + ASCENDER = layout.offsetof(1); + DESCENDER = layout.offsetof(2); + LINE_GAP = layout.offsetof(3); + ADVANCE_HEIGHT_MAX = layout.offsetof(4); + MIN_TOP_SIDE_BEARING = layout.offsetof(5); + MIN_BOTTOM_SIDE_BEARING = layout.offsetof(6); + YMAX_EXTENT = layout.offsetof(7); + CARET_SLOPE_RISE = layout.offsetof(8); + CARET_SLOPE_RUN = layout.offsetof(9); + CARET_OFFSET = layout.offsetof(10); + RESERVED = layout.offsetof(11); + METRIC_DATA_FORMAT = layout.offsetof(12); + NUMBER_OF_VMETRICS = layout.offsetof(13); + LONG_METRICS = layout.offsetof(14); + SHORT_METRICS = layout.offsetof(15); + } + + protected TT_VertHeader(long address, @Nullable ByteBuffer container) { + super(address, container); + } + + @Override + protected TT_VertHeader create(long address, @Nullable ByteBuffer container) { + return new TT_VertHeader(address, container); + } + + /** + * Creates a {@code TT_VertHeader} instance at the current position of the specified {@link 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 TT_VertHeader(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code Version} field. */ + @NativeType("FT_Fixed") + public long Version() { return nVersion(address()); } + /** @return the value of the {@code Ascender} field. */ + @NativeType("FT_Short") + public short Ascender() { return nAscender(address()); } + /** @return the value of the {@code Descender} field. */ + @NativeType("FT_Short") + public short Descender() { return nDescender(address()); } + /** @return the value of the {@code Line_Gap} field. */ + @NativeType("FT_Short") + public short Line_Gap() { return nLine_Gap(address()); } + /** advance height maximum */ + @NativeType("FT_UShort") + public short advance_Height_Max() { return nadvance_Height_Max(address()); } + /** minimum top-sb */ + @NativeType("FT_Short") + public short min_Top_Side_Bearing() { return nmin_Top_Side_Bearing(address()); } + /** minimum bottom-sb */ + @NativeType("FT_Short") + public short min_Bottom_Side_Bearing() { return nmin_Bottom_Side_Bearing(address()); } + /** ymax extents */ + @NativeType("FT_Short") + public short yMax_Extent() { return nyMax_Extent(address()); } + /** @return the value of the {@code caret_Slope_Rise} field. */ + @NativeType("FT_Short") + public short caret_Slope_Rise() { return ncaret_Slope_Rise(address()); } + /** @return the value of the {@code caret_Slope_Run} field. */ + @NativeType("FT_Short") + public short caret_Slope_Run() { return ncaret_Slope_Run(address()); } + /** @return the value of the {@code caret_Offset} field. */ + @NativeType("FT_Short") + public short caret_Offset() { return ncaret_Offset(address()); } + /** @return a {@link ShortBuffer} view of the {@code Reserved} field. */ + @NativeType("FT_Short[4]") + public ShortBuffer Reserved() { return nReserved(address()); } + /** @return the value at the specified index of the {@code Reserved} field. */ + @NativeType("FT_Short") + public short Reserved(int index) { return nReserved(address(), index); } + /** @return the value of the {@code metric_Data_Format} field. */ + @NativeType("FT_Short") + public short metric_Data_Format() { return nmetric_Data_Format(address()); } + /** @return the value of the {@code number_Of_VMetrics} field. */ + @NativeType("FT_UShort") + public short number_Of_VMetrics() { return nnumber_Of_VMetrics(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code long_metrics} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void *") + public ByteBuffer long_metrics(int capacity) { return nlong_metrics(address(), capacity); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code short_metrics} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void *") + public ByteBuffer short_metrics(int capacity) { return nshort_metrics(address(), capacity); } + + // ----------------------------------- + + /** Returns a new {@code TT_VertHeader} instance for the specified memory address. */ + public static TT_VertHeader create(long address) { + return new TT_VertHeader(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static TT_VertHeader createSafe(long address) { + return address == NULL ? null : new TT_VertHeader(address, null); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return new Buffer(address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : new Buffer(address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #Version}. */ + public static long nVersion(long struct) { return memGetCLong(struct + TT_VertHeader.VERSION); } + /** Unsafe version of {@link #Ascender}. */ + public static short nAscender(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.ASCENDER); } + /** Unsafe version of {@link #Descender}. */ + public static short nDescender(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.DESCENDER); } + /** Unsafe version of {@link #Line_Gap}. */ + public static short nLine_Gap(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.LINE_GAP); } + /** Unsafe version of {@link #advance_Height_Max}. */ + public static short nadvance_Height_Max(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.ADVANCE_HEIGHT_MAX); } + /** Unsafe version of {@link #min_Top_Side_Bearing}. */ + public static short nmin_Top_Side_Bearing(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.MIN_TOP_SIDE_BEARING); } + /** Unsafe version of {@link #min_Bottom_Side_Bearing}. */ + public static short nmin_Bottom_Side_Bearing(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.MIN_BOTTOM_SIDE_BEARING); } + /** Unsafe version of {@link #yMax_Extent}. */ + public static short nyMax_Extent(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.YMAX_EXTENT); } + /** Unsafe version of {@link #caret_Slope_Rise}. */ + public static short ncaret_Slope_Rise(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.CARET_SLOPE_RISE); } + /** Unsafe version of {@link #caret_Slope_Run}. */ + public static short ncaret_Slope_Run(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.CARET_SLOPE_RUN); } + /** Unsafe version of {@link #caret_Offset}. */ + public static short ncaret_Offset(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.CARET_OFFSET); } + /** Unsafe version of {@link #Reserved}. */ + public static ShortBuffer nReserved(long struct) { return memShortBuffer(struct + TT_VertHeader.RESERVED, 4); } + /** Unsafe version of {@link #Reserved(int) Reserved}. */ + public static short nReserved(long struct, int index) { + return UNSAFE.getShort(null, struct + TT_VertHeader.RESERVED + check(index, 4) * 2); + } + /** Unsafe version of {@link #metric_Data_Format}. */ + public static short nmetric_Data_Format(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.METRIC_DATA_FORMAT); } + /** Unsafe version of {@link #number_Of_VMetrics}. */ + public static short nnumber_Of_VMetrics(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.NUMBER_OF_VMETRICS); } + /** Unsafe version of {@link #long_metrics(int) long_metrics}. */ + @Nullable public static ByteBuffer nlong_metrics(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + TT_VertHeader.LONG_METRICS), capacity); } + /** Unsafe version of {@link #short_metrics(int) short_metrics}. */ + @Nullable public static ByteBuffer nshort_metrics(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + TT_VertHeader.SHORT_METRICS), capacity); } + + // ----------------------------------- + + /** An array of {@link TT_VertHeader} structs. */ + public static class Buffer extends StructBuffer { + + private static final TT_VertHeader ELEMENT_FACTORY = TT_VertHeader.create(-1L); + + /** + * Creates a new {@code TT_VertHeader.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 {@link TT_VertHeader#SIZEOF}, and its mark will be undefined.

+ * + *

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

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected TT_VertHeader getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code Version} field. */ + @NativeType("FT_Fixed") + public long Version() { return TT_VertHeader.nVersion(address()); } + /** @return the value of the {@code Ascender} field. */ + @NativeType("FT_Short") + public short Ascender() { return TT_VertHeader.nAscender(address()); } + /** @return the value of the {@code Descender} field. */ + @NativeType("FT_Short") + public short Descender() { return TT_VertHeader.nDescender(address()); } + /** @return the value of the {@code Line_Gap} field. */ + @NativeType("FT_Short") + public short Line_Gap() { return TT_VertHeader.nLine_Gap(address()); } + /** @return the value of the {@link TT_VertHeader#advance_Height_Max} field. */ + @NativeType("FT_UShort") + public short advance_Height_Max() { return TT_VertHeader.nadvance_Height_Max(address()); } + /** @return the value of the {@link TT_VertHeader#min_Top_Side_Bearing} field. */ + @NativeType("FT_Short") + public short min_Top_Side_Bearing() { return TT_VertHeader.nmin_Top_Side_Bearing(address()); } + /** @return the value of the {@link TT_VertHeader#min_Bottom_Side_Bearing} field. */ + @NativeType("FT_Short") + public short min_Bottom_Side_Bearing() { return TT_VertHeader.nmin_Bottom_Side_Bearing(address()); } + /** @return the value of the {@link TT_VertHeader#yMax_Extent} field. */ + @NativeType("FT_Short") + public short yMax_Extent() { return TT_VertHeader.nyMax_Extent(address()); } + /** @return the value of the {@code caret_Slope_Rise} field. */ + @NativeType("FT_Short") + public short caret_Slope_Rise() { return TT_VertHeader.ncaret_Slope_Rise(address()); } + /** @return the value of the {@code caret_Slope_Run} field. */ + @NativeType("FT_Short") + public short caret_Slope_Run() { return TT_VertHeader.ncaret_Slope_Run(address()); } + /** @return the value of the {@code caret_Offset} field. */ + @NativeType("FT_Short") + public short caret_Offset() { return TT_VertHeader.ncaret_Offset(address()); } + /** @return a {@link ShortBuffer} view of the {@code Reserved} field. */ + @NativeType("FT_Short[4]") + public ShortBuffer Reserved() { return TT_VertHeader.nReserved(address()); } + /** @return the value at the specified index of the {@code Reserved} field. */ + @NativeType("FT_Short") + public short Reserved(int index) { return TT_VertHeader.nReserved(address(), index); } + /** @return the value of the {@code metric_Data_Format} field. */ + @NativeType("FT_Short") + public short metric_Data_Format() { return TT_VertHeader.nmetric_Data_Format(address()); } + /** @return the value of the {@code number_Of_VMetrics} field. */ + @NativeType("FT_UShort") + public short number_Of_VMetrics() { return TT_VertHeader.nnumber_Of_VMetrics(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code long_metrics} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void *") + public ByteBuffer long_metrics(int capacity) { return TT_VertHeader.nlong_metrics(address(), capacity); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code short_metrics} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void *") + public ByteBuffer short_metrics(int capacity) { return TT_VertHeader.nshort_metrics(address(), capacity); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/package-info.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/package-info.java new file mode 100644 index 00000000..13e53fdb --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/package-info.java @@ -0,0 +1,15 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ + +/** + * Contains bindings to the FreeType, a freely available software library to render fonts. + * + *

It is written in C, designed to be small, efficient, highly customizable, and portable while capable of producing high-quality output (glyph images) of + * most vector and bitmap font formats.

+ */ +@org.lwjgl.system.NonnullDefault +package org.lwjgl.util.freetype; +