jsPDF icon indicating copy to clipboard operation
jsPDF copied to clipboard

TrueType font with format 12 CMAP is not shown.

Open HosokawaR opened this issue 1 year ago • 1 comments

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. https://github.com/parallax/jsPDF/pull/3738

Reproduction

See → https://github.com/HosokawaR/jsPDF/pull/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 avatar Jun 03 '24 14:06 HosokawaR

This issue may be related https://github.com/parallax/jsPDF/issues/3152

HosokawaR avatar Jun 03 '24 15:06 HosokawaR

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.

github-actions[bot] avatar Sep 20 '24 02:09 github-actions[bot]