You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to display a kanji character via the FYNE_FONT environment variable, my program reaches a segmentation fault and exits. The root of the error appears to reside in the goki truetype font loading system. Removing the environment variable allows my program to execute normally; however, blank rectangles are displayed instead of kanji as mentioned in issue #63. I pulled the ttf files from https://github.com/minoryorg/Noto-Sans-CJK-JP.
To Reproduce:
FYNE_FONT=NotoSansCJKjp-Regular.ttf ./my_fyne_executable
Device:
OS: Ubuntu
Version: Eoan 19.10
Go version: go1.14.6
Fyne version: Latest
Verbatim Output:
Fyne error: font load error
Cause: freetype: invalid TrueType format: bad TTF version
At: /go/src/fyne.io/fyne/internal/painter/font.go:20
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x1d4 pc=0x7676a1]
I can't replicate here unfortunately, but the bug needs fixed.
Can you please try adding the following lines at internal/painter/font.go line 158 (immediately above the &fontCacheItem line:
iff1==nil {
f1=f2
}
Let me know if that helps, if so we can apply it to next release...
When trying to display a kanji character via the FYNE_FONT environment variable, my program reaches a segmentation fault and exits. The root of the error appears to reside in the goki truetype font loading system. Removing the environment variable allows my program to execute normally; however, blank rectangles are displayed instead of kanji as mentioned in issue #63. I pulled the ttf files from https://github.com/minoryorg/Noto-Sans-CJK-JP.
To Reproduce:
FYNE_FONT=NotoSansCJKjp-Regular.ttf ./my_fyne_executable
Device:
Verbatim Output:
Fyne error: font load error
Cause: freetype: invalid TrueType format: bad TTF version
At: /go/src/fyne.io/fyne/internal/painter/font.go:20
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x1d4 pc=0x7676a1]
goroutine 1 [running, locked to thread]:
fyne.io/fyne/vendor/github.com/goki/freetype/truetype.(*Font).Bounds(0x0, 0xc0000003cb, 0x200, 0xc000644000)
/go/src/fyne.io/fyne/vendor/github.com/goki/freetype/truetype/truetype.go:386 +0x11
fyne.io/fyne/vendor/github.com/goki/freetype/truetype.NewFace(0x0, 0xc00063ba88, 0xc00063ba88, 0x10bbca0)
/go/src/fyne.io/fyne/vendor/github.com/goki/freetype/truetype/face.go:205 +0x2d7
fyne.io/fyne/internal/painter.CachedFontFace(0xc000000000, 0xc00063ba88, 0x0, 0x0)
/go/src/fyne.io/fyne/internal/painter/font.go:164 +0x177
fyne.io/fyne/internal/painter.RenderedTextSize(0x97b0e2, 0x1, 0xe, 0x0, 0x10bae60, 0x9a7bc0)
/go/src/fyne.io/fyne/internal/painter/font.go:32 +0xa6
fyne.io/fyne/internal/driver/glfw.(*gLDriver).RenderedTextSize(0xc0000b80f0, 0x97b0e2, 0x1, 0xe, 0x0, 0xc0000c26c0, 0xe)
/go/src/fyne.io/fyne/internal/driver/glfw/driver.go:33 +0x5a
fyne.io/fyne.MeasureText(0x97b0e2, 0x1, 0xe, 0x0, 0xc0000c26c0, 0xc000609ba8)
/go/src/fyne.io/fyne/text.go:40 +0x86
fyne.io/fyne/widget.(*textProvider).charMinSize(0xc00051e090, 0xc000609c18, 0x7e43e4)
/go/src/fyne.io/fyne/widget/text.go:217 +0xbb
fyne.io/fyne/widget.(*textRenderer).Layout(0xc000034040, 0x0, 0x0)
/go/src/fyne.io/fyne/widget/text.go:284 +0x8d
fyne.io/fyne/widget.(*textRenderer).Refresh(0xc000034040)
/go/src/fyne.io/fyne/widget/text.go:354 +0x569
fyne.io/fyne/widget.(*textProvider).CreateRenderer(0xc00051e090, 0xc00051e090, 0x5)
/go/src/fyne.io/fyne/widget/text.go:69 +0xda
fyne.io/fyne/widget.(*Label).CreateRenderer(0xc000122080, 0x9611c0, 0xc000122080)
/go/src/fyne.io/fyne/widget/label.go:104 +0x10c
fyne.io/fyne/internal/cache.Renderer(0xa343c0, 0xc000122080, 0xc000122080, 0x9a7bc8)
/go/src/fyne.io/fyne/internal/cache/widget.go:29 +0x112
fyne.io/fyne/widget.(*BaseWidget).MinSize(0xc000122080, 0xa343c0, 0xc000122080)
/go/src/fyne.io/fyne/widget/widget.go:84 +0x43
fyne.io/fyne/widget.(*Label).MinSize(0xc000122080, 0xa33920, 0xc000122080)
/go/src/fyne.io/fyne/widget/label.go:110 +0x4c
fyne.io/fyne/layout.(*boxLayout).MinSize(0xc0000e1f5a, 0xc00000e080, 0x2, 0x2, 0x8b8da0, 0xc0000c2801)
/go/src/fyne.io/fyne/layout/boxlayout.go:128 +0x1d0
fyne.io/fyne.NewContainerWithLayout(0xa2ad80, 0xc0000e1f5a, 0xc00000e080, 0x2, 0x2, 0x0)
/go/src/fyne.io/fyne/container.go:130 +0x9b
main.generate_text_question_form(0x97c5db, 0x5, 0x18b62)
/Desktop/tmk/final.go:66 +0x13f
main.main()
/Desktop/tmk/final.go:82 +0xfa
The text was updated successfully, but these errors were encountered: