Bug 143343 - IPA Contour characters lose the first on PDF export
Summary: IPA Contour characters lose the first on PDF export
Status: RESOLVED DUPLICATE of bug 112152
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
7.1.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Font-Rendering PDF-Export
  Show dependency treegraph
 
Reported: 2021-07-14 04:03 UTC by martin_hosken
Modified: 2022-12-28 18:00 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample doc requires Charis SIL (11.91 KB, application/vnd.oasis.opendocument.text)
2021-07-14 04:03 UTC, martin_hosken
Details
Generated PDF (45.40 KB, application/pdf)
2021-07-14 04:04 UTC, martin_hosken
Details
Charis SIL font (711.00 KB, application/octet-stream)
2021-07-14 04:06 UTC, martin_hosken
Details
evince of pdf screenshot (22.64 KB, image/png)
2021-07-20 02:32 UTC, martin_hosken
Details
firefox pdf viewer screenshot (38.57 KB, image/png)
2021-07-20 02:33 UTC, martin_hosken
Details

Note You need to log in before you can comment on or make changes to this bug.
Description martin_hosken 2021-07-14 04:03:54 UTC
Created attachment 173545 [details]
Sample doc requires Charis SIL

In the enclosed file, the first character in any IPA tone letters sequence is lost in the (enclosed) PDF generated.
Comment 1 martin_hosken 2021-07-14 04:04:33 UTC
Created attachment 173546 [details]
Generated PDF
Comment 2 martin_hosken 2021-07-14 04:06:35 UTC
Created attachment 173547 [details]
Charis SIL font
Comment 3 Buovjaga 2021-07-19 10:33:21 UTC
Repro. From what I gather the attached PDF is the *good* result.

NixOS
Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: b1df9c67349cf4cc5be4128d797aefb87f50e38f
CPU threads: 16; OS: Linux 5.13; UI render: default; VCL: x11
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Comment 4 martin_hosken 2021-07-20 02:32:58 UTC
Created attachment 173691 [details]
evince of pdf screenshot
Comment 5 martin_hosken 2021-07-20 02:33:52 UTC
Created attachment 173692 [details]
firefox pdf viewer screenshot
Comment 6 martin_hosken 2021-07-20 03:56:31 UTC
Looking inside the PDF, the subset font of Charis is faulty. It looks like that referenced component glyphs are allocated ids and referenced within the glyph (in the glyf) table, but the extra glyphs are never actually added to the font.

For example, in the Charis subset in the PDF, glyph 1 is a compound glyph that references glyph 59. But there are only 59 glyphs in the font (0 through 58) and so there is no glyph 59 to be referenced.

Looking at the code in vcl, the glyfAdd function (fontsubset/ttcr.cxx) does the job of adding glyphs and references to the list of glyphs. But the calling code in CreateT42FromTTGlyphs (fontsubset/sfnt.cxx) (or is it CreateTTFromTTGlyphs?) does nothing with this. It only iterates over the nGlyphs it starts with.

My thinking is that what is needed is an initial recursive iteration over all the glyphs to identify which need to be included. This will update nGlyphs. And only then to output all the tables.
Comment 7 ⁨خالد حسني⁩ 2022-12-28 18:00:13 UTC

*** This bug has been marked as a duplicate of bug 112152 ***