refactor ImGUI code files
This commit is contained in:
24
internal/igwrap/backend/glyph_ranges.go
Normal file
24
internal/igwrap/backend/glyph_ranges.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user