refactor ImGUI code files

This commit is contained in:
2022-02-10 19:58:51 +08:00
parent bb33972616
commit 06cd549eb7
13 changed files with 172 additions and 50 deletions

View File

@@ -0,0 +1,24 @@
package backend
import "github.com/inkyblackness/imgui-go/v4"
var glyphRanges imgui.AllocatedGlyphRanges
// GlyphRanges returns a custom-built glyph ranges set.
//
// The ImGUI context must be already initialized.
func GlyphRanges() imgui.GlyphRanges {
if glyphRanges.GlyphRanges == 0 {
b := &imgui.GlyphRangesBuilder{}
b.AddExisting(imgui.CurrentIO().Fonts().GlyphRangesChineseFull())
// Greek
b.Add(0x0391, 0x03A1)
b.Add(0x03A3, 0x03FF)
glyphRanges = b.Build()
}
return glyphRanges.GlyphRanges
}