Loading Custom TTF Font from Static Class

Import from here https://eyeauras.net/share/S20251017150654moSdG8zUyQ4D

In this example we load Robot font into ImGui using static class with raw data

Example of embedded resource

Imgui with updated font

csharp
#r "nuget:EyeAuras.ImGuiSdk, 0.1.17" //EyeAuras v8825+ is required

using EyeAuras.ImGuiSdk; //root ImGuiSdk namespace needed to add registrations (see below)
using ImGuiNET; //that namespace is needed to get access to ImGui itself

var osd = GetService<IImGuiExperimentalApi>() //create ImGui API - this will show empty OSD
    .AddTo(ExecutionAnchors); //ensure that you'll hide OSD when script stops or gets stopped

osd.AddFontFromMemoryTTF(EmbeddedBinaryData.RobotoRegularTtf); //loading the font itself

osd.AddRenderer(() =>
{
    //this method will be called many-many times per second
    //you can put any logic here
    ImGui.ShowDemoWindow();
});

//wait until script stops or gets stopped
cancellationToken.WaitHandle.WaitOne();