golang / freetype

The Freetype font rasterizer in the Go programming language.
Other
786 stars 184 forks source link

range bug #87

Open Leadrive opened 2 years ago

Leadrive commented 2 years ago
panic: runtime error: index out of range [104] with length 104

goroutine 319 [running]:
github.com/golang/freetype/truetype.(*GlyphBuf).loadSimple(0x17e9590, 0x1583df0, 0x68, 0x75cb5, 0x1, 0x1583ce6, 0x0, 0x75dbf)
    C:/gowork/pkg/mod/github.com/golang/freetype@v0.0.0-20170609003504-e2365dfdc4a0/truetype/glyph.go:331 +0x590
github.com/golang/freetype/truetype.(*GlyphBuf).load(0x17e9590, 0x0, 0x10012, 0x0, 0x0)
    C:/gowork/pkg/mod/github.com/golang/freetype@v0.0.0-20170609003504-e2365dfdc4a0/truetype/glyph.go:229 +0x264
github.com/golang/freetype/truetype.(*GlyphBuf).Load(0x17e9590, 0x10d6100, 0x900, 0x12, 0x0, 0x0, 0xd)
    C:/gowork/pkg/mod/github.com/golang/freetype@v0.0.0-20170609003504-e2365dfdc4a0/truetype/glyph.go:102 +0x90
github.com/golang/freetype/truetype.(*face).GlyphAdvance(0x17e8000, 0x33, 0x33, 0x0)
    C:/gowork/pkg/mod/github.com/golang/freetype@v0.0.0-20170609003504-e2365dfdc4a0/truetype/face.go:345 +0x58
golang.org/x/image/font.MeasureString(0x61f42c, 0x17e8000, 0x1530da0, 0xc, 0x0)
    C:/gowork/pkg/mod/golang.org/x/image@v0.0.0-20210607152325-775e3b0c77b9/font/font.go:301 +0x80
golang.org/x/image/font.(*Drawer).MeasureString(...)
    C:/gowork/pkg/mod/golang.org/x/image@v0.0.0-20210607152325-775e3b0c77b9/font/font.go:215
nigeltao commented 2 years ago

Can you attach the .ttf file?

Leadrive commented 2 years ago

leadrive.zip ttf file. @nigeltao