Package org.lwjgl.util.msdfgen
Class MSDFGenExt
java.lang.Object
org.lwjgl.util.msdfgen.MSDFGenExt
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intEnum values:static final intEnum values:static final intEnum values: -
Method Summary
Modifier and TypeMethodDescriptionstatic intmsdf_ft_adopt_font(long face, org.lwjgl.PointerBuffer font) Adopts the given FreeTypeFT_Facepointer as a font handle.static voidmsdf_ft_deinit(long handle) Frees the underlying FreeType instance of the given context.static voidmsdf_ft_font_destroy(long font) Frees the underlying instance of the given FreeType font.static intmsdf_ft_font_get_glyph_index(long font, int cp, IntBuffer index) Retrieves the glyph index of the given unicode codepoint.static intmsdf_ft_font_get_kerning(long font, int cp1, int cp2, DoubleBuffer kerning) Retrieves the kerning between the two given codepoints.static intmsdf_ft_font_get_kerning_by_index(long font, int index1, int index2, DoubleBuffer kerning) etrieves the kerning between the two given glyphs.static intmsdf_ft_font_load_glyph(long font, int cp, int coordinateScaling, org.lwjgl.PointerBuffer shape) Loads a single glyph from the given font and converts it into a vector shape for rendering glyph sprites.static intmsdf_ft_font_load_glyph_by_index(long font, int index, int coordinateScaling, org.lwjgl.PointerBuffer shape) Loads a single glyph from the given font and converts it into a vector shape for rendering glyph sprites.static @Nullable MSDFGenFTLoadCallbackRetrieves the current FreeType load callback.static intmsdf_ft_init(org.lwjgl.PointerBuffer handle) Initializes a new FreeType instance to be used with msdfgen.static intmsdf_ft_load_font(long handle, CharSequence fileName, org.lwjgl.PointerBuffer font) Loads a TrueType font from the given file(path) and populates the given font handle with the address of the newly loaded font.static intmsdf_ft_load_font(long handle, ByteBuffer fileName, org.lwjgl.PointerBuffer font) Loads a TrueType font from the given file(path) and populates the given font handle with the address of the newly loaded font.static intmsdf_ft_load_font_data(long handle, ByteBuffer data, org.lwjgl.PointerBuffer font) Loads a TrueType font from the given buffer and populates the given font handle with the address of the newly loaded font.static intOverrides the default load callback function used for resolving FreeType function at runtime.static intnmsdf_ft_adopt_font(long face, long font) Unsafe version of:ft_adopt_fontstatic voidnmsdf_ft_deinit(long handle) Unsafe version of:ft_deinitstatic voidnmsdf_ft_font_destroy(long font) Unsafe version of:ft_font_destroystatic intnmsdf_ft_font_get_glyph_index(long font, int cp, long index) Unsafe version of:ft_font_get_glyph_indexstatic intnmsdf_ft_font_get_kerning(long font, int cp1, int cp2, long kerning) Unsafe version of:ft_font_get_kerningstatic intnmsdf_ft_font_get_kerning_by_index(long font, int index1, int index2, long kerning) Unsafe version of:ft_font_get_kerning_by_indexstatic intnmsdf_ft_font_load_glyph(long font, int cp, int coordinateScaling, long shape) Unsafe version of:ft_font_load_glyphstatic intnmsdf_ft_font_load_glyph_by_index(long font, int index, int coordinateScaling, long shape) Unsafe version of:ft_font_load_glyph_by_indexstatic longUnsafe version of:ft_get_load_callbackstatic intnmsdf_ft_init(long handle) Unsafe version of:ft_initstatic intnmsdf_ft_load_font(long handle, long fileName, long font) Unsafe version of:ft_load_fontstatic intnmsdf_ft_load_font_data(long handle, long data, long size, long font) Unsafe version of:ft_load_font_datastatic intnmsdf_ft_set_load_callback(long callback) Unsafe version of:ft_set_load_callback
-
Field Details
-
MSDF_FONT_SCALING_NONE
public static final int MSDF_FONT_SCALING_NONEEnum values:
FONT_SCALING_NONE- The coordinates are kept as the integer values native to the font file.FONT_SCALING_EM_NORMALIZED- The coordinates will be normalized to the em size, i.e. 1 = 1 em.FONT_SCALING_LEGACY- The incorrect legacy version that was in effect before version 1.12, coordinate values are divided by 64 - DO NOT USE - for backwards compatibility only.
- See Also:
-
MSDF_FONT_SCALING_EM_NORMALIZED
public static final int MSDF_FONT_SCALING_EM_NORMALIZEDEnum values:
FONT_SCALING_NONE- The coordinates are kept as the integer values native to the font file.FONT_SCALING_EM_NORMALIZED- The coordinates will be normalized to the em size, i.e. 1 = 1 em.FONT_SCALING_LEGACY- The incorrect legacy version that was in effect before version 1.12, coordinate values are divided by 64 - DO NOT USE - for backwards compatibility only.
- See Also:
-
MSDF_FONT_SCALING_LEGACY
public static final int MSDF_FONT_SCALING_LEGACYEnum values:
FONT_SCALING_NONE- The coordinates are kept as the integer values native to the font file.FONT_SCALING_EM_NORMALIZED- The coordinates will be normalized to the em size, i.e. 1 = 1 em.FONT_SCALING_LEGACY- The incorrect legacy version that was in effect before version 1.12, coordinate values are divided by 64 - DO NOT USE - for backwards compatibility only.
- See Also:
-
-
Method Details
-
nmsdf_ft_set_load_callback
public static int nmsdf_ft_set_load_callback(long callback) Unsafe version of:ft_set_load_callback -
msdf_ft_set_load_callback
Overrides the default load callback function used for resolving FreeType function at runtime.- Parameters:
callback- a pointer to the function to call for resolving FreeType functions at runtime- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_ft_get_load_callback
public static long nmsdf_ft_get_load_callback()Unsafe version of:ft_get_load_callback -
msdf_ft_get_load_callback
Retrieves the current FreeType load callback.- Returns:
- a pointer to the current FreeType load callback function
-
nmsdf_ft_init
public static int nmsdf_ft_init(long handle) Unsafe version of:ft_init -
msdf_ft_init
public static int msdf_ft_init(org.lwjgl.PointerBuffer handle) Initializes a new FreeType instance to be used with msdfgen.- Parameters:
handle- a pointer to a handle to be populated with a new FreeType context- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_ft_load_font
public static int nmsdf_ft_load_font(long handle, long fileName, long font) Unsafe version of:ft_load_font -
msdf_ft_load_font
Loads a TrueType font from the given file(path) and populates the given font handle with the address of the newly loaded font.- Parameters:
handle- the handle to the FreeType context to use for loading the fontfileName- the name or path of/to the font file to loadfont- a pointer to a font handle to be populated with the address of the newly loaded font- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
msdf_ft_load_font
public static int msdf_ft_load_font(long handle, CharSequence fileName, org.lwjgl.PointerBuffer font) Loads a TrueType font from the given file(path) and populates the given font handle with the address of the newly loaded font.- Parameters:
handle- the handle to the FreeType context to use for loading the fontfileName- the name or path of/to the font file to loadfont- a pointer to a font handle to be populated with the address of the newly loaded font- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_ft_adopt_font
public static int nmsdf_ft_adopt_font(long face, long font) Unsafe version of:ft_adopt_font -
msdf_ft_adopt_font
public static int msdf_ft_adopt_font(long face, org.lwjgl.PointerBuffer font) Adopts the given FreeTypeFT_Facepointer as a font handle.- Parameters:
face- an opaque pointer to theFT_Faceto adoptfont- a pointer to an address to be populated with the newly allocated font handle- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_ft_load_font_data
public static int nmsdf_ft_load_font_data(long handle, long data, long size, long font) Unsafe version of:ft_load_font_data- Parameters:
size- the size of the data buffer in bytes
-
msdf_ft_load_font_data
public static int msdf_ft_load_font_data(long handle, ByteBuffer data, org.lwjgl.PointerBuffer font) Loads a TrueType font from the given buffer and populates the given font handle with the address of the newly loaded font.- Parameters:
handle- the handle to the FreeType context to use for loading the fontdata- a pointer to the raw data of the TrueType font to loadfont- a pointer to a font handle to be populated with the address of the newly loaded font- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_ft_font_load_glyph
public static int nmsdf_ft_font_load_glyph(long font, int cp, int coordinateScaling, long shape) Unsafe version of:ft_font_load_glyph -
msdf_ft_font_load_glyph
public static int msdf_ft_font_load_glyph(long font, int cp, int coordinateScaling, org.lwjgl.PointerBuffer shape) Loads a single glyph from the given font and converts it into a vector shape for rendering glyph sprites.- Parameters:
font- a handle to the font to use for generating the glyph shapecp- the codepoint to generate a shape forcoordinateScaling- the coordinate scaling to use. One of:FONT_SCALING_NONEFONT_SCALING_EM_NORMALIZEDFONT_SCALING_LEGACYshape- a pointer to a handle to be populated with the address of the newly created shape.This shape must later be freed using
shape_free!- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_ft_font_load_glyph_by_index
public static int nmsdf_ft_font_load_glyph_by_index(long font, int index, int coordinateScaling, long shape) Unsafe version of:ft_font_load_glyph_by_index -
msdf_ft_font_load_glyph_by_index
public static int msdf_ft_font_load_glyph_by_index(long font, int index, int coordinateScaling, org.lwjgl.PointerBuffer shape) Loads a single glyph from the given font and converts it into a vector shape for rendering glyph sprites.- Parameters:
font- a handle to the font to use for generating the glyph shapeindex- the glyph index to generate a shape forcoordinateScaling- the coordinate scaling to use. One of:FONT_SCALING_NONEFONT_SCALING_EM_NORMALIZEDFONT_SCALING_LEGACYshape- a pointer to a handle to be populated with the address of the newly created shape.This shape must later be freed using
shape_free!- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_ft_font_get_glyph_index
public static int nmsdf_ft_font_get_glyph_index(long font, int cp, long index) Unsafe version of:ft_font_get_glyph_index -
msdf_ft_font_get_glyph_index
Retrieves the glyph index of the given unicode codepoint.- Parameters:
font- a handle to the font to retrieve the glyph index fromcp- the codepoint to retrieve the glyph index forindex- a pointer to the glyph index to be retrieved- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_ft_font_get_kerning
public static int nmsdf_ft_font_get_kerning(long font, int cp1, int cp2, long kerning) Unsafe version of:ft_font_get_kerning -
msdf_ft_font_get_kerning
Retrieves the kerning between the two given codepoints.- Parameters:
font- a handle to the font to retrieve the kerning fromcp1- the left codepointcp2- the right codepointkerning- a pointer to the kerning value to be retrieved- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_ft_font_get_kerning_by_index
public static int nmsdf_ft_font_get_kerning_by_index(long font, int index1, int index2, long kerning) Unsafe version of:ft_font_get_kerning_by_index -
msdf_ft_font_get_kerning_by_index
public static int msdf_ft_font_get_kerning_by_index(long font, int index1, int index2, DoubleBuffer kerning) etrieves the kerning between the two given glyphs.- Parameters:
font- a handle to the font to retrieve the kerning fromindex1- the glyph index of the left glyphindex2- the glyph index of the right glyphkerning- a pointer to the kerning value to be retrieved- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_ft_font_destroy
public static void nmsdf_ft_font_destroy(long font) Unsafe version of:ft_font_destroy -
msdf_ft_font_destroy
public static void msdf_ft_font_destroy(long font) Frees the underlying instance of the given FreeType font.- Parameters:
font- the handle to the font to free
-
nmsdf_ft_deinit
public static void nmsdf_ft_deinit(long handle) Unsafe version of:ft_deinit -
msdf_ft_deinit
public static void msdf_ft_deinit(long handle) Frees the underlying FreeType instance of the given context.- Parameters:
handle- the handle to the FreeType context to free
-