Bug 266214

Summary: PDF version of FreeBSD handbook (in zh-cn) has missing characters
Product: Documentation Reporter: Henry Hu <henry.hu.sh>
Component: Books & ArticlesAssignee: Danilo G. Baio <dbaio>
Status: Closed FIXED    
Severity: Affects Only Me CC: dbaio, lwhsu
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Henry Hu 2022-09-04 03:16:51 UTC
PDF version of FreeBSD handbook (in zh-cn) downloaded from https://docs.freebsd.org/zh-cn/books/handbook/ has missing characters.

For example, in the second page, "欢" in the first sentence (欢迎使用...) is not displayed correctly. A box or an empty space is displayed instead.

It seems like that the file uses the font "M+ 1p" (https://fonts.adobe.com/fonts/m-plus-1p) by default. However, this is a Japanese font, and does not cover all Chinese characters. For the missing characters, the file seems to fallback to another font, Noto Serif. However, the font does not seem to be embedded correctly. As a result, characters missing from "M+ 1p" are not displayed correctly. If we open the file in PDFBox's PDF debugger, the errors are logged:

WARNING: No glyph for 33 in font 0746d7+NotoSerif
WARNING: No glyph for 33 in font bbf95d+NotoSerif-Italic
....

There are other issues in using the wrong font: some characters are written differently in Japanese and Chinese, although they share the same code point. As a result, to properly produce a PDF in Chinese, a Chinese font should be used.

Using a proper Chinese font when converting the handbook to PDF may resolve the issue.
Comment 1 Li-Wen Hsu freebsd_committer freebsd_triage 2022-10-22 17:31:22 UTC
This is patch for zh-tw: https://reviews.freebsd.org/D36623
I think zh-cn may need similar fix.
Comment 2 Danilo G. Baio freebsd_committer freebsd_triage 2023-01-21 12:46:14 UTC
Hi.

There was an improvement in this; would you please check if it's all right now?

https://download.freebsd.org/doc/zh-cn/books/handbook/

Thank you in advance.
Comment 3 Danilo G. Baio freebsd_committer freebsd_triage 2023-01-28 12:35:50 UTC
Hi.

Closing this, some users reported PDFs are ok now.
If you find any issues, please let us know.