Skip to content

Instantly share code, notes, and snippets.

@se5a
Created August 2, 2020 08:06
Show Gist options
  • Select an option

  • Save se5a/ee9997d1d1113ee81bdd2fa4fd2cc7c3 to your computer and use it in GitHub Desktop.

Select an option

Save se5a/ee9997d1d1113ee81bdd2fa4fd2cc7c3 to your computer and use it in GitHub Desktop.
unsafe
{
string rf = "Resources";
ImFontConfig* rawPtr = ImGuiNative.ImFontConfig_ImFontConfig();
ImFontConfigPtr config = new ImFontConfigPtr(rawPtr);
config.PixelSnapH = true;
config.MergeMode = true;
ImFontAtlasPtr fontAtlas = ImGui.GetIO().Fonts;
var builder = new ImFontGlyphRangesBuilderPtr(ImGuiNative.ImFontGlyphRangesBuilder_ImFontGlyphRangesBuilder());
builder.AddText("ΩωΝνΔδθΘ"); //Omega, Nu, Delta, Theta (UPPER and lower cases)
//builder.AddText("ΩωνΔθ");
//builder.AddRanges(fontAtlas.GetGlyphRangesDefault());
builder.BuildRanges(out ImVector ranges);
fontAtlas.AddFontFromFileTTF(Path.Combine(rf, "ProggyClean.ttf"), 13);
fontAtlas.AddFontFromFileTTF(Path.Combine(rf, "DejaVuSans.ttf"), 13, config, ranges.Data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment