//
// Generated by Brutal.ImGui.Generator; do not edit by hand.
#nullable enable
namespace Brutal.ImGuiApi
{
public static partial class ImFontExtensions
{
///
///
/// C++:
/// imgui.h:3944
/// ,
/// imgui_draw.cpp:5250
///
bool IsGlyphInFont(ImWchar c)
///
///
///
///
/// Methods
///
///
/// This is not fast query
///
///
public static unsafe bool IsGlyphInFont(this ImFontPtr target, uint c) =>
PInvoke.ImFont_IsGlyphInFont(target, c);
///
///
/// C++:
/// imgui.h:3945
///
bool IsLoaded() const
///
///
///
///
/// Methods
///
///
public static unsafe bool IsLoaded(this ImFontPtr target) => PInvoke.ImFont_IsLoaded(target);
///
///
/// Fill ImFontConfig::Name.
///
///
/// C++:
/// imgui.h:3946
///
const char* GetDebugName() const
///
///
///
///
/// Methods
///
///
public static unsafe ImString GetDebugName(this ImFontPtr target) =>
Utf8.GetNullTerminatedSpan(PInvoke.ImFont_GetDebugName(target));
///
///
/// Get or create baked data for given size
///
///
/// C++:
/// imgui.h:3951
/// ,
/// imgui_draw.cpp:5288
///
ImFontBaked* GetFontBaked(float font_size, float density = -1.0f)
///
///
///
///
/// [Internal] Don't use!
/// 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable.
/// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
///
///
/// ImFontBaked pointers are valid for the entire frame but shall never be kept between frames.
///
///
public static unsafe ImFontBakedPtr GetFontBaked(this ImFontPtr target, float fontSize, float density = -1f) =>
PInvoke.ImFont_GetFontBaked(target, fontSize, density);
///
///
/// utf8
///
///
/// C++:
/// imgui.h:3952
/// ,
/// imgui_draw.cpp:5465
///
/// ImVec2 CalcTextSizeA(float size, float max_width, float wrap_width, const char* text_begin, const char* text_end = NULL, const char** remaining = NULL)
///
///
///
///
/// [Internal] Don't use!
/// 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable.
/// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
///
///
public static unsafe float2 CalcTextSizeA(
this ImFontPtr target,
float size,
float maxWidth,
float wrapWidth,
ImString text,
Ptr> remaining = default
)
{
fixed (byte* text_fixed = text)
{
return PInvoke.ImFont_CalcTextSizeA(
target,
size,
maxWidth,
wrapWidth,
text_fixed,
text_fixed + text.Length,
(byte**)remaining
);
}
}
///
///
/// C++:
/// imgui.h:3953
/// ,
/// imgui_draw.cpp:5359
///
/// const char* CalcWordWrapPosition(float size, const char* text, const char* text_end, float wrap_width)
///
///
///
///
/// [Internal] Don't use!
/// 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable.
/// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
///
///
/// Simple word-wrapping for English, not full-featured. Please submit failing cases!
/// This will return the next location to wrap from. If no wrapping if necessary, this will fast-forward to e.g. text_end.
/// FIXME: Much possible improvements (don't cut things like "word !", "word!!!" but cut within "word,,,,", more sensible support for punctuations, support for Unicode punctuations, etc.)
///
///
public static unsafe Ptr CalcWordWrapPosition(
this ImFontPtr target,
float size,
ImString text,
float wrapWidth
)
{
fixed (byte* text_fixed = text)
{
return PInvoke.ImFont_CalcWordWrapPosition(
target,
size,
text_fixed,
text_fixed + text.Length,
wrapWidth
);
}
}
///
///
/// C++:
/// imgui.h:3954
/// ,
/// imgui_draw.cpp:5550
///
/// void RenderChar(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, ImWchar c, const ImVec4* cpu_fine_clip = NULL)
///
///
///
///
/// [Internal] Don't use!
/// 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable.
/// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
///
///
/// Note: as with every ImDrawList drawing function, this expects that the font atlas texture is bound.
///
///
public static unsafe void RenderChar(
this ImFontPtr target,
ImDrawListPtr drawList,
float size,
in float2 pos,
ImColor8 col,
uint c,
in float4? cpuFineClip = null
)
{
var cpuFineClip_ptr = cpuFineClip is { } cpuFineClip_value ? &cpuFineClip_value : null;
fixed (float2* pos_fixed = &pos)
{
PInvoke.ImFont_RenderChar(target, drawList, size, pos_fixed, col, c, (float4*)cpuFineClip_ptr);
}
}
///
///
/// C++:
/// imgui.h:3955
/// ,
/// imgui_draw.cpp:5589
///
/// void RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width = 0.0f, bool cpu_fine_clip = false)
///
///
///
///
/// [Internal] Don't use!
/// 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable.
/// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
///
///
/// Note: as with every ImDrawList drawing function, this expects that the font atlas texture is bound.
///
///
public static unsafe void RenderText(
this ImFontPtr target,
ImDrawListPtr drawList,
float size,
in float2 pos,
ImColor8 col,
in float4 clipRect,
ImString text,
float wrapWidth = 0f,
bool cpuFineClip = false
)
{
fixed (byte* text_fixed = text)
{
fixed (float4* clipRect_fixed = &clipRect)
{
fixed (float2* pos_fixed = &pos)
{
PInvoke.ImFont_RenderText(
target,
drawList,
size,
pos_fixed,
col,
clipRect_fixed,
text_fixed,
text_fixed + text.Length,
wrapWidth,
cpuFineClip
);
}
}
}
}
///
///
/// C++:
/// imgui.h:3961
/// ,
/// imgui_draw.cpp:5087
///
void ClearOutputData()
///
///
///
///
/// [Internal] Don't use!
///
///
public static unsafe void ClearOutputData(this ImFontPtr target) => PInvoke.ImFont_ClearOutputData(target);
///
///
/// Makes 'from_codepoint' character points to 'to_codepoint' glyph.
///
///
/// C++:
/// imgui.h:3962
/// ,
/// imgui_draw.cpp:5199
///
void AddRemapChar(ImWchar from_codepoint, ImWchar to_codepoint)
///
///
///
///
/// [Internal] Don't use!
///
///
public static unsafe void AddRemapChar(this ImFontPtr target, uint fromCodepoint, uint toCodepoint) =>
PInvoke.ImFont_AddRemapChar(target, fromCodepoint, toCodepoint);
///
///
/// C++:
/// imgui.h:3963
/// ,
/// imgui_draw.cpp:5098
///
bool IsGlyphRangeUnused(unsigned int c_begin, unsigned int c_last)
///
///
///
///
/// [Internal] Don't use!
///
///
/// API is designed this way to avoid exposing the 8K page size
/// e.g. use with IsGlyphRangeUnused(0, 255)
///
///
public static unsafe bool IsGlyphRangeUnused(this ImFontPtr target, uint cBegin, uint cLast) =>
PInvoke.ImFont_IsGlyphRangeUnused(target, cBegin, cLast);
}
}