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

TrueType font with format 12 CMAP is not shown. #3737

Open
HosokawaR opened this issue Jun 3, 2024 · 2 comments · May be fixed by #3738
Open

TrueType font with format 12 CMAP is not shown. #3737

HosokawaR opened this issue Jun 3, 2024 · 2 comments · May be fixed by #3738

Comments

@HosokawaR
Copy link

HosokawaR commented Jun 3, 2024

Thank you for a nice library.

jsPDF can not show TrueType font with format 12 CMAP.

I want jsPDF to support format 12 CMAP of TrueType font because I want to show char beyond Unicode 0xffff.
Now, jsPDF supports only format 4 and 12 CMAP, so chars beyond Unicode 0xffff are not shown.

For example, "𠮷" is 0x20BB7, so it's Unicode beyond 0xffff.
Some Japanese people's names contain the above chats, and I want to display them correctly.

I will create PR.
Created. #3738

Reproduction

See → HosokawaR#2

doc.text("吉𠮷", 20, 30);
doc.addFont(
        "./test/reference/fonts/NotoSansJP/NotoSansJP-Regular.ttf",
        "NotoSansJP-Regular",
        "normal"
)
doc.setFont("NotoSansJP-Regular"); // set font
doc.setFontSize(40);
doc.text("吉𠮷", 20, 30);
doc.save("format-12.pdf")

"吉" is shown but "𠮷" is not shown.

image

@HosokawaR HosokawaR linked a pull request Jun 3, 2024 that will close this issue
@HosokawaR
Copy link
Author

This issue may be related #3152

Copy link

This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.

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

Successfully merging a pull request may close this issue.

1 participant