struct ImGui::ImFont

Overview

struct ImFont

Included Modules

Defined in:

obj.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new : ImFont #

[View source]

Instance Method Detail

def 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 #

[View source]
def add_remap_char(dst : ImWchar, src : ImWchar, overwrite_dst : Bool = true) : Void #

Makes 'dst' character/glyph points to 'src' character/glyph. Currently needs to be called AFTER fonts have been built.

ImFont::AddRemapChar()


[View source]
def ascent : Float32 #

4+4 out Ascent: distance from top to bottom of e.g. 'A' [0..FontSize]


[View source]
def ascent=(ascent : Float32) #

[View source]
def build_lookup_table : Void #

[View source]
def 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 #

[View source]
def calc_word_wrap_position_a(scale : Float32, text : Bytes | String, wrap_width : Float32) : String #

[View source]
def clear_output_data : Void #

[View source]
def config_data : Slice(ImFontConfig) #

4-8 in Pointer within ContainerAtlas->ConfigData


[View source]
def config_data=(config_data : Slice(ImFontConfig)) #

[View source]
def config_data_count : Int16 #

2 in ~ 1 Number of ImFontConfig involved in creating this font. Bigger than 1 when merging multiple font sources into one ImFont.


[View source]
def config_data_count=(config_data_count : Int16) #

[View source]
def container_atlas : ImFontAtlas #

4-8 out What we has been loaded into


[View source]
def container_atlas=(container_atlas : ImFontAtlas) #

[View source]
def descent : Float32 #

4+4 out Ascent: distance from top to bottom of e.g. 'A' [0..FontSize]


[View source]
def descent=(descent : Float32) #

[View source]
def dirty_lookup_tables : Bool #

1 out //


[View source]
def dirty_lookup_tables=(dirty_lookup_tables : Bool) #

[View source]
def dot_char : ImWchar #

2 out = '.' Character used for ellipsis rendering (if a single '...' character isn't found)


[View source]
def dot_char=(dot_char : ImWchar) #

[View source]
def ellipsis_char : ImWchar #

2 out = '...' Character used for ellipsis rendering.


[View source]
def ellipsis_char=(ellipsis_char : ImWchar) #

[View source]
def fallback_advance_x : Float32 #

4 out = FallbackGlyph->AdvanceX


[View source]
def fallback_advance_x=(fallback_advance_x : Float32) #

[View source]
def fallback_char : ImWchar #

2 out = FFFD/'?' Character used if a glyph isn't found.


[View source]
def fallback_char=(fallback_char : ImWchar) #

[View source]
def fallback_glyph : ImFontGlyph? #

4-8 out = FindGlyph(FontFallbackChar)


[View source]
def fallback_glyph=(fallback_glyph : ImFontGlyph?) #

[View source]
def find_glyph(c : ImWchar) : ImFontGlyph #

[View source]
def find_glyph_no_fallback(c : ImWchar) : ImFontGlyph #

[View source]
def font_size : Float32 #

4 in Height of characters/line, set during loading (don't change after loading)


[View source]
def font_size=(font_size : Float32) #

[View source]
def get_char_advance(c : ImWchar) : Float32 #

[View source]
def get_debug_name : String #

[View source]
def glyphs : ImVector(ImFontGlyph) #

12-16 out All glyphs.


[View source]
def glyphs=(glyphs : ImVector(ImFontGlyph)) #

[View source]
def grow_index(new_size : Int32) : Void #

[View source]
def index_advance_x : ImVector(Float32) #

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).


[View source]
def index_advance_x=(index_advance_x : ImVector(Float32)) #

[View source]
def index_lookup : ImVector(ImWchar) #

12-16 out Sparse. Index glyphs by Unicode code-point.


[View source]
def index_lookup=(index_lookup : ImVector(ImWchar)) #

[View source]
def is_glyph_range_unused(c_begin : UInt32, c_last : UInt32) : Bool #

[View source]
def is_loaded : Bool #

[View source]
def 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)


[View source]
def metrics_total_surface=(metrics_total_surface : Int32) #

[View source]
def render_char(draw_list : ImDrawList, size : Float32, pos : ImVec2, col : UInt32, c : ImWchar) : Void #

[View source]
def 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 #

[View source]
def scale : Float32 #

4 in = 1.f Base font scale, multiplied by the per-window font scale which you can adjust with SetWindowFontScale()


[View source]
def scale=(scale : Float32) #

[View source]
def set_glyph_visible(c : ImWchar, visible : Bool) : Void #

[View source]
def to_unsafe : Pointer(T) #

[View source]
def used4k_pages_map : Slice(UInt8) #

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.


[View source]
def used4k_pages_map=(used4k_pages_map : Slice(UInt8)) #

[View source]