Status: Assigned
Owner:
ni...@chromium.orgLabels: Type-Defect Priority-Medium
New issue 1608 by
ni...@chromium.org: Embed CJK font and insert text in PDF, some characters don't render correctly.
https://bugs.chromium.org/p/pdfium/issues/detail?id=1608What steps will reproduce the problem?
1. Download a Noto Sans CJK font, such as NotoSansSC.
2. Using the following steps to embed the font into a PDF and set a text message in CJK characters. Here the text string example is "这是第一句。 这是第二行。".
FPDF_FONT font = FPDFText_LoadFont(
fpdf_document, reinterpret_cast<const uint8_t*>(font_data.data()),
font_data.size(), FPDF_FONT_TYPE1, true);
FPDF_PAGEOBJECT new_obj =
FPDFPageObj_CreateTextObj(fpdf_document, font, 8.0f);
FPDFText_SetText(new_obj,
reinterpret_cast<FPDF_WIDESTRING>(replies_wtext.data()));
FPDFPageObj_Transform(new_obj, 1, 0, 0, 1, 50, 500);
FPDFPage_InsertObject(fpdf_page, new_obj);
FPDFPage_GenerateContent(fpdf_page);
3. Open the PDF in chrome PDF viewer or render with pdfium_test, some characters are not rendered correctly, such as "句", "行" or space, they are rendered as tofu.
--
You received this message because:
1. The project was configured to send all issue notifications to this address
You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings