using ImGuiWindowFlags = System.IntPtr; using ImGuiSetCond = System.IntPtr; using ImGuiColorEditMode = System.IntPtr; using ImVec2 = System.Numerics.Vector2; using ImVec4 = System.Numerics.Vector4; using ImGuiID = System.UInt32; using ImTextureID = System.IntPtr; using ImWchar = System.UInt16; using System; using System.Runtime.InteropServices; namespace ImGui { // Font runtime data and rendering // ImFontAtlas automatically loads a default embedded font for you when you call GetTexDataAsAlpha8() or GetTexDataAsRGBA32(). [StructLayout(LayoutKind.Sequential)] internal unsafe struct ImFont { // Members: Settings public float FontSize; // // Height of characters, set during loading (don't change after loading) public float Scale; // = 1.0f // Base font scale, multiplied by the per-window font scale which you can adjust with SetFontScale() public ImVec2 DisplayOffset; // = (0.0f,1.0f) // Offset font rendering by xx pixels public ImWchar FallbackChar; // = '?' // Replacement glyph if one isn't found. Only set via SetFallbackChar() /// /// ImFontConfig* /// public IntPtr ConfigData; // // Pointer within ImFontAtlas->ConfigData public int ConfigDataCount; // // Members: Runtime data [StructLayout(LayoutKind.Sequential)] internal struct Glyph { ImWchar Codepoint; float XAdvance; float X0, Y0, X1, Y1; float U0, V0, U1, V1; // Texture coordinates }; public float Ascent, Descent; // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize] /// /// ImFontAtlas* /// public IntPtr ContainerAtlas; // What we has been loaded into /// /// ImVector(Glyph) /// public ImVector Glyphs; public Glyph* FallbackGlyph; // == FindGlyph(FontFallbackChar) public float FallbackXAdvance; // //ImVector IndexXAdvance; // Sparse. Glyphs->XAdvance directly indexable (more cache-friendly that reading from Glyphs, for CalcTextSize functions which are often bottleneck in large UI) //ImVector IndexLookup; // Sparse. Index glyphs by Unicode code-point. public ImVector IndexXAdvance; // Sparse. Glyphs->XAdvance directly indexable (more cache-friendly that reading from Glyphs, for CalcTextSize functions which are often bottleneck in large UI) public ImVector IndexLookup; // Sparse. Index glyphs by Unicode code-point. // Methods /* IMGUI_API ImFont(); IMGUI_API ~ImFont(); IMGUI_API void Clear(); IMGUI_API void BuildLookupTable(); IMGUI_API const Glyph* FindGlyph(unsigned short c) const; IMGUI_API void SetFallbackChar(ImWchar c); float GetCharAdvance(unsigned short c) const { return ((int)c