Bug 121327 - Support multi-colored fonts using CBDT/SBIX tables
Summary: Support multi-colored fonts using CBDT/SBIX tables
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: خالد حسني
URL:
Whiteboard: target:7.5.0 inReleaseNotes:7.5
Keywords:
: 94655 95822 128387 129148 129906 133296 134865 138257 139892 140847 141342 147242 152180 (view as bug list)
Depends on: HarfBuzz
Blocks: Font-Rendering 129523
  Show dependency treegraph
 
Reported: 2018-11-10 07:12 UTC by Volga
Modified: 2023-02-06 13:51 UTC (History)
20 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Emojis as shadows (44.06 KB, image/png)
2023-02-06 13:44 UTC, Stuardo Rodríguez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Volga 2018-11-10 07:12:25 UTC
Description:
This is similar to bug 104403, but for fonts with CBDT/sbix tables instead (https://docs.microsoft.com/zh-cn/typography/opentype/spec/cbdt https://docs.microsoft.com/zh-cn/typography/opentype/spec/sbix). This might be a trickier as instead of rendering layered glyphs with different colors we will need to render raster graphics. We already have decent raster image support, but LibreOffice doesn’t make use of it from a low level as text rendering in VCL. Since HarfBuzz got support in version 2.1.0, it’s possible to render color glyphs via accessing these tables.

Steps to Reproduce:
-

Actual Results:
-

Expected Results:
-


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Xisco Faulí 2019-01-14 18:27:45 UTC
Moving to NEW
Comment 2 V Stuart Foote 2019-10-25 14:23:54 UTC
*** Bug 128387 has been marked as a duplicate of this bug. ***
Comment 3 V Stuart Foote 2020-01-10 14:25:46 UTC
@Khaled, for export to PDF does your c11 from bug 104403 against COLR/CPAL table fonts apply here as well?

"For PDF, we would need to call HarfBuzz to decompose the color glyph layers before writing them to the PDF, should be a couple of days work or so if someone is interested."
Comment 4 V Stuart Foote 2020-01-10 14:28:20 UTC
*** Bug 129906 has been marked as a duplicate of this bug. ***
Comment 5 خالد حسني 2020-01-11 18:29:03 UTC
(In reply to V Stuart Foote from comment #3)
> @Khaled, for export to PDF does your c11 from bug 104403 against COLR/CPAL
> table fonts apply here as well?
> 
> "For PDF, we would need to call HarfBuzz to decompose the color glyph layers
> before writing them to the PDF, should be a couple of days work or so if
> someone is interested."

For bitmap format, HarfBuzz can give the PNG and then someone need to figure out how to embed it in the PDF file.
Comment 6 Volga 2020-01-12 11:25:34 UTC
(In reply to Khaled Hosny from comment #5)
> (In reply to V Stuart Foote from comment #3)
> > @Khaled, for export to PDF does your c11 from bug 104403 against COLR/CPAL
> > table fonts apply here as well?
> > 
> > "For PDF, we would need to call HarfBuzz to decompose the color glyph layers
> > before writing them to the PDF, should be a couple of days work or so if
> > someone is interested."
> 
> For bitmap format, HarfBuzz can give the PNG and then someone need to figure
> out how to embed it in the PDF file.
I think there are two keys to do, first, embed exposed raster image at its position within text, second, embed text string info into the raster image.
Comment 7 Volga 2020-10-31 08:07:03 UTC Comment hidden (obsolete)
Comment 8 Volga 2020-12-18 17:39:50 UTC
(In reply to Volga from comment #6)
> I think there are two keys to do, first, embed exposed raster image at its
> position within text, second, embed text string info into the raster image.
The model can be seen from this document, althrough the pages are filled by scanned image, I can still select and copy the content.

http://internationalcongressesofvexillology-proceedingsandreports.yolasite.com/resources/15th_Zurich/Berry-BritishSouthAfricaCompany.pdf
Comment 9 خالد حسني 2022-08-12 17:29:45 UTC
*** Bug 94655 has been marked as a duplicate of this bug. ***
Comment 10 خالد حسني 2022-08-13 15:49:05 UTC
*** Bug 147242 has been marked as a duplicate of this bug. ***
Comment 11 Commit Notification 2022-09-23 10:29:17 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/77cce80bb56801acf22da2149bd597d0d7793e3b

vcl: tdf#121327 PDF export for bitmap color fonts

It will be available in 7.5.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 12 خالد حسني 2022-09-24 06:38:04 UTC
*** Bug 133296 has been marked as a duplicate of this bug. ***
Comment 13 خالد حسني 2022-09-24 06:40:41 UTC
*** Bug 134865 has been marked as a duplicate of this bug. ***
Comment 14 خالد حسني 2022-09-24 06:43:18 UTC
*** Bug 138257 has been marked as a duplicate of this bug. ***
Comment 15 خالد حسني 2022-09-24 06:47:05 UTC
*** Bug 140847 has been marked as a duplicate of this bug. ***
Comment 16 خالد حسني 2022-09-24 06:47:20 UTC
*** Bug 139892 has been marked as a duplicate of this bug. ***
Comment 17 خالد حسني 2022-09-24 06:51:49 UTC
*** Bug 141342 has been marked as a duplicate of this bug. ***
Comment 18 خالد حسني 2022-09-24 07:53:12 UTC
*** Bug 95822 has been marked as a duplicate of this bug. ***
Comment 19 خالد حسني 2022-09-24 08:10:26 UTC
*** Bug 129148 has been marked as a duplicate of this bug. ***
Comment 20 Xisco Faulí 2022-10-03 10:47:38 UTC
Hi khaled,
Would it be possible to add short comment about this issue to the release notes ? -> https://wiki.documentfoundation.org/ReleaseNotes/7.5
Comment 21 خالد حسني 2022-10-03 16:43:09 UTC
(In reply to Xisco Faulí from comment #20)
> Hi khaled,
> Would it be possible to add short comment about this issue to the release
> notes ? -> https://wiki.documentfoundation.org/ReleaseNotes/7.5

Sure, I’ll give it a try.
Comment 22 خالد حسني 2022-11-24 06:40:20 UTC
*** Bug 152180 has been marked as a duplicate of this bug. ***
Comment 23 Stéphane Guillou (stragu) 2022-12-03 23:05:26 UTC
Verified as fixed in:

Version: 7.5.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a41c82407bbb73a4d87070326485ec4b4e954a65
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Thanks Khaled! :)
Comment 24 Stuardo Rodríguez 2023-02-06 13:43:32 UTC
I was very exited to see this fix in 7.5. I've just installed it and I do see the emojis now, but they are shown as a grey shadow. No colors, nor lines, just a gray shadow.
Comment 25 Stuardo Rodríguez 2023-02-06 13:44:02 UTC
Created attachment 185151 [details]
Emojis as shadows
Comment 26 خالد حسني 2023-02-06 13:51:57 UTC
(In reply to Stuardo Rodríguez from comment #25)
> Created attachment 185151 [details]
> Emojis as shadows

How did you install libreoffice? Please also attach the PDF file.