vcl/source/gdi/pdfwriter_impl.cxx | 7 +++++++ 1 file changed, 7 insertions(+)
New commits: commit 7ea34aa61f1c669710ed93e8e5cf2d19b452a371 Author: Khaled Hosny <kha...@aliftype.com> AuthorDate: Mon May 8 16:14:52 2023 +0300 Commit: خالد حسني <kha...@aliftype.com> CommitDate: Mon May 8 18:10:25 2023 +0200 tdf#155161: Always embed fonts with CFF2 table as PDF Type 3 fonts PDF doesn’t support CFF2 table and we currently don’t 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/+/151532 Tested-by: Jenkins Reviewed-by: خالد حسني <kha...@aliftype.com> diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index d146e3ae85dc..96c1193ea9ef 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -6295,6 +6295,13 @@ void PDFWriterImpl::registerGlyph(const sal_GlyphId nFontGlyphId, sal_uInt8& nMappedGlyph, sal_Int32& nMappedFontObject) { auto bVariations = !pFace->GetVariations(*pFont).empty(); + // tdf#155161 + // PDF doesn’t support CFF2 table and we currently don’t 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.