[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - vcl/source

Khaled Hosny khaledhosny at eglug.org
Mon Jun 24 11:53:31 PDT 2013


 vcl/source/gdi/pdfwriter_impl.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 306ed04b0ac9a166a0a16f0324384d541c7fc0cb
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Mon Jun 24 18:01:04 2013 +0200

    fdo#66108 crash in PDF when using Helvetica font
    
    When using Helvetica fonts with any character it supports outside Adobe
    standard font encoding, PDF writer will force font fallback which we do
    not support in Core Text and AquaSalGraphics will crash. With ATSUI we
    do not crash, but no characters are output either.
    
    This happens because PDF writer registers 14 “virtual” standard PDF
    fonts, including Helvetica, and tries to use them if possible instead of
    the real font.
    
    Now the concept of standard fonts is obsolete, and Adobe now recommends
    that all fonts are embedded in the PDF, so here I just disable that
    mechanism when on Mac as a quick fix to avoid the crash, but eventually
    this stuff should dropped entirely.
    
    Change-Id: I3a4d8793d1d2124749372452ffa6ba3145dbd9cd
    Reviewed-on: https://gerrit.libreoffice.org/4485
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index b8bd0bc..c478dff 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -1723,7 +1723,11 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal
         m_nCurrentStructElement( 0 ),
         m_bEmitStructure( true ),
         m_bNewMCID( false ),
+#ifdef MACOSX
+        m_bEmbedStandardFonts( true ),
+#else
         m_bEmbedStandardFonts( false ),
+#endif
         m_nNextFID( 1 ),
         m_nInheritedPageWidth( 595 ),  // default A4
         m_nInheritedPageHeight( 842 ), // default A4
@@ -1840,7 +1844,9 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal
     if( m_bIsPDF_A1 )
         m_aContext.Version = PDFWriter::PDF_1_4; //meaning we need PDF 1.4, PDF/A flavour
 
+#ifndef MACOSX
     m_bEmbedStandardFonts = m_aContext.EmbedStandardFonts;
+#endif
 }
 
 PDFWriterImpl::~PDFWriterImpl()


More information about the Libreoffice-commits mailing list