From 326fc5de99e070a391de1c7ae521b7adbb599fc2 Mon Sep 17 00:00:00 2001 From: Eric Mellino Date: Sun, 15 Jan 2017 00:56:55 -0800 Subject: [PATCH] Add two overloads to FontAtlas --- src/ImGui.NET/IO.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ImGui.NET/IO.cs b/src/ImGui.NET/IO.cs index 78b3c17..4cd8e85 100644 --- a/src/ImGui.NET/IO.cs +++ b/src/ImGui.NET/IO.cs @@ -249,6 +249,11 @@ namespace ImGuiNET ImGuiNative.ImFontAtlas_SetTexID(_atlasPtr, textureID.ToPointer()); } + public void Clear() + { + ImGuiNative.ImFontAtlas_Clear(_atlasPtr); + } + public void ClearTexData() { ImGuiNative.ImFontAtlas_ClearTexData(_atlasPtr); @@ -271,6 +276,13 @@ namespace ImGuiNET NativeFont* nativeFontPtr = ImGuiNative.ImFontAtlas_AddFontFromMemoryTTF(_atlasPtr, ttfData.ToPointer(), ttfDataSize, pixelSize, IntPtr.Zero, null); return new Font(nativeFontPtr); } + + 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 unsafe struct FontTextureData