summaryrefslogtreecommitdiff
path: root/print/podofo/patches
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2013-07-16 21:28:43 +0000
committerjoerg <joerg@pkgsrc.org>2013-07-16 21:28:43 +0000
commit28b3ff7a407f3c090d0f07227ccd7326173f3ca4 (patch)
tree9edcb99829516c2ed405e92db252cca7f7fbad27 /print/podofo/patches
parentc977e3cef80b2e02f91a4ff44515a556fddbfd0a (diff)
downloadpkgsrc-28b3ff7a407f3c090d0f07227ccd7326173f3ca4.tar.gz
Merge two patches already upstream:
- use a more compact encoding for reals by dropping trailing zeros after the decimal point. - ensure the BaseFont property of the standard PS fonts is preserved. Bump revision.
Diffstat (limited to 'print/podofo/patches')
-rw-r--r--print/podofo/patches/patch-src_base_PdfVariant.cpp30
-rw-r--r--print/podofo/patches/patch-src_doc_PdfFontType1Base14.cpp37
-rw-r--r--print/podofo/patches/patch-src_doc_PdfFontType1Base14.h13
3 files changed, 80 insertions, 0 deletions
diff --git a/print/podofo/patches/patch-src_base_PdfVariant.cpp b/print/podofo/patches/patch-src_base_PdfVariant.cpp
new file mode 100644
index 00000000000..75975a7fe0c
--- /dev/null
+++ b/print/podofo/patches/patch-src_base_PdfVariant.cpp
@@ -0,0 +1,30 @@
+$NetBSD: patch-src_base_PdfVariant.cpp,v 1.1 2013/07/16 21:28:43 joerg Exp $
+
+--- src/base/PdfVariant.cpp.orig 2011-04-19 17:34:25.000000000 +0000
++++ src/base/PdfVariant.cpp
+@@ -267,8 +267,24 @@ void PdfVariant::Write( PdfOutputDevice*
+ std::ostringstream oss;
+ PdfLocaleImbue(oss);
+ oss << std::fixed << m_Data.dNumber;
++ size_t len = oss.str().size();
+
+- pDevice->Write( oss.str().c_str(), oss.str().size() );
++ if( (eWriteMode & ePdfWriteMode_Compact) == ePdfWriteMode_Compact &&
++ oss.str().find('.') != string::npos )
++ {
++ const char *str = oss.str().c_str();
++ while( str[len - 1] == '0' )
++ --len;
++ if( str[len - 1] == '.' )
++ --len;
++ if( len == 0 )
++ {
++ pDevice->Write( "0", 1 );
++ break;
++ }
++ }
++
++ pDevice->Write( oss.str().c_str(), len );
+ break;
+ }
+ case ePdfDataType_HexString:
diff --git a/print/podofo/patches/patch-src_doc_PdfFontType1Base14.cpp b/print/podofo/patches/patch-src_doc_PdfFontType1Base14.cpp
new file mode 100644
index 00000000000..eb378e2bff9
--- /dev/null
+++ b/print/podofo/patches/patch-src_doc_PdfFontType1Base14.cpp
@@ -0,0 +1,37 @@
+$NetBSD: patch-src_doc_PdfFontType1Base14.cpp,v 1.1 2013/07/16 21:28:43 joerg Exp $
+
+--- src/doc/PdfFontType1Base14.cpp.orig 2010-10-21 17:09:00.000000000 +0000
++++ src/doc/PdfFontType1Base14.cpp
+@@ -31,7 +31,7 @@ PdfFontType1Base14::PdfFontType1Base14(
+ PdfVecObjects* pParent )
+ : PdfFontSimple( pMetrics, pEncoding, pParent )
+ {
+- InitBase14Font();
++ InitBase14Font( pMetrics );
+ }
+
+ // OC 13.08.2010 New:
+@@ -39,7 +39,7 @@ PdfFontType1Base14::PdfFontType1Base14(
+ PdfObject* pObject )
+ : PdfFontSimple( pMetrics, pEncoding, pObject )
+ {
+- InitBase14Font();
++ InitBase14Font( pMetrics );
+ }
+
+ PdfFontType1Base14::~PdfFontType1Base14()
+@@ -52,12 +52,12 @@ PdfFontType1Base14::~PdfFontType1Base14(
+ kausik : April 12th 2010
+ This is the font dictionary. It gets added to the page resources dictionary of the pdf.
+ */
+-void PdfFontType1Base14::InitBase14Font( )
++void PdfFontType1Base14::InitBase14Font( PdfFontMetrics* pMetrics )
+ {
+ PdfVariant var;
+
+ this->GetObject()->GetDictionary().AddKey( PdfName::KeySubtype, PdfName("Type1"));
+- this->GetObject()->GetDictionary().AddKey("BaseFont", this->GetBaseFont() );
++ this->GetObject()->GetDictionary().AddKey("BaseFont", PdfName( pMetrics->GetFontname() ) );
+
+ m_pEncoding->AddToDictionary( this->GetObject()->GetDictionary() ); // Add encoding key
+ // pDescriptor->GetDictionary().AddKey( "FontName", this->GetBaseFont() );
diff --git a/print/podofo/patches/patch-src_doc_PdfFontType1Base14.h b/print/podofo/patches/patch-src_doc_PdfFontType1Base14.h
new file mode 100644
index 00000000000..0eb3dac4180
--- /dev/null
+++ b/print/podofo/patches/patch-src_doc_PdfFontType1Base14.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_doc_PdfFontType1Base14.h,v 1.1 2013/07/16 21:28:43 joerg Exp $
+
+--- src/doc/PdfFontType1Base14.h.orig 2013-07-08 13:31:23.631273082 +0000
++++ src/doc/PdfFontType1Base14.h
+@@ -66,7 +66,7 @@ class PdfFontType1Base14 : public PdfFon
+ virtual void EmbedFontFile( PdfObject* pDescriptor );
+
+ private:
+- void InitBase14Font();
++ void InitBase14Font( PdfFontMetrics* pMetrics );
+
+ };
+