3
25
Fork
You've already forked fpdf
10

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

Open
opened 2024年07月16日 22:27:17 +02:00 by daksh-sehgal · 1 comment
daksh-sehgal commented 2024年07月16日 22:27:17 +02:00 (Migrated from github.com)
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 ["参照番"].

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 commented 2024年08月07日 11:56:23 +02:00 (Migrated from github.com)
Copy link

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-30pdf.MultiCell(width,8,"该视频中共检测出 2 项格式问题,此类问题可能会导致:可能影响视频播放,影响播放体验",fpdf.BorderNone,fpdf.AlignLeft,false)
image
I had the same problem: ```golang 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) ``` <img width="710" alt="image" src="https://github.com/user-attachments/assets/06df790f-f735-47a2-b040-676488cb388a">
Sign in to join this conversation.
No Branch/Tag specified
main
v0.12.0
v0.11.1
v0.10.0
v0.11.0
v0.9.0
v0.8.0
v0.7.0
v0.6.0
v0.5.0
v1.4.3
v0.4.1
v0.4.0
v0.3.1
v0.3.0
v0.2.0
v0.1.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
go-pdf/fpdf#80
Reference in a new issue
go-pdf/fpdf
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?