go-pdf / fpdf

A PDF document generator with high level support for text, drawing and images
MIT License
515 stars 46 forks source link

fixed rendering bug for th, zh, ja #81

Open daksh-sehgal opened 2 months ago

daksh-sehgal commented 2 months ago

Fixes issue #80 by not excluding Chinese origin characters when calling SplitText(). Also fixes a rendering bug with zero width characters (found in languages like Thai).

Kohirus commented 1 month ago

This fix is great, but there is a problem that if the text contains Spaces, it will force line breaks.

Kohirus commented 1 month ago

I found the source of the problem, commented out the following in the MulitCell(), as well as the SplitText() and write(). Why do spaces need to be wrapped, maybe some languages ​​require this?

if c == ' '  {
     sep = i
     ls = l
    ns++
}
sbinet commented 3 weeks ago

thanks for the PR. (and apologies for the belated answer)

could you add a testcase to this PR ? (perhaps also adding a testcase exercizing what @Kohirus mentioned ?)

thanks again.