2 ===================================================================
3 RCS file: /home/kramm/cvs/swftools.cache.cvsroot/swftools.cache/pdf2swf/xpdf/Gfx.cc,v
4 retrieving revision 1.9
5 retrieving revision 1.10
7 --- Gfx.cc 3 Dec 2005 10:11:33 -0000 1.9
8 +++ Gfx.cc 3 Dec 2005 10:30:41 -0000 1.10
13 - out->startPage(pageNum, state);
15 + out->startPage(pageNum, state, cropBox->x1,cropBox->y1,cropBox->x2,cropBox->y2);
17 + out->startPage(pageNum, state, 0,0,0,0);
19 out->setDefaultCTM(state->getCTM());
20 out->updateAll(state);
21 for (i = 0; i < 6; ++i) {
23 abortCheckCbkData = abortCheckCbkDataA;
29 state->moveTo(cropBox->x1, cropBox->y1);
30 state->lineTo(cropBox->x2, cropBox->y1);
31 state->lineTo(cropBox->x2, cropBox->y2);
41 Gfx::Gfx(XRef *xrefA, OutputDev *outA, Dict *resDict,
43 pushResources(resDict);
45 // save current graphics state
46 + GfxState*mystate = state;
49 // kill any pre-existing path
52 // restore graphics state
54 + if(state!=mystate) {
55 + fprintf(stderr, "Invalid state nesting in PDF file- file broken?\n");
61 ===================================================================
62 RCS file: /home/kramm/cvs/swftools.cache.cvsroot/swftools.cache/pdf2swf/xpdf/GfxFont.h,v
63 retrieving revision 1.6
64 retrieving revision 1.7
66 --- GfxFont.h 3 Dec 2005 10:11:33 -0000 1.6
67 +++ GfxFont.h 3 Dec 2005 10:30:41 -0000 1.7
69 CharCodeToUnicode *getToUnicode();
71 // Return the character name associated with <code>.
72 - char *getCharName(int code) { return enc[code]; }
73 + char *getCharName(int code) { return code>=256?0:enc[code]; }
75 // Returns true if the PDF font specified an encoding.
76 GBool getHasEncoding() { return hasEncoding; }
78 ===================================================================
79 RCS file: /home/kramm/cvs/swftools.cache.cvsroot/swftools.cache/pdf2swf/xpdf/GfxState.cc,v
80 retrieving revision 1.10
81 retrieving revision 1.12
83 --- GfxState.cc 3 Dec 2005 10:11:33 -0000 1.10
84 +++ GfxState.cc 3 Dec 2005 12:41:32 -0000 1.12
91 //------------------------------------------------------------------------
94 - 0.11 * color->c[2] + 0.5));
97 +/*void GfxDeviceCMYKColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
98 + unsigned char r,g,b;
99 + float c = color->c[0];
100 + float m = color->c[1];
101 + float y = color->c[2];
102 + float k = color->c[3];
103 + convert_cmyk2rgb(c,m,y,k, &r,&g,&b);
109 void GfxDeviceCMYKColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
110 double c, m, y, k, c1, m1, y1, k1, r, g, b, x;
112 @@ -3099,6 +3112,7 @@
113 GfxIndexedColorSpace *indexedCS;
114 GfxSeparationColorSpace *sepCS;
115 int maxPixel, indexHigh;
116 + int maxPixelForAlloc;
120 @@ -3111,6 +3125,7 @@
121 // bits per component and color space
123 maxPixel = (1 << bits) - 1;
124 + maxPixelForAlloc = (1 << (bits>8?bits:8));
125 colorSpace = colorSpaceA;
128 @@ -3163,7 +3178,7 @@
129 lookup2 = indexedCS->getLookup();
130 colorSpace2->getDefaultRanges(x, y, indexHigh);
131 for (k = 0; k < nComps2; ++k) {
132 - lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1,
133 + lookup[k] = (GfxColorComp *)gmallocn(maxPixelForAlloc + 1,
134 sizeof(GfxColorComp));
135 for (i = 0; i <= maxPixel; ++i) {
136 j = (int)(decodeLow[0] + (i * decodeRange[0]) / maxPixel + 0.5);
137 @@ -3182,7 +3197,7 @@
138 nComps2 = colorSpace2->getNComps();
139 sepFunc = sepCS->getFunc();
140 for (k = 0; k < nComps2; ++k) {
141 - lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1,
142 + lookup[k] = (GfxColorComp *)gmallocn(maxPixelForAlloc + 1,
143 sizeof(GfxColorComp));
144 for (i = 0; i <= maxPixel; ++i) {
145 x[0] = decodeLow[0] + (i * decodeRange[0]) / maxPixel;
146 @@ -3192,7 +3207,7 @@
149 for (k = 0; k < nComps; ++k) {
150 - lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1,
151 + lookup[k] = (GfxColorComp *)gmallocn(maxPixelForAlloc + 1,
152 sizeof(GfxColorComp));
153 for (i = 0; i <= maxPixel; ++i) {
154 lookup[k][i] = dblToCol(decodeLow[k] +
155 @@ -3754,7 +3769,10 @@
158 void GfxState::setPath(GfxPath *pathA) {
166 Index: GlobalParams.cc
167 ===================================================================
168 RCS file: /home/kramm/cvs/swftools.cache.cvsroot/swftools.cache/pdf2swf/xpdf/GlobalParams.cc,v
169 retrieving revision 1.4
170 retrieving revision 1.7
172 --- GlobalParams.cc 3 Dec 2005 10:11:33 -0000 1.4
173 +++ GlobalParams.cc 18 Dec 2005 08:31:22 -0000 1.7
180 + char* cfgFileName = fileName->getCString();
181 + char* pos1 = strrchr(cfgFileName, '/');
182 + char* pos2 = strrchr(cfgFileName, '\\');
183 + char* p = pos1>pos2?pos1:pos2;
184 + int pos = p ? p-cfgFileName : -1;
185 + GString*path = new GString(new GString(cfgFileName), 0, (pos < 0 ? strlen(cfgFileName): pos));
189 + path->append('\\');
192 + path->append('\\');
198 + this->path = new GString();
202 while (getLine(buf, sizeof(buf) - 1, f)) {
204 @@ -1142,6 +1165,42 @@
205 deleteGList(tokens, GString);
208 +static char is_absolute(char*filename)
210 + int l = strlen(filename);
211 + if(filename[0] == '/' || filename[0] == '\\')
213 + if(l>2 && filename[1]==':' && (filename[2]=='\\' || filename[2]=='/'))
218 +static GString* qualify_filename(GString*path, GString*filename)
220 + GString*fullpath = 0;
221 + char*prefix = "/usr/local/share/xpdf/";
223 + if (!is_absolute(filename->getCString())) {
224 + /* relative path */
225 + fullpath = path->copy();
226 + fullpath->append(filename);
227 + } else if (!strncmp(filename->getCString(), prefix, strlen(prefix))) {
228 + /* xpdf default path */
229 + char*s = strchr(filename->getCString()+strlen(prefix), '/');
231 + fullpath = path->copy();
232 + fullpath->append(s+1);
234 + fullpath = filename->copy();
237 + /* absolute path */
238 + fullpath = filename->copy();
240 + //printf("%s -%s-> %s\n", filename->getCString(), path->getCString(), fullpath->getCString());
244 void GlobalParams::parseNameToUnicode(GList *tokens, GString *fileName,
247 @@ -1156,10 +1215,10 @@
248 fileName->getCString(), line);
251 - name = (GString *)tokens->get(1);
252 + name = qualify_filename(this->path, (GString *)tokens->get(1));
253 if (!(f = fopen(name->getCString(), "r"))) {
254 - error(-1, "Couldn't open 'nameToUnicode' file '%s'",
255 - name->getCString());
256 + error(-1, "Couldn't open 'nameToUnicode' file '%s' using path '%s'",
257 + name->getCString(), path->getCString());
261 @@ -705,10 +754,12 @@
263 collection = (GString *)tokens->get(1);
264 name = (GString *)tokens->get(2);
266 if ((old = (GString *)cidToUnicodes->remove(collection))) {
269 - cidToUnicodes->add(collection->copy(), name->copy());
271 + cidToUnicodes->add(collection->copy(), qualify_filename(this->path, name));
274 void GlobalParams::parseUnicodeToUnicode(GList *tokens, GString *fileName,
276 if ((old = (GString *)unicodeToUnicodes->remove(font))) {
279 - unicodeToUnicodes->add(font->copy(), file->copy());
281 + unicodeToUnicodes->add(font->copy(), qualify_filename(this->path, file));
284 void GlobalParams::parseUnicodeMap(GList *tokens, GString *fileName,
286 if ((old = (GString *)unicodeMaps->remove(encodingName))) {
289 - unicodeMaps->add(encodingName->copy(), name->copy());
291 + unicodeMaps->add(encodingName->copy(), qualify_filename(this->path, name));
294 void GlobalParams::parseCMapDir(GList *tokens, GString *fileName, int line) {
295 @@ -760,23 +813,30 @@
297 cMapDirs->add(collection->copy(), list);
299 - list->append(dir->copy());
301 + list->append(qualify_filename(this->path, dir));
304 void GlobalParams::parseToUnicodeDir(GList *tokens, GString *fileName,
308 if (tokens->getLength() != 2) {
309 error(-1, "Bad 'toUnicodeDir' config file command (%s:%d)",
310 fileName->getCString(), line);
313 - toUnicodeDirs->append(((GString *)tokens->get(1))->copy());
315 + dir = (GString *)tokens->get(1);
317 + toUnicodeDirs->append(qualify_filename(this->path, dir));
320 void GlobalParams::parseDisplayFont(GList *tokens, GHash *fontHash,
321 DisplayFontParamKind kind,
322 GString *fileName, int line) {
323 DisplayFontParam *param, *old;
326 if (tokens->getLength() < 2) {
328 @@ -788,13 +848,15 @@
329 if (tokens->getLength() != 3) {
332 - param->t1.fileName = ((GString *)tokens->get(2))->copy();
333 + file = (GString *)tokens->get(2);
334 + param->t1.fileName = qualify_filename(this->path, file);
337 if (tokens->getLength() != 3) {
340 - param->tt.fileName = ((GString *)tokens->get(2))->copy();
341 + file = (GString *)tokens->get(2);
342 + param->tt.fileName = qualify_filename(this->path, file);
347 ===================================================================
348 RCS file: /home/kramm/cvs/swftools.cache.cvsroot/swftools.cache/pdf2swf/xpdf/Lexer.cc,v
349 retrieving revision 1.4
350 retrieving revision 1.5
352 --- Lexer.cc 3 Dec 2005 10:11:33 -0000 1.4
353 +++ Lexer.cc 14 Mar 2006 12:43:23 -0000 1.5
355 curStr.streamReset();
358 +static int illegalChars = 0;
361 if (!curStr.isNone()) {
367 + error(0, "Illegal characters in hex string (%d)", illegalChars);
371 int Lexer::getChar() {
373 } else if (c2 >= 'a' && c2 <= 'f') {
376 - error(getPos(), "Illegal digit in hex char in name");
378 + //error(getPos(), "Illegal digit in hex char in name");
384 else if (c >= 'a' && c <= 'f')
387 - error(getPos(), "Illegal character <%02x> in hex string", c);
390 + //error(getPos(), "Illegal character <%02x> in hex string", c);
393 if (n == tokBufSize) {
397 obj->initCmd(tokBuf);
399 - error(getPos(), "Illegal character '>'");
401 + //error(getPos(), "Illegal character '>'");
409 - error(getPos(), "Illegal character '%c'", c);
410 + //error(getPos(), "Illegal character '%c'", c);
424 ===================================================================
425 RCS file: /home/kramm/cvs/swftools.cache.cvsroot/swftools.cache/pdf2swf/xpdf/Link.cc,v
426 retrieving revision 1.5
427 retrieving revision 1.6
429 --- Link.cc 3 Dec 2005 10:11:33 -0000 1.5
430 +++ Link.cc 26 Mar 2006 08:26:59 -0000 1.6
438 - error(-1, "Illegal annotation destination");
439 + error(-1, "Illegal annotation destination %d", destObj->getType());
450 - error(-1, "Illegal annotation destination");
451 + error(-1, "Illegal annotation destination %d", destObj->getType());
456 ===================================================================
457 RCS file: /home/kramm/cvs/swftools.cache.cvsroot/swftools.cache/pdf2swf/xpdf/OutputDev.h,v
458 retrieving revision 1.7
459 retrieving revision 1.9
461 --- OutputDev.h 3 Dec 2005 10:11:33 -0000 1.7
462 +++ OutputDev.h 3 Dec 2005 10:31:47 -0000 1.9
464 virtual void setDefaultCTM(double *ctm);
467 - virtual void startPage(int pageNum, GfxState *state) {}
468 + virtual void startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2) {}
471 virtual void endPage() {}
473 ===================================================================
474 RCS file: /home/kramm/cvs/swftools.cache.cvsroot/swftools.cache/pdf2swf/xpdf/Stream.cc,v
475 retrieving revision 1.7
476 retrieving revision 1.8
478 --- Stream.cc 3 Dec 2005 10:11:33 -0000 1.7
479 +++ Stream.cc 3 Dec 2005 10:30:41 -0000 1.8
485 +extern "C" int unlink(char *filename);
490 --- config.h 2007-09-09 12:11:20.000000000 +0200
491 +++ config.h 2007-09-09 12:11:40.000000000 +0200
494 // user config file name, relative to the user's home directory
495 #if defined(VMS) || defined(WIN32)
496 -#define xpdfUserConfigFile "xpdfrc"
497 +#define xpdfUserConfigFile "pdf2swf.conf"
499 -#define xpdfUserConfigFile ".xpdfrc"
500 +#define xpdfUserConfigFile ".pdf2swf.conf"
503 // system config file name (set via the configure script)
506 // under Windows, we get the directory with the executable and then
507 // append this file name
508 -#define xpdfSysConfigFile "xpdfrc"
509 +#define xpdfSysConfigFile "pdf2swf.conf"
512 //------------------------------------------------------------------------
514 ===================================================================
515 RCS file: /home/kramm/cvs/swftools.cache.cvsroot/swftools.cache/pdf2swf/xpdf/gfile.h,v
516 retrieving revision 1.9
517 retrieving revision 1.10
519 --- gfile.h 3 Dec 2005 10:11:33 -0000 1.9
520 +++ gfile.h 3 Dec 2005 10:30:41 -0000 1.10
522 // Get current directory.
523 extern GString *getCurrentDir();
525 +/* create a temporary filename */
526 +char* mktmpname(char*ptr);
528 // Append a file name to a path string. <path> may be an empty
529 // string, denoting the current directory). Returns <path>.
530 extern GString *appendToPath(GString *path, char *fileName);
531 Index: GlobalParams.h
532 ===================================================================
533 RCS file: /home/kramm/cvs/swftools.cache.cvsroot/swftools.cache/pdf2swf/xpdf/GlobalParams.h,v
534 retrieving revision 1.5
535 retrieving revision 1.6
537 --- GlobalParams.h 2006-10-10 19:54:29.000000000 +0200
538 +++ GlobalParams.h 2006-11-12 11:19:40.000000000 +0100
540 FILE *getUnicodeMapFile(GString *encodingName);
541 FILE *findCMapFile(GString *collection, GString *cMapName);
542 FILE *findToUnicodeFile(GString *name);
543 - DisplayFontParam *getDisplayFont(GString *fontName);
544 - DisplayFontParam *getDisplayCIDFont(GString *fontName, GString *collection);
545 + virtual DisplayFontParam *getDisplayFont(GString *fontName);
546 + virtual DisplayFontParam *getDisplayCIDFont(GString *fontName, GString *collection);
547 GString *getPSFile();
548 int getPSPaperWidth();
549 int getPSPaperHeight();
551 - void parseFile(GString *fileName, FILE *f);
552 +public: void parseFile(GString *fileName, FILE *f); private:
554 GBool loadPlugin(char *type, char *name);
557 + //----- config file base path
561 //----- static tables
563 NameToCharCode * // mapping from char name to
564 --- SplashOutputDev.h 2006-11-12 12:07:22.000000000 +0100
565 +++ SplashOutputDev.h 2006-11-12 12:08:48.000000000 +0100
567 //----- initialization and control
570 - virtual void startPage(int pageNum, GfxState *state);
571 + virtual void startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2);
574 virtual void endPage();
575 --- SplashOutputDev.cc 2006-11-12 12:07:06.000000000 +0100
576 +++ SplashOutputDev.cc 2006-11-12 12:09:36.000000000 +0100
581 -void SplashOutputDev::startPage(int pageNum, GfxState *state) {
582 +void SplashOutputDev::startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2) {
586 --- TextOutputDev.h 2006-11-12 12:23:01.000000000 +0100
587 +++ TextOutputDev.h 2006-11-12 12:25:31.000000000 +0100
589 //----- initialization and control
592 - virtual void startPage(int pageNum, GfxState *state);
593 + virtual void startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2);
596 virtual void endPage();
597 --- TextOutputDev.cc 2006-11-12 12:22:53.000000000 +0100
598 +++ TextOutputDev.cc 2006-11-12 12:25:03.000000000 +0100
599 @@ -3805,7 +3805,7 @@
603 -void TextOutputDev::startPage(int pageNum, GfxState *state) {
604 +void TextOutputDev::startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2) {
605 text->startPage(state);
608 --- CoreOutputDev.cc 2006-11-12 12:21:59.000000000 +0100
609 +++ CoreOutputDev.cc 2006-11-12 12:23:29.000000000 +0100
612 void CoreOutputDev::clear() {
614 - startPage(0, NULL);
615 + startPage(0, NULL, 0,0,0,0);
617 --- SplashFTFontEngine.cc 2006-11-19 22:30:44.000000000 +0100
618 +++ SplashFTFontEngine.cc 2006-11-19 22:30:56.000000000 +0100
629 --- SplashOutputDev.cc 2007-09-09 12:29:45.000000000 +0200
630 +++ SplashOutputDev.cc 2007-09-09 12:30:02.000000000 +0200
638 #include "GlobalParams.h"
639 --- SplashFontFile.cc 2007-09-09 12:33:00.000000000 +0200
640 +++ SplashFontFile.cc 2007-09-09 12:33:07.000000000 +0200
646 -# include <unistd.h>
650 #include "SplashFontFile.h"
651 #include "SplashFontFileID.h"
652 --- xpdf/SplashFont.h.orig 2008-09-09 21:31:01.000000000 +0200
653 +++ xpdf/SplashFont.h 2008-10-05 17:36:44.000000000 +0200
655 virtual GBool makeGlyph(int c, int xFrac, int yFrac,
656 SplashGlyphBitmap *bitmap) = 0;
658 + // return the number of characters in this font
659 + virtual int getNumChars() = 0;
661 // Return the path for a glyph.
662 virtual SplashPath *getGlyphPath(int c) = 0;
665 void getBBox(int *xMinA, int *yMinA, int *xMaxA, int *yMaxA)
666 { *xMinA = xMin; *yMinA = yMin; *xMaxA = xMax; *yMaxA = yMax; }
670 + double last_advance; //set after getGlyphPath()
673 SplashFontFile *fontFile;
674 --- orig/GfxFont.h 2007-07-28 00:11:06.000000000 +0200
675 +++ GfxFont.h 2007-09-09 18:31:31.000000000 +0200
677 virtual int getNextChar(char *s, int len, CharCode *code,
678 Unicode *u, int uSize, int *uLen,
679 double *dx, double *dy, double *ox, double *oy) = 0;
680 + virtual CharCodeToUnicode* getCTU() = 0;
685 virtual int getNextChar(char *s, int len, CharCode *code,
686 Unicode *u, int uSize, int *uLen,
687 double *dx, double *dy, double *ox, double *oy);
688 + virtual CharCodeToUnicode* getCTU();
690 // Return the encoding.
691 char **getEncoding() { return enc; }
693 virtual int getNextChar(char *s, int len, CharCode *code,
694 Unicode *u, int uSize, int *uLen,
695 double *dx, double *dy, double *ox, double *oy);
696 + virtual CharCodeToUnicode* getCTU();
698 // Return the writing mode (0=horizontal, 1=vertical).
699 virtual int getWMode();
700 --- orig/GfxFont.cc 2007-07-28 00:11:06.000000000 +0200
701 +++ GfxFont.cc 2007-09-09 18:33:37.000000000 +0200
706 +CharCodeToUnicode* Gfx8BitFont::getCTU() {
710 CharCodeToUnicode *Gfx8BitFont::getToUnicode() {
713 @@ -1417,6 +1421,10 @@
717 +CharCodeToUnicode* GfxCIDFont::getCTU() {
721 int GfxCIDFont::getNextChar(char *s, int len, CharCode *code,
722 Unicode *u, int uSize, int *uLen,
723 double *dx, double *dy, double *ox, double *oy) {
724 --- OutputDev.h Sat Jul 28 00:11:08 2007
725 +++ OutputDev.h Sun Sep 9 13:50:40 2007
729 #include "CharTypes.h"
734 --- SplashOutputDev.h 2007-10-20 13:17:02.000000000 +0200
735 +++ SplashOutputDev.h 2007-10-20 13:17:23.000000000 +0200
737 virtual void setVectorAntialias(GBool vaa);
740 + void doUpdateFont(GfxState *state);
743 void setupScreenParams(double hDPI, double vDPI);
745 SplashPattern *getColor(GfxGray gray, GfxRGB *rgb);
747 SplashPath *convertPath(GfxState *state, GfxPath *path);
748 - void doUpdateFont(GfxState *state);
749 void drawType3Glyph(T3FontCache *t3Font,
750 T3FontCacheTag *tag, Guchar *data);
751 static GBool imageMaskSrc(void *data, SplashColorPtr line);
752 --- xpdf/GlobalParams.h 2007-10-20 13:18:03.000000000 +0200
753 +++ xpdf/GlobalParams.h 2007-10-20 13:25:52.000000000 +0200
756 GlobalParams(char *cfgFileName);
759 + virtual ~GlobalParams();
761 void setBaseDir(char *dir);
762 void setupBaseFonts(char *dir);
763 --- xpdf/SplashOutputDev.h.orig 2007-10-21 17:43:29.000000000 +0200
764 +++ xpdf/SplashOutputDev.h 2007-11-19 10:07:27.000000000 +0100
768 void doUpdateFont(GfxState *state);
770 + SplashPath *convertPath(GfxState *state, GfxPath *path);
773 void setupScreenParams(double hDPI, double vDPI);
776 SplashPattern *getColor(GfxGray gray, GfxRGB *rgb);
778 - SplashPath *convertPath(GfxState *state, GfxPath *path);
779 void drawType3Glyph(T3FontCache *t3Font,
780 T3FontCacheTag *tag, Guchar *data);
781 static GBool imageMaskSrc(void *data, SplashColorPtr line);
782 --- xpdf/SplashFont.cc.orig 2008-09-09 21:31:01.000000000 +0200
783 +++ xpdf/SplashFont.cc 2008-10-05 17:37:08.000000000 +0200
787 xMin = yMin = xMax = yMax = 0;
794 void SplashFont::initCache() {
795 --- xpdf/SplashFTFont.cc.orig 2008-09-09 21:31:01.000000000 +0200
796 +++ xpdf/SplashFTFont.cc 2008-10-05 17:37:32.000000000 +0200
800 face = fontFileA->face;
802 if (FT_New_Size(face, &sizeObj)) {
806 if (FT_Set_Pixel_Sizes(face, 0, (int)size)) {
810 + this->ascender = face->ascender;
811 + this->descender = face->descender;
813 // if the textMat values are too small, FreeType's fixed point
814 // arithmetic doesn't work so well
815 textScale = splashSqrt(textMat[2]*textMat[2] + textMat[3]*textMat[3]) / size;
820 +int SplashFTFont::getNumChars()
822 + SplashFTFontFile* ff = (SplashFTFontFile *)fontFile;
823 + return ff->face->num_glyphs;
826 SplashPath *SplashFTFont::getGlyphPath(int c) {
827 static FT_Outline_Funcs outlineFuncs = {
828 #if FREETYPE_MINOR <= 1
833 + this->last_advance = -1;
835 ff = (SplashFTFontFile *)fontFile;
836 ff->face->size = sizeObj;
837 FT_Set_Transform(ff->face, &textMatrix, NULL);
839 if (FT_Get_Glyph(slot, &glyph)) {
842 + this->last_advance = glyph->advance.x/65536.0;
844 path.path = new SplashPath();
845 path.textScale = textScale;
846 path.needClose = gFalse;
847 --- xpdf/SplashFTFont.h.orig 2008-09-09 21:31:01.000000000 +0200
848 +++ xpdf/SplashFTFont.h 2008-10-04 17:39:57.000000000 +0200
850 virtual GBool makeGlyph(int c, int xFrac, int yFrac,
851 SplashGlyphBitmap *bitmap);
853 + // return the number of characters in this font
854 + virtual int getNumChars();
856 // Return the path for a glyph.
857 virtual SplashPath *getGlyphPath(int c);
859 --- xpdf/SplashScreen.cc.orig 2008-10-06 17:59:44.000000000 +0200
860 +++ xpdf/SplashScreen.cc 2008-10-06 18:20:09.000000000 +0200
862 int SplashScreen::test(int x, int y, Guchar value) {
867 if (value < minVal) {
870 --- xpdf/gfile.cc.orig 2007-02-27 23:05:51.000000000 +0100
871 +++ xpdf/gfile.cc 2008-10-12 15:15:22.000000000 +0200
876 +static char* getTempDir()
879 + char*dir = getenv("TMP");
880 + if(!dir) dir = getenv("TEMP");
881 + if(!dir) dir = getenv("tmp");
882 + if(!dir) dir = getenv("temp");
883 + if(!dir) dir = "C:\\";
885 + char* dir = "/tmp/";
890 +char* mktmpname(char*ptr) {
891 + static char tmpbuf[128];
892 + char*dir = getTempDir();
893 + int l = strlen(dir);
897 + if(l && dir[l-1]!='/' && dir[l-1]!='\\') {
905 + // used to be mktemp. This does remove the warnings, but
906 + // It's not exactly an improvement.
908 + sprintf(ptr, "%s%s%08x%08x",dir,sep,lrand48(),lrand48());
911 + sprintf(ptr, "%s%s%08x%08x",dir,sep,rand(),rand());
913 + static int count = 1;
914 + sprintf(ptr, "%s%s%08x%04x%04x",dir,sep,time(0),(unsigned int)tmpbuf^((unsigned int)tmpbuf)>>16,count);
922 GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) {
924 //---------- Win32 ----------
928 for (i = 0; i < 1000; ++i) {
929 - sprintf(buf, "%d", t + i);
930 + sprintf(buf, "%08x-%08x", t + i, GetCurrentThreadId());
931 s2 = s->copy()->append(buf);
935 if (!(f2 = fopen(s2->getCString(), "r"))) {
936 if (!(f2 = fopen(s2->getCString(), mode))) {
948 + fprintf(stderr, "Couldn't create temporary file\n");
951 #elif defined(VMS) || defined(__EMX__) || defined(ACORN) || defined(MACOS)
953 // with this file name after the tmpnam call and before the fopen
954 // call. I will happily accept fixes to this function for non-Unix
956 - if (!(s = tmpnam(NULL))) {
957 + if (!(s = mktmpname(NULL))) {
960 *name = new GString(s);
962 (*name)->append("/XXXXXX")->append(ext);
963 fd = mkstemps((*name)->getCString(), strlen(ext));
965 - if (!(s = tmpnam(NULL))) {
966 + if (!(s = mktmpname(NULL))) {
969 *name = new GString(s);
971 (*name)->append("/XXXXXX");
972 fd = mkstemp((*name)->getCString());
973 #else // HAVE_MKSTEMP
974 - if (!(s = tmpnam(NULL))) {
975 + if (!(s = mktmpname(NULL))) {
978 *name = new GString(s);