Skip to content
This repository has been archived by the owner on Nov 13, 2021. It is now read-only.

Hope it can be solved. Font file error, throw an exception or skip #330

Open
givetimetolife opened this issue Nov 1, 2019 · 2 comments
Open

Comments

@givetimetolife
Copy link

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

@jung-kurt
Copy link
Owner

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.

@jung-kurt
Copy link
Owner

#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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants