gofpdf
gofpdf copied to clipboard
Hope it can be solved. Font file error, throw an exception or skip
When I use a font file to write PDF, when the file contains unsupported characters. Expect to return an obvious error instead of an error "jung-kurt/gofpdf/fpdf.go:2789". Or you can skip unsupported data,Continue to write。
location: jung-kurt/gofpdf/fpdf.go:2789 ==》 l += float64(cw[int(c)])
error: panic: runtime error: index out of range [127775] with length 65536 [recovered] panic: runtime error: index out of range [127775] with length 65536
This is related to a shortcoming discussed in #255. The contributor of the UTF-8 code has not made any comments about this.
Or you can skip unsupported data,Continue to write
I think this is the most practical expedient at this point.
#337 fixes this when it occurs within a call to MultiCell()
. An error will be returned in the case of an out-of-range rune. Errors can be handled as described in the documentaiton.