gl01/internal/igwrap/glyph_ranges.go

25 lines
519 B
Go
Raw Normal View History

2022-01-24 22:40:53 +08:00
package igwrap
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
}