cimgui-go: Bug FontGlyphRangesBuilder

last PR

working option

io.Fonts().AddFontFromFileTTFV("fonts/ttf/JetBrainsMono-Medium.ttf",
	baseFontSize,
	&baseConfig,
	imgui.CurrentIO().Fonts().GlyphRangesCyrillic())

when using NewGlyphRange/NewFontGlyphRangesBuilder

baseRange := imgui.NewGlyphRange()
baseBuilder := imgui.NewFontGlyphRangesBuilder()
baseBuilder.AddRanges(io.Fonts().GlyphRangesCyrillic())
baseBuilder.BuildRanges(baseRange)

io.Fonts().AddFontFromFileTTFV("fonts/ttf/JetBrainsMono-Medium.ttf",
	baseFontSize,
	&baseConfig,
baseRange.Data())

error

panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 1 [running]:
github.com/AllenDang/cimgui-go.FontGlyphRangesBuilder.BuildRanges.func1(0xc0000afe01?, 0xc0000afe70?)
        S:/goProject/cimgui-go/type_accessor.go:98 +0x34
github.com/AllenDang/cimgui-go.FontGlyphRangesBuilder.BuildRanges({{0x2a958c4df90?, 0x7ff682e44a0a?, 0x2a958d52eb0?}}, 0xc0000afed0?)
        S:/goProject/cimgui-go/type_accessor.go:98 +0x48
poehelper/fonts.AppendDefaultFont(0x2a958d4a9a8?)
        S:/goProject/PoEHelper/fonts/Font.go:44 +0x8e
main.main()
        S:/goProject/PoEHelper/main.go:79 +0x21f
exit status 2
make: *** [Makefile:9: run] Error 1

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 39 (8 by maintainers)

Commits related to this issue

Most upvoted comments

This works for me now! šŸŽŠ

I’m hitting this problem too. Did some git bisect testing and found that the bug was introduced in #204

Uh, no. Like in the video ~3 starts up ~3 times then ~6 panics.

@Wolf65 patch #208 should fix this, however I need to do something around go version so gonna merge it tomorrow