Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling SplitText on Japanese/Chinese characters removes some of them. #80

Open
daksh-sehgal opened this issue Jul 16, 2024 · 1 comment

Comments

@daksh-sehgal
Copy link

If you call splitText on a string such as "参照番号", it may have the last character removed for some widths. i.e. SplitText("参照番号", 18.46) returns ["参照番"].

@Kohirus
Copy link

Kohirus commented Aug 7, 2024

I had the same problem:

pdf := fpdf.New("P", "mm", "A4", "./fonts")
pdf.AddUTF8Font("myfont", "", "font.ttf")
pdf.SetFont("myfont", "", 14)
pageWidth, _ := pdf.GetPageSize()
width := pageWidth - 30
pdf.MultiCell(width, 8, "该视频中共检测出 2 项格式问题,此类问题可能会导致:可能影响视频播放,影响播放体验", fpdf.BorderNone, fpdf.AlignLeft, false)
image

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

No branches or pull requests

2 participants