struct ImGui::ImFontAtlas
- ImGui::ImFontAtlas
- Struct
- Value
- Object
Overview
Included Modules
- ImGui::ClassType(LibImGui::ImFontAtlas)
Defined in:
obj.crConstructors
Instance Method Summary
- #add_custom_rect_font_glyph(font : ImFont, id : ImWchar, width : Int32, height : Int32, advance_x : Float32, offset : ImVec2 = ImVec2.new(0, 0)) : Int32
- #add_custom_rect_regular(width : Int32, height : Int32) : Int32
- #add_font(font_cfg : ImFontConfig) : ImFont
- #add_font_default(font_cfg : ImFontConfig | Nil = nil) : ImFont
- #add_font_from_file_ttf(filename : String, size_pixels : Float32, font_cfg : ImFontConfig | Nil = nil, glyph_ranges : Pointer(ImWchar) = Pointer(ImWchar).null) : ImFont
-
#add_font_from_memory_compressed_base85_ttf(compressed_font_data_base85 : String, size_pixels : Float32, font_cfg : ImFontConfig | Nil = nil, glyph_ranges : Pointer(ImWchar) = Pointer(ImWchar).null) : ImFont
'compressed_font_data_base85' still owned by caller.
-
#add_font_from_memory_compressed_ttf(compressed_font_data : Pointer(Void), compressed_font_data_size : Int32, size_pixels : Float32, font_cfg : ImFontConfig | Nil = nil, glyph_ranges : Pointer(ImWchar) = Pointer(ImWchar).null) : ImFont
'compressed_font_data' still owned by caller.
-
#add_font_from_memory_ttf(font_data : Pointer(Void), font_data_size : Int32, size_pixels : Float32, font_cfg : ImFontConfig | Nil = nil, glyph_ranges : Pointer(ImWchar) = Pointer(ImWchar).null) : ImFont
Note: Transfer ownership of 'ttf_data' to ImFontAtlas! Will be deleted after destruction of the atlas.
-
#build : Bool
Build pixels data.
- #calc_custom_rect_uv(rect : ImFontAtlasCustomRect) : Tuple(ImGui::ImVec2, ImGui::ImVec2)
-
#clear : Void
Clear all input and output.
-
#clear_fonts : Void
Clear output font data (glyphs storage, UV coordinates).
-
#clear_input_data : Void
Clear input data (all ImFontConfig structures including sizes, TTF data, glyph ranges, etc.) = all the data used to build the texture and fonts.
-
#clear_tex_data : Void
Clear output texture data (CPU side).
-
#config_data : ImVector(LibImGui::ImFontConfig)
Configuration data
- #config_data=(config_data : ImVector(LibImGui::ImFontConfig))
-
#custom_rects : ImVector(LibImGui::ImFontAtlasCustomRect)
Rectangles for packing custom texture data into the atlas.
- #custom_rects=(custom_rects : ImVector(LibImGui::ImFontAtlasCustomRect))
-
#flags : ImFontAtlasFlags
Build flags (see ImFontAtlasFlags_)
- #flags=(flags : ImFontAtlasFlags)
-
#font_builder_flags : UInt32
Shared flags (for all fonts) for custom font builder.
- #font_builder_flags=(font_builder_flags : UInt32)
-
#font_builder_io : ImFontBuilderIO | Nil
Opaque interface to a font builder (default to stb_truetype, can be changed to use FreeType by defining IMGUI_ENABLE_FREETYPE).
- #font_builder_io=(font_builder_io : ImFontBuilderIO | Nil)
-
#fonts : ImVector(ImFont)
Hold all the fonts returned by AddFont*.
- #fonts=(fonts : ImVector(ImFont))
- #get_custom_rect_by_index(index : Int32) : ImFontAtlasCustomRect
-
#get_glyph_ranges_chinese_full : Pointer(ImWchar)
Default + Half-Width + Japanese Hiragana/Katakana + full set of about 21000 CJK Unified Ideographs
-
#get_glyph_ranges_chinese_simplified_common : Pointer(ImWchar)
Default + Half-Width + Japanese Hiragana/Katakana + set of 2500 CJK Unified Ideographs for common simplified Chinese
-
#get_glyph_ranges_cyrillic : Pointer(ImWchar)
Default + about 400 Cyrillic characters
-
#get_glyph_ranges_default : Pointer(ImWchar)
Basic Latin, Extended Latin
-
#get_glyph_ranges_greek : Pointer(ImWchar)
Default + Greek and Coptic
-
#get_glyph_ranges_japanese : Pointer(ImWchar)
Default + Hiragana, Katakana, Half-Width, Selection of 2999 Ideographs
-
#get_glyph_ranges_korean : Pointer(ImWchar)
Default + Korean characters
-
#get_glyph_ranges_thai : Pointer(ImWchar)
Default + Thai characters
-
#get_glyph_ranges_vietnamese : Pointer(ImWchar)
Default + Vietnamese characters
- #get_mouse_cursor_tex_data(cursor : ImGuiMouseCursor) : Tuple(Bool, ImGui::ImVec2, ImGui::ImVec2, Slice(ImGui::ImVec2), Slice(ImGui::ImVec2))
-
#get_tex_data_as_alpha8 : Tuple(Pointer(LibC::UChar), LibC::Int, LibC::Int, LibC::Int)
1 byte per-pixel
-
#get_tex_data_as_rgba32 : Tuple(Pointer(LibC::UChar), LibC::Int, LibC::Int, LibC::Int)
4 bytes-per-pixel
-
#is_built : Bool
Bit ambiguous: used to detect when user didn't build texture but effectively we should check TexID != 0 except that would be backend dependent...
-
#locked : Bool
Marked as Locked by ImGui::NewFrame() so attempt to modify the atlas will assert.
- #locked=(locked : Bool)
-
#pack_id_lines : Int32
Custom texture rectangle ID for baked anti-aliased lines
- #pack_id_lines=(pack_id_lines : Int32)
-
#pack_id_mouse_cursors : Int32
Custom texture rectangle ID for white pixel and mouse cursors
- #pack_id_mouse_cursors=(pack_id_mouse_cursors : Int32)
- #set_tex_id(id : ImTextureID) : Void
-
#tex_desired_width : Int32
Texture width desired by user before Build().
- #tex_desired_width=(tex_desired_width : Int32)
-
#tex_glyph_padding : Int32
Padding between glyphs within texture in pixels.
- #tex_glyph_padding=(tex_glyph_padding : Int32)
-
#tex_height : Int32
Texture height calculated during Build().
- #tex_height=(tex_height : Int32)
-
#tex_id : ImTextureID
User data to refer to the texture once it has been uploaded to user's graphic systems.
- #tex_id=(tex_id : ImTextureID)
-
#tex_pixels_alpha8 : Pointer(LibC::UChar)
1 component per pixel, each component is unsigned 8-bit.
- #tex_pixels_alpha8=(tex_pixels_alpha8 : Pointer(LibC::UChar))
-
#tex_pixels_rgba32 : Pointer(UInt32)
4 component per pixel, each component is unsigned 8-bit.
- #tex_pixels_rgba32=(tex_pixels_rgba32 : Pointer(UInt32))
-
#tex_pixels_use_colors : Bool
Tell whether our texture data is known to use colors (rather than just alpha channel), in order to help backend select a format.
- #tex_pixels_use_colors=(tex_pixels_use_colors : Bool)
-
#tex_ready : Bool
Set when texture was built matching current font input
- #tex_ready=(tex_ready : Bool)
-
#tex_uv_lines : Slice(ImVec4)
UVs for baked anti-aliased lines
- #tex_uv_lines=(tex_uv_lines : Slice(ImVec4))
-
#tex_uv_scale : ImVec2
= (1.0f/TexWidth, 1.0f/TexHeight)
- #tex_uv_scale=(tex_uv_scale : ImVec2)
-
#tex_uv_white_pixel : ImVec2
Texture coordinates to a white pixel
- #tex_uv_white_pixel=(tex_uv_white_pixel : ImVec2)
-
#tex_width : Int32
Texture width calculated during Build().
- #tex_width=(tex_width : Int32)
- #to_unsafe : Pointer(T)
-
#user_data : Pointer(Void)
Store your own atlas related user-data (if e.g.
- #user_data=(user_data : Pointer(Void))
Constructor Detail
Instance Method Detail
'compressed_font_data_base85' still owned by caller. Compress with binary_to_compressed_c.cpp with -base85 parameter.
'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp.
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.
Build pixels data. This is called automatically for you by the GetTexData*** functions.
Clear input data (all ImFontConfig structures including sizes, TTF data, glyph ranges, etc.) = all the data used to build the texture and fonts.
Clear output texture data (CPU side). Saves RAM once the texture has been copied to graphics memory.
Rectangles for packing custom texture data into the atlas.
Shared flags (for all fonts) for custom font builder. THIS IS BUILD IMPLEMENTATION DEPENDENT. Per-font override is also available in ImFontConfig.
Opaque interface to a font builder (default to stb_truetype, can be changed to use FreeType by defining IMGUI_ENABLE_FREETYPE).
Hold all the fonts returned by AddFont*. Fonts[0] is the default font upon calling ImGui::NewFrame(), use ImGui::PushFont()/PopFont() to change the current font.
Default + Half-Width + Japanese Hiragana/Katakana + full set of about 21000 CJK Unified Ideographs
Default + Half-Width + Japanese Hiragana/Katakana + set of 2500 CJK Unified Ideographs for common simplified Chinese
Default + about 400 Cyrillic characters
Basic Latin, Extended Latin
Default + Greek and Coptic
Default + Hiragana, Katakana, Half-Width, Selection of 2999 Ideographs
Default + Korean characters
Default + Thai characters
Default + Vietnamese characters
1 byte per-pixel
4 bytes-per-pixel
Bit ambiguous: used to detect when user didn't build texture but effectively we should check TexID != 0 except that would be backend dependent...
Marked as Locked by ImGui::NewFrame() so attempt to modify the atlas will assert.
Texture width desired by user before Build(). Must be a power-of-two. If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height.
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).
User data to refer to the texture once it has been uploaded to user's graphic systems. It is passed back to you during rendering via the ImDrawCmd structure.
1 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight
4 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight * 4
Tell whether our texture data is known to use colors (rather than just alpha channel), in order to help backend select a format.
Store your own atlas related user-data (if e.g. you have multiple font atlas).