public final class ImFontAtlas extends ImGuiStructDestroyable
ptr
Constructor and Description |
---|
ImFontAtlas() |
ImFontAtlas(long ptr) |
Modifier and Type | Method and Description |
---|---|
int |
addCustomRectFontGlyph(ImFont imFont,
short id,
int width,
int height,
float advanceX)
Id needs to be
< 0x110000 to register a rectangle to map into a specific font. |
int |
addCustomRectFontGlyph(ImFont imFont,
short id,
int width,
int height,
float advanceX,
float offsetX,
float offsetY)
Id needs to be
< 0x110000 to register a rectangle to map into a specific font. |
int |
addCustomRectFontGlyph(ImFont imFont,
short id,
int width,
int height,
float advanceX,
ImVec2 offset)
Id needs to be
< 0x110000 to register a rectangle to map into a specific font. |
int |
addCustomRectRegular(int width,
int height) |
void |
addFlags(int flags)
Build flags (see
ImFontAtlasFlags ) |
ImFont |
addFont(ImFontConfig imFontConfig) |
ImFont |
addFontDefault() |
ImFont |
addFontDefault(ImFontConfig imFontConfig) |
ImFont |
addFontFromFileTTF(java.lang.String filename,
float sizePixels) |
ImFont |
addFontFromFileTTF(java.lang.String filename,
float sizePixels,
ImFontConfig fontConfig) |
ImFont |
addFontFromFileTTF(java.lang.String filename,
float sizePixels,
ImFontConfig fontConfig,
short[] glyphRanges) |
ImFont |
addFontFromFileTTF(java.lang.String filename,
float sizePixels,
short[] glyphRanges) |
ImFont |
addFontFromMemoryCompressedBase85TTF(java.lang.String compressedFontDataBase85,
float sizePixels,
ImFontConfig fontConfig)
'compressed_font_data_base85' still owned by caller.
|
ImFont |
addFontFromMemoryCompressedBase85TTF(java.lang.String compressedFontDataBase85,
float sizePixels,
ImFontConfig fontConfig,
short[] glyphRanges)
'compressed_font_data_base85' still owned by caller.
|
ImFont |
addFontFromMemoryCompressedTTF(byte[] compressedFontData,
float sizePixels)
'compressed_font_data' still owned by caller.
|
ImFont |
addFontFromMemoryCompressedTTF(byte[] compressedFontData,
float sizePixels,
ImFontConfig imFontConfig)
'compressed_font_data' still owned by caller.
|
ImFont |
addFontFromMemoryCompressedTTF(byte[] compressedFontData,
float sizePixels,
ImFontConfig imFontConfig,
short[] glyphRanges)
'compressed_font_data' still owned by caller.
|
ImFont |
addFontFromMemoryCompressedTTF(byte[] compressedFontData,
float sizePixels,
short[] glyphRanges)
'compressed_font_data' still owned by caller.
|
ImFont |
addFontFromMemoryCompressedTTF(byte[] compressedFontData,
int compressedFontSize,
float sizePixels)
'compressed_font_data' still owned by caller.
|
ImFont |
addFontFromMemoryCompressedTTF(byte[] compressedFontData,
int compressedFontSize,
float sizePixels,
ImFontConfig imFontConfig)
'compressed_font_data' still owned by caller.
|
ImFont |
addFontFromMemoryCompressedTTF(byte[] compressedFontData,
int compressedFontSize,
float sizePixels,
ImFontConfig imFontConfig,
short[] glyphRanges)
'compressed_font_data' still owned by caller.
|
ImFont |
addFontFromMemoryCompressedTTF(byte[] compressedFontData,
int compressedFontSize,
float sizePixels,
short[] glyphRanges)
'compressed_font_data' still owned by caller.
|
ImFont |
addFontFromMemoryTTF(byte[] fontData,
float sizePixels)
Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas.
|
ImFont |
addFontFromMemoryTTF(byte[] fontData,
float sizePixels,
ImFontConfig fontConfig)
Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas.
|
ImFont |
addFontFromMemoryTTF(byte[] fontData,
float sizePixels,
ImFontConfig fontConfig,
short[] glyphRanges)
Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas.
|
ImFont |
addFontFromMemoryTTF(byte[] fontData,
float sizePixels,
short[] glyphRanges)
Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas.
|
ImFont |
addFontFromMemoryTTF(byte[] fontData,
int fontSize,
float sizePixels)
Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas.
|
ImFont |
addFontFromMemoryTTF(byte[] fontData,
int fontSize,
float sizePixels,
ImFontConfig fontConfig)
Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas.
|
ImFont |
addFontFromMemoryTTF(byte[] fontData,
int fontSize,
float sizePixels,
ImFontConfig fontConfig,
short[] glyphRanges)
Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas.
|
ImFont |
addFontFromMemoryTTF(byte[] fontData,
int fontSize,
float sizePixels,
short[] glyphRanges)
Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas.
|
boolean |
build()
Build pixels data.
|
void |
clear()
Clear all input and output.
|
void |
clearFonts()
Clear output font data (glyphs storage, UV coordinates).
|
void |
clearInputData()
Clear input data (all ImFontConfig structures including sizes, TTF data, glyph ranges, etc.) = all the data used to build the texture and fonts.
|
void |
clearTexData()
Clear output texture data (CPU side).
|
protected long |
create() |
int |
getFlags()
Build flags (see
ImFontAtlasFlags ) |
short[] |
getGlyphRangesChineseFull()
Default + Half-Width + Japanese Hiragana/Katakana + full set of about 21000 CJK Unified Ideographs
|
short[] |
getGlyphRangesChineseSimplifiedCommon()
Default + Half-Width + Japanese Hiragana/Katakana + set of 2500 CJK Unified Ideographs for common simplified Chinese
|
short[] |
getGlyphRangesCyrillic()
Default + about 400 Cyrillic characters
|
short[] |
getGlyphRangesDefault()
Basic Latin, Extended Latin
|
short[] |
getGlyphRangesJapanese()
Default + Hiragana, Katakana, Half-Width, Selection of 2999 Ideographs
|
short[] |
getGlyphRangesKorean()
Default + Korean characters
|
short[] |
getGlyphRangesThai()
Default + Thai characters
|
short[] |
getGlyphRangesVietnamese()
Default + Vietnamese characters
|
boolean |
getLocked()
Marked as Locked by ImGui::NewFrame() so attempt to modify the atlas will assert.
|
java.nio.ByteBuffer |
getTexDataAsAlpha8(ImInt outWidth,
ImInt outHeight)
1 byte-per-pixel
|
java.nio.ByteBuffer |
getTexDataAsAlpha8(ImInt outWidth,
ImInt outHeight,
ImInt outBytesPerPixel)
1 byte-per-pixel
|
java.nio.ByteBuffer |
getTexDataAsRGBA32(ImInt outWidth,
ImInt outHeight)
4 bytes-per-pixel
|
java.nio.ByteBuffer |
getTexDataAsRGBA32(ImInt outWidth,
ImInt outHeight,
ImInt outBytesPerPixel)
4 bytes-per-pixel
|
int |
getTexDesiredWidth()
Texture width desired by user before Build().
|
int |
getTexGlyphPadding()
Padding between glyphs within texture in pixels.
|
boolean |
hasFlags(int flags)
Build flags (see
ImFontAtlasFlags ) |
boolean |
isBuilt() |
void |
removeFlags(int flags)
Build flags (see
ImFontAtlasFlags ) |
void |
setFlags(int value)
Build flags (see
ImFontAtlasFlags ) |
void |
setFreeTypeRenderer(boolean enabled)
BINDING NOTICE: This method is specific to the imgui-java binding.
|
void |
setLocked(boolean value)
Marked as Locked by ImGui::NewFrame() so attempt to modify the atlas will assert.
|
void |
setTexDesiredWidth(int value)
Texture width desired by user before Build().
|
void |
setTexGlyphPadding(int value)
Padding between glyphs within texture in pixels.
|
void |
setTexID(long textureID)
User data to refer to the texture once it has been uploaded to user's graphic systems.
|
destroy
isNotValidPtr, isValidPtr
protected long create()
create
in class ImGuiStructDestroyable
public ImFont addFont(ImFontConfig imFontConfig)
public ImFont addFontDefault()
public ImFont addFontDefault(ImFontConfig imFontConfig)
public ImFont addFontFromFileTTF(java.lang.String filename, float sizePixels)
public ImFont addFontFromFileTTF(java.lang.String filename, float sizePixels, ImFontConfig fontConfig)
public ImFont addFontFromFileTTF(java.lang.String filename, float sizePixels, ImFontConfig fontConfig, short[] glyphRanges)
public ImFont addFontFromFileTTF(java.lang.String filename, float sizePixels, short[] glyphRanges)
public ImFont addFontFromMemoryTTF(byte[] fontData, float sizePixels)
public ImFont addFontFromMemoryTTF(byte[] fontData, float sizePixels, ImFontConfig fontConfig)
public ImFont addFontFromMemoryTTF(byte[] fontData, float sizePixels, ImFontConfig fontConfig, short[] glyphRanges)
public ImFont addFontFromMemoryTTF(byte[] fontData, float sizePixels, short[] glyphRanges)
public ImFont addFontFromMemoryTTF(byte[] fontData, int fontSize, float sizePixels)
public ImFont addFontFromMemoryTTF(byte[] fontData, int fontSize, float sizePixels, ImFontConfig fontConfig)
public ImFont addFontFromMemoryTTF(byte[] fontData, int fontSize, float sizePixels, ImFontConfig fontConfig, short[] glyphRanges)
public ImFont addFontFromMemoryTTF(byte[] fontData, int fontSize, float sizePixels, short[] glyphRanges)
public ImFont addFontFromMemoryCompressedTTF(byte[] compressedFontData, float sizePixels)
public ImFont addFontFromMemoryCompressedTTF(byte[] compressedFontData, float sizePixels, ImFontConfig imFontConfig)
public ImFont addFontFromMemoryCompressedTTF(byte[] compressedFontData, float sizePixels, ImFontConfig imFontConfig, short[] glyphRanges)
public ImFont addFontFromMemoryCompressedTTF(byte[] compressedFontData, float sizePixels, short[] glyphRanges)
public ImFont addFontFromMemoryCompressedTTF(byte[] compressedFontData, int compressedFontSize, float sizePixels)
public ImFont addFontFromMemoryCompressedTTF(byte[] compressedFontData, int compressedFontSize, float sizePixels, ImFontConfig imFontConfig)
public ImFont addFontFromMemoryCompressedTTF(byte[] compressedFontData, int compressedFontSize, float sizePixels, ImFontConfig imFontConfig, short[] glyphRanges)
public ImFont addFontFromMemoryCompressedTTF(byte[] compressedFontData, int compressedFontSize, float sizePixels, short[] glyphRanges)
public ImFont addFontFromMemoryCompressedBase85TTF(java.lang.String compressedFontDataBase85, float sizePixels, ImFontConfig fontConfig)
public ImFont addFontFromMemoryCompressedBase85TTF(java.lang.String compressedFontDataBase85, float sizePixels, ImFontConfig fontConfig, short[] glyphRanges)
public void clearInputData()
public void clearTexData()
public void clearFonts()
public void clear()
public void setFreeTypeRenderer(boolean enabled)
Since FreeType is included in the final build, it's possible to use both font renderers (STB_TrueType and FreeType) simultaneously without needing to rebuild the library. By default, we use small hacks to set STB_TrueType as the default font renderer. However, this method allows you to enforce the use of the FreeType renderer.
This method MUST be called before invoking the "#build" or "#getTexData*" methods.
enabled
- true to enable the FreeType font rendererpublic boolean build()
public java.nio.ByteBuffer getTexDataAsAlpha8(ImInt outWidth, ImInt outHeight)
public java.nio.ByteBuffer getTexDataAsAlpha8(ImInt outWidth, ImInt outHeight, ImInt outBytesPerPixel)
public java.nio.ByteBuffer getTexDataAsRGBA32(ImInt outWidth, ImInt outHeight)
public java.nio.ByteBuffer getTexDataAsRGBA32(ImInt outWidth, ImInt outHeight, ImInt outBytesPerPixel)
public boolean isBuilt()
public void setTexID(long textureID)
public short[] getGlyphRangesDefault()
public short[] getGlyphRangesKorean()
public short[] getGlyphRangesJapanese()
public short[] getGlyphRangesChineseFull()
public short[] getGlyphRangesChineseSimplifiedCommon()
public short[] getGlyphRangesCyrillic()
public short[] getGlyphRangesThai()
public short[] getGlyphRangesVietnamese()
public int addCustomRectRegular(int width, int height)
public int addCustomRectFontGlyph(ImFont imFont, short id, int width, int height, float advanceX)
<
0x110000 to register a rectangle to map into a specific font.public int addCustomRectFontGlyph(ImFont imFont, short id, int width, int height, float advanceX, ImVec2 offset)
<
0x110000 to register a rectangle to map into a specific font.public int addCustomRectFontGlyph(ImFont imFont, short id, int width, int height, float advanceX, float offsetX, float offsetY)
<
0x110000 to register a rectangle to map into a specific font.public int getFlags()
ImFontAtlasFlags
)public void setFlags(int value)
ImFontAtlasFlags
)public void addFlags(int flags)
ImFontAtlasFlags
)public void removeFlags(int flags)
ImFontAtlasFlags
)public boolean hasFlags(int flags)
ImFontAtlasFlags
)public int getTexDesiredWidth()
public void setTexDesiredWidth(int value)
public int getTexGlyphPadding()
public void setTexGlyphPadding(int value)
public boolean getLocked()
public void setLocked(boolean value)