add patch for possible future xetex/xpdf4 usage
Norbert Preining
5 years ago
0 | diff -u xetexdir-poppler/XeTeX_ext.c xetexdir/XeTeX_ext.c | |
1 | --- xetexdir-poppler/XeTeX_ext.c Fri Jun 01 19:54:32 2018 | |
2 | +++ xetexdir/XeTeX_ext.c Mon Sep 24 00:27:04 2018 | |
3 | @@ -38,7 +38,12 @@ | |
4 | ||
5 | #include <w2c/config.h> | |
6 | ||
7 | +#ifdef POPPLER_VERSION | |
8 | #include <poppler-config.h> | |
9 | +#else | |
10 | +#include <xpdf/config.h> | |
11 | +#endif | |
12 | + | |
13 | #include <png.h> | |
14 | #include <zlib.h> | |
15 | #include <graphite2/Font.h> | |
16 | @@ -167,7 +172,11 @@ | |
17 | "Compiled with Graphite2 version %d.%d.%d; using %d.%d.%d\n" | |
18 | "Compiled with HarfBuzz version %s; using %s\n" | |
19 | "Compiled with libpng version %s; using %s\n" | |
20 | +#ifdef POPPLER_VERSION | |
21 | "Compiled with poppler version %s\n" | |
22 | +#else | |
23 | + "Compiled with xpdf version %s\n" | |
24 | +#endif | |
25 | #ifdef XETEX_MAC | |
26 | "Using Mac OS X Core Text and Cocoa frameworks\n" | |
27 | #else | |
28 | @@ -184,7 +193,11 @@ | |
29 | + strlen(hb_version_string()) | |
30 | + strlen(PNG_LIBPNG_VER_STRING) | |
31 | + strlen(png_libpng_ver) | |
32 | +#ifdef POPPLER_VERSION | |
33 | + strlen(POPPLER_VERSION) | |
34 | +#else | |
35 | + + strlen(xpdfVersion) | |
36 | +#endif | |
37 | #ifndef XETEX_MAC | |
38 | + 6 * 3 /* for fontconfig version #s (won't really need 3 digits per field!) */ | |
39 | #endif | |
40 | @@ -214,7 +227,11 @@ | |
41 | GR2_VERSION_MAJOR, GR2_VERSION_MINOR, GR2_VERSION_BUGFIX, | |
42 | grMajor, grMinor, grBugfix, | |
43 | HB_VERSION_STRING, hb_version_string(), | |
44 | +#ifdef POPPLER_VERSION | |
45 | PNG_LIBPNG_VER_STRING, png_libpng_ver, POPPLER_VERSION | |
46 | +#else | |
47 | + PNG_LIBPNG_VER_STRING, png_libpng_ver, xpdfVersion | |
48 | +#endif | |
49 | #ifndef XETEX_MAC | |
50 | , | |
51 | FC_VERSION / 10000, (FC_VERSION % 10000) / 100, FC_VERSION % 100, | |
52 | ||
53 | diff -u xetexdir-poppler/pdfimage.cpp xetexdir/pdfimage.cpp | |
54 | --- xetexdir-poppler/pdfimage.cpp Tue May 29 14:56:26 2018 | |
55 | +++ xetexdir/pdfimage.cpp Mon Sep 24 00:29:13 2018 | |
56 | @@ -53,7 +53,11 @@ | |
57 | pdf_get_rect(char* filename, int page_num, int pdf_box, realrect* box) | |
58 | /* return the box converted to TeX points */ | |
59 | { | |
60 | +#ifdef POPPLER_VERSION | |
61 | GooString* name = new GooString(filename); | |
62 | +#else | |
63 | + GString* name = new GString(filename); | |
64 | +#endif | |
65 | PDFDoc* doc = new PDFDoc(name); | |
66 | ||
67 | if (!doc) { | |
68 | @@ -133,8 +137,12 @@ | |
69 | int | |
70 | pdf_count_pages(char* filename) | |
71 | { | |
72 | - int pages = 0; | |
73 | + int pages = 0; | |
74 | +#ifdef POPPLER_VERSION | |
75 | GooString* name = new GooString(filename); | |
76 | +#else | |
77 | + GString* name = new GString(filename); | |
78 | +#endif | |
79 | PDFDoc* doc = new PDFDoc(name); | |
80 | ||
81 | if (!doc) { |