joiningdata / lollipops

Lollipop-style mutation diagrams for annotating genetic variations.
GNU General Public License v3.0
182 stars 70 forks source link

an error occurs when using -legend #54

Closed sainadfensi closed 2 years ago

sainadfensi commented 3 years ago

Hi,

Thank you for developing this excellent tool. I find it's useful and easy to use. I tried with local json file and it works well. However, if I add "-legend", I get an error shown below:

panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x1c4 pc=0x1255f4c]

goroutine 1 [running]: github.com/golang/freetype/truetype.(Font).Bounds(0x106b698, 0xa87e0) /Users/jiangjue/go/src/github.com/golang/freetype/truetype/truetype.go:378 +0xc github.com/golang/freetype/truetype.NewFace(0x0, 0xc00010b778) /Users/jiangjue/go/src/github.com/golang/freetype/truetype/face.go:199 +0x325 github.com/joiningdata/lollipops/drawing.(Settings).prepare(0x15086c0, {0xc0000ac060, 0x0, 0x0}, 0xc0000a6360) /Users/jiangjue/go/src/github.com/joiningdata/lollipops/drawing/draw.go:254 +0x11a5 github.com/joiningdata/lollipops/drawing.DrawSVG({0x1340c00, 0xc0000a4100}, {0xc0000ac060, 0x2, 0x2}, 0x10ac6ce) /Users/jiangjue/go/src/github.com/joiningdata/lollipops/drawing/svg.go:44 +0x3b main.createOutput({0x7ffeefbff872, 0x8}, 0xc00010bf50, {0xc0000ac060, 0x0, 0x0}) /Users/jiangjue/go/src/github.com/joiningdata/lollipops/output.go:24 +0x13c main.main() /Users/jiangjue/go/src/github.com/joiningdata/lollipops/main.go:217 +0x7c7

lollipops version: lollipops-v1.5.3-mac64 go version: go version go1.17 darwin/amd64 System: macOS Big Sur 11.4

Bests, Jue

pbnjay commented 2 years ago

Hi Jue,

Can you share all the output and what command-line arguments you are using? In particular, do you get an error about loading Arial.ttf or are you providing that fontPath argument?