vcl/source/gdi/pdfwriter_impl.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit fc9c9b53d89472ed2ae498052a405cd4e5221e17
Author:     Khaled Hosny <kha...@aliftype.com>
AuthorDate: Sat Dec 10 00:51:00 2022 +0200
Commit:     خالد حسني <kha...@aliftype.com>
CommitDate: Sat Dec 10 12:59:36 2022 +0000

    vcl: Add subset ID to Type 3 fonts embedded in PDF
    
    This was overlooked before and can lead to duplicate font names in PDF.
    
    Change-Id: I16bd0e64663b5f62f90b91576644439079213e64
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143901
    Tested-by: Jenkins
    Reviewed-by: خالد حسني <kha...@aliftype.com>
    (cherry picked from commit ff6e3635c1f82db401309e95cb90f0b78554ae6e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143916

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index bb4936129e91..f4a3145c5085 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2472,7 +2472,7 @@ bool PDFWriterImpl::emitType3Font(const 
vcl::font::PhysicalFontFace* pFace,
         // write font descriptor
         sal_Int32 nFontDescriptor = 0;
         if (m_aContext.Version > PDFWriter::PDFVersion::PDF_1_4)
-            nFontDescriptor = emitFontDescriptor(pFace, aSubsetInfo, 0, 0);
+            nFontDescriptor = emitFontDescriptor(pFace, aSubsetInfo, 
rSubset.m_nFontID, 0);
 
         if (nToUnicodeStream)
             nToUnicodeStream = createToUnicodeCMap(pEncoding, 
aCodeUnits.data(), pCodeUnitsPerGlyph,
commit 345e2a30b33899ebc965bbf47d831b7943047e63
Author:     Khaled Hosny <kha...@aliftype.com>
AuthorDate: Sat Dec 10 01:24:51 2022 +0200
Commit:     خالد حسني <kha...@aliftype.com>
CommitDate: Sat Dec 10 12:59:27 2022 +0000

    vcl: Add /Name key to Type 3 font dictionary
    
    Even though the spec says it is deprecated and Acrobat ignores it,
    several tools including Acrobat readers won’t show font name for Type 3
    fonts unless there is one in the font dictionary.
    
    Change-Id: I8e65a1cf1d89744e9d89542d3540c7f3ba938369
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143903
    Tested-by: Jenkins
    Reviewed-by: خالد حسني <kha...@aliftype.com>
    (cherry picked from commit 4e5032fe8ae6e2d9e59eebb8708b004b5cf3136b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143917

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 5958a202e29e..bb4936129e91 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2486,9 +2486,10 @@ bool PDFWriterImpl::emitType3Font(const 
vcl::font::PhysicalFontFace* pFace,
         OStringBuffer aLine(1024);
         aLine.append(nFontObject);
         aLine.append(" 0 obj\n"
-                     "<</Type/Font/Subtype/Type3\n");
+                     "<</Type/Font/Subtype/Type3/Name/");
+        appendName(aSubsetInfo.m_aPSName, aLine);
 
-        aLine.append("/FontBBox[");
+        aLine.append("\n/FontBBox[");
         // note: Top and Bottom are reversed in VCL and PDF rectangles
         aLine.append(OString::number(aSubsetInfo.m_aFontBBox.Left()));
         aLine.append(' ');

Reply via email to