public static unsafe Font AddFontFromFileTTF(this FontAtlas atlas, string fileName, float pixelSize, FontConfig config, char[] glyphRanges) { NativeFontAtlas *atlasPtr = ImGui.GetIO().GetNativePointer()->FontAtlas; IntPtr cfgPtr = Marshal.AllocHGlobal(Marshal.SizeOf(config)); Marshal.StructureToPtr(config, cfgPtr, false); fixed(char *glyphPtr = &glyphRanges[0]) { NativeFont *fontPtr = ImGuiNative.ImFontAtlas_AddFontFromFileTTF(atlasPtr, fileName, pixelSize, cfgPtr, glyphPtr); return(new Font(fontPtr)); } }
public Font AddFontFromMemoryTTF(IntPtr ttfData, int ttfDataSize, float pixelSize, IntPtr fontConfig) { NativeFont *nativeFontPtr = ImGuiNative.ImFontAtlas_AddFontFromMemoryTTF(_atlasPtr, ttfData.ToPointer(), ttfDataSize, pixelSize, fontConfig, null); return(new Font(nativeFontPtr)); }
public Font AddFontFromFileTTF(string fileName, float pixelSize) { NativeFont *nativeFontPtr = ImGuiNative.ImFontAtlas_AddFontFromFileTTF(_atlasPtr, fileName, pixelSize, IntPtr.Zero, null); return(new Font(nativeFontPtr)); }
public Font AddDefaultFont() { NativeFont *nativeFontPtr = ImGuiNative.ImFontAtlas_AddFontDefault(_atlasPtr); return(new Font(nativeFontPtr)); }
public Font GetCurrentFont() { NativeFont *nativeFontPtr = ImGuiNative.igGetFont(); return(new Font(nativeFontPtr)); }
public Font(NativeFont *nativePtr) { NativeFont = nativePtr; }
static extern ImFontGlyph *igFontFindGlyph(NativeFont *font, char c);
public static extern void igPushFont(NativeFont *font);
public static extern void ImDrawList_AddTextExt(NativeDrawList *list, NativeFont *font, float font_size, Vector2 pos, uint col, byte *text_begin, byte *text_end, float wrap_width, Vector4 *cpu_fine_clip_rect);