ImFontAtlas

imguicpp.ImFontAtlas (extern class)

Static Members

addFont(self: cpp.Star, fontCfg: cpp.Star): cpp.Star
Name Type
self cpp.Star
fontCfg cpp.Star
Returns
cpp.Star

addFontDefault(self: cpp.Star, ?fontCfg: cpp.Star = null): cpp.Star

Selects between AddFontDefaultVector() and AddFontDefaultBitmap().

Name Type Default
self cpp.Star
fontCfg cpp.Star null
Returns
cpp.Star

addFontDefaultVector(self: cpp.Star, ?fontCfg: cpp.Star = null): cpp.Star

Embedded scalable font. Recommended at any higher size.

Name Type Default
self cpp.Star
fontCfg cpp.Star null
Returns
cpp.Star

addFontDefaultBitmap(self: cpp.Star, ?fontCfg: cpp.Star = null): cpp.Star

Embedded classic pixel-clean font. Recommended at Size 13px with no scaling.

Name Type Default
self cpp.Star
fontCfg cpp.Star null
Returns
cpp.Star

addFontFromFileTTF(self: cpp.Star, filename: cpp.ConstCharStar, ?sizePixels: cpp.Float32 = 0.0, ?fontCfg: cpp.Star = null, ?glyphRanges: cpp.Star = null): cpp.Star
Name Type Default
self cpp.Star
filename cpp.ConstCharStar
sizePixels cpp.Float32 0.0
fontCfg cpp.Star null
glyphRanges cpp.Star null
Returns
cpp.Star

addFontFromMemoryTTF(self: cpp.Star, fontData: cpp.RawPointer<cpp.Void>, fontDataSize: Int, ?sizePixels: cpp.Float32 = 0.0, ?fontCfg: cpp.Star = null, ?glyphRanges: cpp.Star = null): cpp.Star

Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas. Set font_cfg->FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed.

Name Type Default
self cpp.Star
fontData cpp.RawPointer<cpp.Void>
fontDataSize Int
sizePixels cpp.Float32 0.0
fontCfg cpp.Star null
glyphRanges cpp.Star null
Returns
cpp.Star

addFontFromMemoryCompressedTTF(self: cpp.Star, compressedFontData: cpp.RawPointer<cpp.Void>, compressedFontDataSize: Int, ?sizePixels: cpp.Float32 = 0.0, ?fontCfg: cpp.Star = null, ?glyphRanges: cpp.Star = null): cpp.Star

'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp.

Name Type Default
self cpp.Star
compressedFontData cpp.RawPointer<cpp.Void>
compressedFontDataSize Int
sizePixels cpp.Float32 0.0
fontCfg cpp.Star null
glyphRanges cpp.Star null
Returns
cpp.Star

addFontFromMemoryCompressedBase85TTF(self: cpp.Star, compressedFontDataBase85: cpp.ConstCharStar, ?sizePixels: cpp.Float32 = 0.0, ?fontCfg: cpp.Star = null, ?glyphRanges: cpp.Star = null): cpp.Star

'compressed_font_data_base85' still owned by caller. Compress with binary_to_compressed_c.cpp with -base85 parameter.

Name Type Default
self cpp.Star
compressedFontDataBase85 cpp.ConstCharStar
sizePixels cpp.Float32 0.0
fontCfg cpp.Star null
glyphRanges cpp.Star null
Returns
cpp.Star

removeFont(self: cpp.Star, font: cpp.Star): Void
Name Type
self cpp.Star
font cpp.Star

clear(self: cpp.Star): Void

Clear everything (fonts + textures). Don't call mid-frame!

Name Type
self cpp.Star

clearFonts(self: cpp.Star): Void

Clear input+output font data/glyphs. You can call this mid-frame if you load new fonts afterwards!

Name Type
self cpp.Star

compactCache(self: cpp.Star): Void

Compact cached glyphs and texture.

Name Type
self cpp.Star

setFontLoader(self: cpp.Star, fontLoader: cpp.Star): Void

Change font loader at runtime.

Name Type
self cpp.Star
fontLoader cpp.Star

clearInputData(self: cpp.Star): Void

[OBSOLETE] Clear input data (all ImFontConfig structures including sizes, TTF data, glyph ranges, etc.) = all the data used to build the texture and fonts.

Name Type
self cpp.Star

clearTexData(self: cpp.Star): Void

[OBSOLETE] Clear CPU-side copy of the texture data. Saves RAM once the texture has been copied to graphics memory.

Name Type
self cpp.Star

getGlyphRangesDefault(self: cpp.Star): cpp.Star

Basic Latin, Extended Latin

Name Type
self cpp.Star
Returns
cpp.Star

addCustomRect(self: cpp.Star, width: Int, height: Int, ?outR: cpp.Star = null): Int

Register a rectangle. Return -1 (ImFontAtlasRectId_Invalid) on error.

Name Type Default
self cpp.Star
width Int
height Int
outR cpp.Star null
Returns
Int

removeCustomRect(self: cpp.Star, id: Int): Void

Unregister a rectangle. Existing pixels will stay in texture until resized / garbage collected.

Name Type
self cpp.Star
id Int

getCustomRect(self: cpp.Star, id: Int, outR: cpp.Star): Bool

Get rectangle coordinates for current texture. Valid immediately, never store this (read above)!

Name Type
self cpp.Star
id Int
outR cpp.Star
Returns
Bool

Instance Members

flags: Int

Build flags (see ImFontAtlasFlags_)


texDesiredFormat: ImTextureFormat

Desired texture format (default to ImTextureFormat_RGBA32 but may be changed to ImTextureFormat_Alpha8).


texGlyphPadding: Int

FIXME: Should be called "TexPackPadding". Padding between glyphs within texture in pixels. Defaults to 1. If your rendering method doesn't rely on bilinear filtering you may set this to 0 (will also need to set AntiAliasedLinesUseTex = false).


texMinWidth: Int

Minimum desired texture width. Must be a power of two. Default to 512.


texMinHeight: Int

Minimum desired texture height. Must be a power of two. Default to 128.


texMaxWidth: Int

Maximum desired texture width. Must be a power of two. Default to 8192.


texMaxHeight: Int

Maximum desired texture height. Must be a power of two. Default to 8192.


Store your own atlas related user-data (if e.g. you have multiple font atlas).


Latest texture identifier == TexData->GetTexRef().


texData: cpp.Star

Latest texture.

Metadata

Name Parameters
:structAccess -
:include "linc_imgui.h"