rhbz#2192915 Japanese font not printed

This commit is contained in:
Caolán McNamara 2023-05-09 08:39:28 +01:00
parent 4ea8a1bc9a
commit 78e00588a7
2 changed files with 47 additions and 1 deletions

View File

@ -0,0 +1,42 @@
From 79250a55589007930278e3fa59ccdf24c6ff8ea6 Mon Sep 17 00:00:00 2001
From: Khaled Hosny <khaled@aliftype.com>
Date: Mon, 8 May 2023 16:14:52 +0300
Subject: [PATCH] tdf#155161: Always embed fonts with CFF2 table as PDF Type 3
fonts
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
PDF doesnt support CFF2 table and we currently dont convert them to
Type 1 (like we do with CFF table), so treat it like fonts with
variations and embed as Type 3 fonts.
Change-Id: I963b55d5d0ed1470eda157c7e10cae63195a0c91
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151515
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
---
vcl/source/gdi/pdfwriter_impl.cxx | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 6b9fb711626a..ce26ea6b1342 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -6283,6 +6283,13 @@ void PDFWriterImpl::registerGlyph(const sal_GlyphId nFontGlyphId,
sal_uInt8& nMappedGlyph, sal_Int32& nMappedFontObject)
{
auto bVariations = !pFace->GetVariations(*pFont).empty();
+ // tdf#155161
+ // PDF doesnt support CFF2 table and we currently dont convert them to
+ // Type 1 (like we do with CFF table), so treat it like fonts with
+ // variations and embed as Type 3 fonts.
+ if (!pFace->GetRawFontData(HB_TAG('C', 'F', 'F', '2')).empty())
+ bVariations = true;
+
if (pFace->IsColorFont() || bVariations)
{
// Font has colors, check if this glyph has color layers or bitmap.
--
2.40.1

View File

@ -55,7 +55,7 @@ Summary: Free Software Productivity Suite
Name: libreoffice
Epoch: 1
Version: %{libo_version}.2
Release: 1%{?libo_prerelease}%{?dist}
Release: 2%{?libo_prerelease}%{?dist}
# default new files are: MPLv2
# older files are typically: MPLv2 incorporating work under ASLv2
# nlpsolver is: LGPLv3
@ -269,6 +269,7 @@ Patch4: 0001-default-to-sifr-for-gnome-light-mode.patch
# TODO investigate these
Patch5: 0001-aarch64-failing-here.patch
Patch6: 0001-include-filename-if-the-test-fails.patch
Patch7: 0001-tdf-155161-Always-embed-fonts-with-CFF2-table-as-PDF.patch
# not upstreamed
Patch500: 0001-disable-libe-book-support.patch
@ -2249,6 +2250,9 @@ gtk-update-icon-cache -q %{_datadir}/icons/hicolor &>/dev/null || :
%{_includedir}/LibreOfficeKit
%changelog
* Tue May 09 2023 Caolán McNamara <caolanm@redhat.com> - 1:7.5.3.2-2
- rhbz#2192915 Japanese font not printed
* Thu May 04 2023 Caolán McNamara <caolanm@redhat.com> - 1:7.5.3.2-1
- latest version