Bug 146916 - LibreOffice failed to load non-Unicode CJK fonts
Summary: LibreOffice failed to load non-Unicode CJK fonts
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.3.0.2 rc
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-22 09:35 UTC by Volga
Modified: 2022-07-30 11:59 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Font file used to reproduce this bug (2.66 MB, application/x-7z-compressed)
2022-01-22 10:27 UTC, Volga
Details
The font displaying properly with Windows Font Viewer (73.69 KB, image/png)
2022-01-22 10:29 UTC, Volga
Details
The font failed to display glyphs at LibreOffice Writer (19.02 KB, image/png)
2022-01-22 10:31 UTC, Volga
Details
The same font is displaying properly in WPS Office (56.87 KB, image/png)
2022-01-23 10:21 UTC, Volga
Details
The same font is displaying properly in WPS Office (56.87 KB, image/png)
2022-01-23 10:23 UTC, Volga
Details
Screenshot from LibreOffice 3.5 (63.96 KB, image/png)
2022-07-28 09:43 UTC, Hossein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Volga 2022-01-22 09:35:42 UTC
Description:
I've got the 文鼎中行书简 font, in this font the characters are mapped only in GB2312, but when I try to use this font in LibreOffice Writer, all the glyphs are failed to present.

Steps to Reproduce:
1. Download attached RAR package, extract the TTF font file, and install this font.
2. Open LibreOffice Writer
3. Input 中国智造,惠及全球
4. Select 文鼎中行书简 at font list

Actual Results:
Although 文鼎中行书简 is used, LibreOffice does not display all glyphs from this font. But the font file could be load properly at Windows Font Viewer.

Expected Results:
LibreOffice should do round-trip compatibility between Unicode and non-Unicode CJK fonts, and load glyphs properly.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.3.0.2 (x64) / LibreOffice Community
Build ID: f1c9017ac60ecca268da7b1cf147b10e244b9b21
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: zh-CN (zh_CN); UI: zh-CN
Calc: threaded
Comment 1 Volga 2022-01-22 10:27:56 UTC
Created attachment 177701 [details]
Font file used to reproduce this bug

This font is archived in RAR format inside this attachment.
Comment 2 Volga 2022-01-22 10:29:39 UTC
Created attachment 177702 [details]
The font displaying properly with Windows Font Viewer
Comment 3 Volga 2022-01-22 10:31:31 UTC
Created attachment 177703 [details]
The font failed to display glyphs at LibreOffice Writer
Comment 4 Volga 2022-01-23 10:21:32 UTC
Created attachment 177719 [details]
The same font is displaying properly in WPS Office
Comment 5 Volga 2022-01-23 10:23:12 UTC
Created attachment 177720 [details]
The same font is displaying properly in WPS Office
Comment 6 Heiko Tietze 2022-07-28 08:48:48 UTC
Hossein, Lazso, Mark... any idea?
Comment 7 Hossein 2022-07-28 09:43:33 UTC
Created attachment 181470 [details]
Screenshot from LibreOffice 3.5

I think this is not a LibreOffice bug. It seems to be a bug from underlying text-rendering libraries. Harfbuzz can not render using this font:

I've tested the latest version of HarfBuzz which is 5.0:

./util/hb-view 文鼎中行书简.ttf 文鼎中行书简
# BLANK OUTPUT

On the other hand, previous versions of LibreOffice that did not use Harfbuzz could use this font. Please see the attachment.

LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Comment 8 Heiko Tietze 2022-07-28 10:45:36 UTC
So resolve NOB? Mark, Laszlo do you agree?
Comment 9 Mark Hung 2022-07-28 14:49:59 UTC
(In reply to Heiko Tietze from comment #8)
> So resolve NOB? Mark, Laszlo do you agree?

I inspected the font with Font Forge. The encoding was EUC GB2312. I re-encoded the file with ISO10646-1 ( Unicode BMP ) and generated a new font file than compare them with the utility hb-shape from Harfbuzz.

Original TTF:
./harfbuzz-5.0.1/util/hb-shape font.ttf "中国智造,惠及全球"   [gid0=0+1024|gid0=1+1024|gid0=2+1024|gid0=3+1024|gid0=4+1024|gid0=5+1024|gid0=6+1024|gid0=7+1024|gid0=8+1024]

Re-encoded TTF:
./harfbuzz-5.0.1/util/hb-shape GBHerSin-Medium.ttf "中国智造,惠及全球"
[uni4E2D=0+1024|uni56FD=1+1024|uni667A=2+1024|uni9020=3+1024|uniFF0C=4+1024|uni60E0=5+1024|uni53CA=6+1024|uni5168=7+1024|uni7403=8+1024]


Given https://harfbuzz.github.io/what-harfbuzz-doesnt-do.html :
HarfBuzz will take a Unicode string, shape it, and give you the information required to lay it out correctly on a single horizontal (or vertical) line using the font provided. That is the extent of HarfBuzz's responsibility.

So I think it's NOB.