vcl/source/gdi/pdfwriter_impl.cxx | 7 +++++++ 1 file changed, 7 insertions(+)
New commits: commit 79250a55589007930278e3fa59ccdf24c6ff8ea6 Author: Khaled Hosny <kha...@aliftype.com> AuthorDate: Mon May 8 16:14:52 2023 +0300 Commit: Adolfo Jayme Barrientos <fit...@ubuntu.com> CommitDate: Mon May 8 22:23:13 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/+/151515 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> 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 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.