struct ImGui::ImFont
- ImGui::ImFont
- Struct
- Value
- Object
Overview
Included Modules
- ImGui::ClassType(LibImGui::ImFont)
Defined in:
obj.crConstructors
Instance Method Summary
- #add_glyph(src_cfg : ImFontConfig, c : ImWchar, x0 : Float32, y0 : Float32, x1 : Float32, y1 : Float32, u0 : Float32, v0 : Float32, u1 : Float32, v1 : Float32, advance_x : Float32) : Void
-
#add_remap_char(dst : ImWchar, src : ImWchar, overwrite_dst : Bool = true) : Void
Makes 'dst' character/glyph points to 'src' character/glyph.
-
#ascent : Float32
4+4 out Ascent: distance from top to bottom of e.g.
- #ascent=(ascent : Float32)
- #build_lookup_table : Void
-
#calc_text_size_a(size : Float32, max_width : Float32, wrap_width : Float32, text : Bytes | String, remaining : Pointer(Pointer(LibC::Char)) = Pointer(::Pointer(LibC::Char)).null) : ImGui::ImVec2
utf8
- #calc_word_wrap_position_a(scale : Float32, text : Bytes | String, wrap_width : Float32) : String
- #clear_output_data : Void
-
#config_data : Slice(ImFontConfig)
4-8 in Pointer within ContainerAtlas->ConfigData
- #config_data=(config_data : Slice(ImFontConfig))
-
#config_data_count : Int16
2 in ~ 1 Number of ImFontConfig involved in creating this font.
- #config_data_count=(config_data_count : Int16)
-
#container_atlas : ImFontAtlas
4-8 out What we has been loaded into
- #container_atlas=(container_atlas : ImFontAtlas)
-
#descent : Float32
4+4 out Ascent: distance from top to bottom of e.g.
- #descent=(descent : Float32)
-
#dirty_lookup_tables : Bool
1 out //
- #dirty_lookup_tables=(dirty_lookup_tables : Bool)
-
#ellipsis_char : ImWchar
2 out = '...'/'.'// Character used for ellipsis rendering.
- #ellipsis_char=(ellipsis_char : ImWchar)
-
#ellipsis_char_count : Int16
1 out 1 or 3
- #ellipsis_char_count=(ellipsis_char_count : Int16)
-
#ellipsis_char_step : Float32
4 out Step between characters when EllipsisCount > 0
- #ellipsis_char_step=(ellipsis_char_step : Float32)
-
#ellipsis_width : Float32
4 out Width
- #ellipsis_width=(ellipsis_width : Float32)
-
#fallback_advance_x : Float32
4 out = FallbackGlyph->AdvanceX
- #fallback_advance_x=(fallback_advance_x : Float32)
-
#fallback_char : ImWchar
2 out = FFFD/'?' Character used if a glyph isn't found.
- #fallback_char=(fallback_char : ImWchar)
-
#fallback_glyph : ImFontGlyph | Nil
4-8 out = FindGlyph(FontFallbackChar)
- #fallback_glyph=(fallback_glyph : ImFontGlyph | Nil)
- #find_glyph(c : ImWchar) : ImFontGlyph
- #find_glyph_no_fallback(c : ImWchar) : ImFontGlyph
-
#font_size : Float32
4 in Height of characters/line, set during loading (don't change after loading)
- #font_size=(font_size : Float32)
- #get_char_advance(c : ImWchar) : Float32
- #get_debug_name : String
-
#glyphs : ImVector(ImFontGlyph)
12-16 out All glyphs.
- #glyphs=(glyphs : ImVector(ImFontGlyph))
- #grow_index(new_size : Int32) : Void
-
#index_advance_x : ImVector(Float32)
12-16 out Sparse.
- #index_advance_x=(index_advance_x : ImVector(Float32))
-
#index_lookup : ImVector(ImWchar)
12-16 out Sparse.
- #index_lookup=(index_lookup : ImVector(ImWchar))
- #is_glyph_range_unused(c_begin : UInt32, c_last : UInt32) : Bool
- #is_loaded : Bool
-
#metrics_total_surface : Int32
4 out Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs)
- #metrics_total_surface=(metrics_total_surface : Int32)
- #render_char(draw_list : ImDrawList, size : Float32, pos : ImVec2, col : UInt32, c : ImWchar) : Void
- #render_text(draw_list : ImDrawList, size : Float32, pos : ImVec2, col : UInt32, clip_rect : ImVec4, text : Bytes | String, wrap_width : Float32 = 0.0, cpu_fine_clip : Bool = false) : Void
-
#scale : Float32
4 in = 1.f Base font scale, multiplied by the per-window font scale which you can adjust with SetWindowFontScale()
- #scale=(scale : Float32)
- #set_glyph_visible(c : ImWchar, visible : Bool) : Void
- #to_unsafe : Pointer(T)
-
#used4k_pages_map : Slice(UInt8)
2 bytes if ImWchar=ImWchar16, 34 bytes if ImWchar==ImWchar32.
- #used4k_pages_map=(used4k_pages_map : Slice(UInt8))
Constructor Detail
Instance Method Detail
Makes 'dst' character/glyph points to 'src' character/glyph. Currently needs to be called AFTER fonts have been built.
2 in ~ 1 Number of ImFontConfig involved in creating this font. Bigger than 1 when merging multiple font sources into one ImFont.
2 out = '...'/'.'// Character used for ellipsis rendering.
4 in Height of characters/line, set during loading (don't change after loading)
12-16 out Sparse. Glyphs->AdvanceX in a directly indexable way (cache-friendly for CalcTextSize functions which only this this info, and are often bottleneck in large UI).
12-16 out Sparse. Index glyphs by Unicode code-point.
4 out Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs)
4 in = 1.f Base font scale, multiplied by the per-window font scale which you can adjust with SetWindowFontScale()
2 bytes if ImWchar=ImWchar16, 34 bytes if ImWchar==ImWchar32. Store 1-bit for each block of 4K codepoints that has one active glyph. This is mainly used to facilitate iterations across all used codepoints.