Bug 146732 - PDF Export: The document uses "Noto Sans CJK SC" font but the embedded font in PDF is NotoSansCJKjp
Summary: PDF Export: The document uses "Noto Sans CJK SC" font but the embedded font i...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: CJK PDF-Export
  Show dependency treegraph
 
Reported: 2022-01-13 11:01 UTC by Kevin Suo
Modified: 2022-12-06 10:10 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
testNotoSansCJKScFont.odt (8.93 KB, application/vnd.oasis.opendocument.text)
2022-01-13 11:01 UTC, Kevin Suo
Details
testNotoSansCJKScFont.pdf (3.84 KB, application/pdf)
2022-01-13 11:02 UTC, Kevin Suo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Suo 2022-01-13 11:01:06 UTC
Created attachment 177520 [details]
testNotoSansCJKScFont.odt

The attached ODT file contains a paragraph applied with "Noto Sans CJK SC" font. When export to PDF, the embedded font is named as "BAAAAA+NotoSansCJKjp-Regular-VKana" (i.e. it choose the Japanese variant of the Noto Sans CJK font collection.

Steps to reproduce:

1. Install "Noto Sans CJK SC" font.

On Fedora, the packages are:
google-noto-sans-cjk-jp-fonts.noarch : Japanese Multilingual Sans OTF font files for google-noto-cjk-fonts
google-noto-sans-cjk-sc-fonts.noarch : Simplified Chinese Multilingual Sans OTF font files for google-noto-cjk-fonts

2. Export the attached test odt file to PDF.

Current Result:

It seems the NotoSansCJKjp one is used, or maybe the corrent font is used but the wrong font name is used in PDF (I am not sure).

$ pdffonts ./testNotoSansCJKScFont.pdf 
name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
BAAAAA+NotoSansCJKjp-Regular-VKana   Type 1            Builtin          yes yes yes      9  0

Expected Result:

BAAAAA+NotoSansCJKSc-Regular-VKana
Comment 1 Kevin Suo 2022-01-13 11:01:35 UTC
Version: 7.2.4.1 / LibreOffice Community
Build ID: 27d75539669ac387bb498e35313b970b7fe9c4f9
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: zh-CN (zh_CN.UTF-8); UI: zh-CN

Fedora 34
Comment 2 Kevin Suo 2022-01-13 11:02:14 UTC
Created attachment 177521 [details]
testNotoSansCJKScFont.pdf
Comment 3 ⁨خالد حسني⁩ 2022-12-05 15:37:35 UTC
I can’t reproduce this, how did you install Noto Sans CJK and what files did you use?
Comment 4 Kevin Suo 2022-12-05 16:06:35 UTC
It was the default fonts installed on Fedora workstation. The fonts are in /usr/share/fonts/google-noto-cjk and the file names are:

[suokunlong@fedora37-kevinsuo google-noto-cjk]$ ls
NotoSansCJK-Black.ttc      NotoSerifCJK-Black.ttc
NotoSansCJK-Bold.ttc       NotoSerifCJK-Bold.ttc
NotoSansCJK-DemiLight.ttc  NotoSerifCJK-ExtraLight.ttc
NotoSansCJK-Light.ttc      NotoSerifCJK-Light.ttc
NotoSansCJK-Medium.ttc     NotoSerifCJK-Medium.ttc
NotoSansCJK-Regular.ttc    NotoSerifCJK-Regular.ttc
NotoSansCJK-Thin.ttc       NotoSerifCJK-SemiBold.ttc

If I open e.g. the font NotoSansCJK-Regular.ttc with fontforge, a dialog is popped up stating that there are multiple fonts included in this file and let me select one font. I select Noto Sans CJK SC, click OK, and then I see from the font information dialog that the postscript name is "NotoSansCJKjp-Regular-Alphabetic". As a result, I am not sure whether this is a bug in the font collection itself, or a bug in FontForge, or in Fedora itself.
Comment 5 Kevin Suo 2022-12-05 16:09:45 UTC
The rpm package is:
https://src.fedoraproject.org/rpms/google-noto-cjk-fonts
Comment 6 ⁨خالد حسني⁩ 2022-12-05 19:18:07 UTC
I can reproduce this issue with TTC file and 7.4, but not in master. Can you please confirm?
Comment 7 ⁨خالد حسني⁩ 2022-12-05 19:22:21 UTC
It seems that the fix for bug 138325 also fixed this issue. If I revert that commit, I get the issue here in master as well.