Bug 156853 - Exporting bitmap color fonts to PDF is broken
Summary: Exporting bitmap color fonts to PDF is broken
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Patrick Luby (volunteer)
URL:
Whiteboard: target:24.2.0
Keywords: bibisected, regression
Depends on:
Blocks:
 
Reported: 2023-08-22 04:04 UTC by ⁨خالد حسني⁩
Modified: 2023-08-23 11:32 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Test document (11.03 KB, application/vnd.oasis.opendocument.text)
2023-08-22 04:04 UTC, ⁨خالد حسني⁩
Details
Broken PDF exported from Linux (8.04 KB, application/pdf)
2023-08-22 04:16 UTC, ⁨خالد حسني⁩
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ⁨خالد حسني⁩ 2023-08-22 04:04:50 UTC
Created attachment 189086 [details]
Test document

See the attached document, exporting in master results in PDF with emojis as rectangles with hallow circles. This works fine in 7.6.

This is reproduced on both Linux with Noto Color Emoji font and macOS with Apple Color Emoji since both are bitmap color fonts.
Comment 1 ⁨خالد حسني⁩ 2023-08-22 04:16:00 UTC
Created attachment 189087 [details]
Broken PDF exported from Linux
Comment 2 ⁨خالد حسني⁩ 2023-08-22 04:37:26 UTC
Bibisected to:

commit 81994cb2b8b32453a92bcb011830fcb884f22ff3
Date:   Fri Apr 16 20:33:10 2021 +0200

    Convert internal vcl bitmap formats transparency->alpha (II)
Comment 3 ⁨خالد حسني⁩ 2023-08-22 04:53:11 UTC
The code that writes bitmap color glyphs to PDF is in https://opengrok.libreoffice.org/xref/core/vcl/source/gdi/pdfwriter_impl.cxx?r=c9da81db#2704, in case it helps debugging this.
Comment 4 Commit Notification 2023-08-22 07:56:29 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3e20c3e73cbd10e8323f0997e3a6536abd11e2bd

tdf#156853: Fix PDF export of bitmap color fonts

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2023-08-22 12:37:25 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8dc8413b4f8037b9c89f08a5b0b939bb61052585

Revert "tdf#156853: Fix PDF export of bitmap color fonts"

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Patrick Luby (volunteer) 2023-08-22 21:17:29 UTC
I can reproduce this as well. Unfortunately, the initial fix caused the same bug to now occur with all transparent images and shapes.

So I will see if I can find what is unique about emoji bitmaps.
Comment 7 Commit Notification 2023-08-23 11:26:26 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7d745697eec8dc5702eb0ebaa8c4b5122c31edab

tdf#156853: Fix PDF export of bitmap color fonts

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Patrick Luby (volunteer) 2023-08-23 11:32:13 UTC
I committed a fix and it should be in tomorrow's (24 August 2023) nightly master build.