You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libreoffice/0001-tdf-155161-Always-embe...

43 lines
1.6 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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