Browse Source

texlive-bin: update to newer patch from archlinux.

Partly fixes #1657
android-5
Henrik Grimler 7 years ago
committed by Fredrik Fornwall
parent
commit
35093155c3
  1. 103
      packages/texlive-bin/texlive-poppler-0.59.patch

103
packages/texlive-bin/texlive-20170524-source-poppler059-1.patch → packages/texlive-bin/texlive-poppler-0.59.patch

@ -1,10 +1,3 @@
Submitted By: Ken Moffat <ken at linuxfromscratch dot org>
Date: 2017-09-21
Initial Package Version: 20170524
Upstream Status: Unknown
Origin: Arch linux
Description: Fixes compilation with the API changes of poppler-0.59.
diff -ur source.orig/texk/web2c/luatexdir/image/pdftoepdf.w source/texk/web2c/luatexdir/image/pdftoepdf.w diff -ur source.orig/texk/web2c/luatexdir/image/pdftoepdf.w source/texk/web2c/luatexdir/image/pdftoepdf.w
--- source.orig/texk/web2c/luatexdir/image/pdftoepdf.w 2017-05-08 22:39:36.639375783 +0200 --- source.orig/texk/web2c/luatexdir/image/pdftoepdf.w 2017-05-08 22:39:36.639375783 +0200
+++ source/texk/web2c/luatexdir/image/pdftoepdf.w 2017-09-19 11:23:36.586768739 +0200 +++ source/texk/web2c/luatexdir/image/pdftoepdf.w 2017-09-19 11:23:36.586768739 +0200
@ -727,16 +720,39 @@ diff -ur source.orig/texk/web2c/pdftexdir/pdftoepdf.cc source/texk/web2c/pdftexd
pdf_puts(" "); pdf_puts(" ");
} }
pdf_puts("]\n"); pdf_puts("]\n");
@@ -396,7 +359,7 @@ @@ -394,10 +357,29 @@
#define REPLACE_TYPE1C true
+static bool embeddableFont(Object * fontdesc)
+{
+ Object fontfile, ffsubtype;
+
+ if (!fontdesc->isDict())
+ return false;
+ fontfile = fontdesc->dictLookup("FontFile");
+ if (fontfile.isStream())
+ return true;
+ if (REPLACE_TYPE1C) {
+ fontfile = fontdesc->dictLookup("FontFile3");
+ if (!fontfile.isStream())
+ return false;
+ ffsubtype = fontfile.streamGetDict()->lookup("Subtype");
+ return ffsubtype.isName() && !strcmp(ffsubtype.getName(), "Type1C");
+ }
+ return false;
+}
+
static void copyFont(char *tag, Object * fontRef) static void copyFont(char *tag, Object * fontRef)
{ {
- PdfObject fontdict, subtype, basefont, fontdescRef, fontdesc, charset, - PdfObject fontdict, subtype, basefont, fontdescRef, fontdesc, charset,
- fontfile, ffsubtype, stemV;
+ Object fontdict, subtype, basefont, fontdescRef, fontdesc, charset, + Object fontdict, subtype, basefont, fontdescRef, fontdesc, charset,
fontfile, ffsubtype, stemV; + stemV;
GfxFont *gfont; GfxFont *gfont;
fd_entry *fd; fd_entry *fd;
@@ -413,33 +376,49 @@ fm_entry *fontmap;
@@ -413,33 +395,39 @@
} }
// Only handle included Type1 (and Type1C) fonts; anything else will be copied. // Only handle included Type1 (and Type1C) fonts; anything else will be copied.
// Type1C fonts are replaced by Type1 fonts, if REPLACE_TYPE1C is true. // Type1C fonts are replaced by Type1 fonts, if REPLACE_TYPE1C is true.
@ -754,23 +770,13 @@ diff -ur source.orig/texk/web2c/pdftexdir/pdftoepdf.cc source/texk/web2c/pdftexd
- && !strcmp(ffsubtype->getName(), "Type1C"))) - && !strcmp(ffsubtype->getName(), "Type1C")))
- && (fontmap = lookup_fontmap(basefont->getName())) != NULL) { - && (fontmap = lookup_fontmap(basefont->getName())) != NULL) {
+ fontdict = fontRef->fetch(xref); + fontdict = fontRef->fetch(xref);
+ fontdesc = Object(objNull);
+ if (fontdict.isDict()) { + if (fontdict.isDict()) {
+ subtype = fontdict.dictLookup("Subtype"); + subtype = fontdict.dictLookup("Subtype");
+ basefont = fontdict.dictLookup("BaseFont"); + basefont = fontdict.dictLookup("BaseFont");
+ fontdescRef = fontdict.dictLookupNF("FontDescriptor"); + fontdescRef = fontdict.dictLookupNF("FontDescriptor");
+ if (fontdescRef.isRef()) { + if (fontdescRef.isRef()) {
+ fontdesc = fontdescRef.fetch(xref); + fontdesc = fontdescRef.fetch(xref);
+ if (fontdesc.isDict()) {
+ fontfile = fontdesc.dictLookup("FontFile");
+ if (!fontfile.isStream() && REPLACE_TYPE1C) {
+ fontfile = fontdesc.dictLookup("FontFile3");
+ ffsubtype = fontfile.streamGetDict()->lookup("Subtype");
+ if (!(ffsubtype.isName() && !strcmp(ffsubtype.getName(), "Type1C"))) {
+ // not a Type1-C font.
+ fontfile = Object(objNull);
+ }
+ }
+ }
+ } + }
+ } + }
+ if (!fixedinclusioncopyfont && fontdict.isDict() + if (!fixedinclusioncopyfont && fontdict.isDict()
@ -779,7 +785,7 @@ diff -ur source.orig/texk/web2c/pdftexdir/pdftoepdf.cc source/texk/web2c/pdftexd
+ && basefont.isName() + && basefont.isName()
+ && fontdescRef.isRef() + && fontdescRef.isRef()
+ && fontdesc.isDict() + && fontdesc.isDict()
+ && fontfile.isStream() + && embeddableFont(&fontdesc)
+ && (fontmap = lookup_fontmap(basefont.getName())) != NULL) { + && (fontmap = lookup_fontmap(basefont.getName())) != NULL) {
// round /StemV value, since the PDF input is a float // round /StemV value, since the PDF input is a float
// (see Font Descriptors in PDF reference), but we only store an // (see Font Descriptors in PDF reference), but we only store an
@ -806,7 +812,7 @@ diff -ur source.orig/texk/web2c/pdftexdir/pdftoepdf.cc source/texk/web2c/pdftexd
pdf_printf(" %d 0 R ", addFont(fontRef->getRef(), fd, pdf_printf(" %d 0 R ", addFont(fontRef->getRef(), fd,
addEncoding(gfont))); addEncoding(gfont)));
} else { } else {
@@ -451,24 +430,24 @@ @@ -451,24 +439,24 @@
static void copyFontResources(Object * obj) static void copyFontResources(Object * obj)
{ {
@ -836,7 +842,7 @@ diff -ur source.orig/texk/web2c/pdftexdir/pdftoepdf.cc source/texk/web2c/pdftexd
} }
pdf_puts(">>\n"); pdf_puts(">>\n");
} }
@@ -557,7 +536,7 @@ @@ -557,7 +545,7 @@
static void copyObject(Object * obj) static void copyObject(Object * obj)
{ {
@ -845,7 +851,7 @@ diff -ur source.orig/texk/web2c/pdftexdir/pdftoepdf.cc source/texk/web2c/pdftexd
int i, l, c; int i, l, c;
Ref ref; Ref ref;
char *p; char *p;
@@ -601,8 +580,8 @@ @@ -601,8 +589,8 @@
} else if (obj->isArray()) { } else if (obj->isArray()) {
pdf_puts("["); pdf_puts("[");
for (i = 0, l = obj->arrayGetLength(); i < l; ++i) { for (i = 0, l = obj->arrayGetLength(); i < l; ++i) {
@ -856,16 +862,18 @@ diff -ur source.orig/texk/web2c/pdftexdir/pdftoepdf.cc source/texk/web2c/pdftexd
pdf_puts(" "); pdf_puts(" ");
copyObject(&obj1); copyObject(&obj1);
} }
@@ -612,7 +591,7 @@ @@ -612,9 +600,8 @@
copyDict(obj); copyDict(obj);
pdf_puts(">>"); pdf_puts(">>");
} else if (obj->isStream()) { } else if (obj->isStream()) {
- initDictFromDict(obj1, obj->streamGetDict()); - initDictFromDict(obj1, obj->streamGetDict());
+ obj1 = Object(obj->streamGetDict());
pdf_puts("<<\n"); pdf_puts("<<\n");
copyDict(&obj1); - copyDict(&obj1);
+ copyDict(obj->getStream()->getDictObject());
pdf_puts(">>\n"); pdf_puts(">>\n");
@@ -638,9 +617,8 @@ pdf_puts("stream\n");
copyStream(obj->getStream()->getUndecodedStream());
@@ -638,9 +625,8 @@
InObj *r; InObj *r;
for (r = inObjList; r != 0; r = r->next) { for (r = inObjList; r != 0; r = r->next) {
if (!r->written) { if (!r->written) {
@ -876,7 +884,7 @@ diff -ur source.orig/texk/web2c/pdftexdir/pdftoepdf.cc source/texk/web2c/pdftexd
if (r->type == objFont) { if (r->type == objFont) {
assert(!obj1.isStream()); assert(!obj1.isStream());
pdfbeginobj(r->num, 2); // \pdfobjcompresslevel = 2 is for this pdfbeginobj(r->num, 2); // \pdfobjcompresslevel = 2 is for this
@@ -656,7 +634,6 @@ @@ -656,7 +642,6 @@
pdf_puts("\n"); pdf_puts("\n");
pdfendobj(); pdfendobj();
} }
@ -884,7 +892,7 @@ diff -ur source.orig/texk/web2c/pdftexdir/pdftoepdf.cc source/texk/web2c/pdftexd
} }
} }
} }
@@ -839,8 +816,8 @@ @@ -839,8 +824,8 @@
Page *page; Page *page;
Ref *pageRef; Ref *pageRef;
Dict *pageDict; Dict *pageDict;
@ -895,7 +903,7 @@ diff -ur source.orig/texk/web2c/pdftexdir/pdftoepdf.cc source/texk/web2c/pdftexd
bool writeSepGroup = false; bool writeSepGroup = false;
Object info; Object info;
char *key; char *key;
@@ -867,8 +844,8 @@ @@ -867,8 +852,8 @@
encodingList = 0; encodingList = 0;
page = pdf_doc->doc->getCatalog()->getPage(epdf_selected_page); page = pdf_doc->doc->getCatalog()->getPage(epdf_selected_page);
pageRef = pdf_doc->doc->getCatalog()->getPageRef(epdf_selected_page); pageRef = pdf_doc->doc->getCatalog()->getPageRef(epdf_selected_page);
@ -906,7 +914,7 @@ diff -ur source.orig/texk/web2c/pdftexdir/pdftoepdf.cc source/texk/web2c/pdftexd
rotate = page->getRotate(); rotate = page->getRotate();
PDFRectangle *pagebox; PDFRectangle *pagebox;
// write the Page header // write the Page header
@@ -886,7 +863,7 @@ @@ -886,7 +871,7 @@
pdf_printf("/%s.PageNumber %i\n", pdfkeyprefix, (int) epdf_selected_page); pdf_printf("/%s.PageNumber %i\n", pdfkeyprefix, (int) epdf_selected_page);
} }
if ((suppress_ptex_info & MASK_SUPPRESS_PTEX_INFODICT) == 0) { if ((suppress_ptex_info & MASK_SUPPRESS_PTEX_INFODICT) == 0) {
@ -915,7 +923,7 @@ diff -ur source.orig/texk/web2c/pdftexdir/pdftoepdf.cc source/texk/web2c/pdftexd
if (info.isRef()) { if (info.isRef()) {
// the info dict must be indirect (PDF Ref p. 61) // the info dict must be indirect (PDF Ref p. 61)
pdf_printf("/%s.InfoDict ", pdfkeyprefix); pdf_printf("/%s.InfoDict ", pdfkeyprefix);
@@ -942,14 +919,14 @@ @@ -942,14 +927,14 @@
pdf_puts(stripzeros(s)); pdf_puts(stripzeros(s));
// Metadata validity check (as a stream it must be indirect) // Metadata validity check (as a stream it must be indirect)
@ -934,7 +942,7 @@ diff -ur source.orig/texk/web2c/pdftexdir/pdftoepdf.cc source/texk/web2c/pdftexd
pdf_newline(); pdf_newline();
pdf_printf("/%s ", pageDictKeys[i]); pdf_printf("/%s ", pageDictKeys[i]);
copyObject(&dictObj); // preserves indirection copyObject(&dictObj); // preserves indirection
@@ -957,8 +934,8 @@ @@ -957,8 +942,8 @@
} }
// handle page group // handle page group
@ -945,7 +953,7 @@ diff -ur source.orig/texk/web2c/pdftexdir/pdftoepdf.cc source/texk/web2c/pdftexd
if (pdfpagegroupval == 0) { if (pdfpagegroupval == 0) {
// another pdf with page group was included earlier on the // another pdf with page group was included earlier on the
// same page; copy the Group entry as is. See manual for // same page; copy the Group entry as is. See manual for
@@ -972,11 +949,11 @@ @@ -972,11 +957,11 @@
copyObject(&dictObj); copyObject(&dictObj);
} else { } else {
// write Group dict as a separate object, since the Page dict also refers to it // write Group dict as a separate object, since the Page dict also refers to it
@ -960,29 +968,24 @@ diff -ur source.orig/texk/web2c/pdftexdir/pdftoepdf.cc source/texk/web2c/pdftexd
pdf_printf("/Group %ld 0 R\n", (long)pdfpagegroupval); pdf_printf("/Group %ld 0 R\n", (long)pdfpagegroupval);
} }
} }
@@ -989,15 +966,15 @@ @@ -989,14 +974,14 @@
pdftex_warn pdftex_warn
("PDF inclusion: /Resources missing. 'This practice is not recommended' (PDF Ref)"); ("PDF inclusion: /Resources missing. 'This practice is not recommended' (PDF Ref)");
} else { } else {
- initDictFromDict(obj1, page->getResourceDict()); - initDictFromDict(obj1, page->getResourceDict());
- if (!obj1->isDict()) + Object *obj1 = page->getResourceDictObject();
+ obj1 = Object(page->getResourceDict()); if (!obj1->isDict())
+ if (!obj1.isDict())
pdftex_fail("PDF inclusion: invalid resources dict type <%s>", pdftex_fail("PDF inclusion: invalid resources dict type <%s>",
- obj1->getTypeName()); obj1->getTypeName());
+ obj1.getTypeName());
pdf_newline(); pdf_newline();
pdf_puts("/Resources <<\n"); pdf_puts("/Resources <<\n");
- for (i = 0, l = obj1->dictGetLength(); i < l; ++i) { for (i = 0, l = obj1->dictGetLength(); i < l; ++i) {
- obj1->dictGetVal(i, &obj2); - obj1->dictGetVal(i, &obj2);
- key = obj1->dictGetKey(i); + obj2 = obj1->dictGetVal(i);
+ for (i = 0, l = obj1.dictGetLength(); i < l; ++i) { key = obj1->dictGetKey(i);
+ obj2 = obj1.dictGetVal(i);
+ key = obj1.dictGetKey(i);
if (strcmp("Font", key) == 0) if (strcmp("Font", key) == 0)
copyFontResources(&obj2); copyFontResources(&obj2);
else if (strcmp("ProcSet", key) == 0) @@ -1009,8 +994,8 @@
@@ -1009,8 +986,8 @@
} }
// write the page contents // write the page contents
@ -993,7 +996,7 @@ diff -ur source.orig/texk/web2c/pdftexdir/pdftoepdf.cc source/texk/web2c/pdftexd
// Variant A: get stream and recompress under control // Variant A: get stream and recompress under control
// of \pdfcompresslevel // of \pdfcompresslevel
@@ -1021,36 +998,35 @@ @@ -1021,36 +1006,35 @@
// Variant B: copy stream without recompressing // Variant B: copy stream without recompressing
// //
Loading…
Cancel
Save