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.cc,v
516 retrieving revision 1.12
517 retrieving revision 1.13
518 diff -u -r1.12 -r1.13
519 --- gfile.cc 3 Dec 2005 10:11:33 -0000 1.12
520 +++ gfile.cc 3 Dec 2005 10:30:41 -0000 1.13
525 +static char* getTempDir()
528 + char*dir = getenv("TMP");
529 + if(!dir) dir = getenv("TEMP");
530 + if(!dir) dir = getenv("tmp");
531 + if(!dir) dir = getenv("temp");
532 + if(!dir) dir = "C:\\";
534 + char* dir = "/tmp/";
539 +char* mktmpname(char*ptr) {
540 + static char tmpbuf[128];
541 + char*dir = getTempDir();
542 + int l = strlen(dir);
546 + if(l && dir[l-1]!='/' && dir[l-1]!='\\') {
554 + // used to be mktemp. This does remove the warnings, but
555 + // It's not exactly an improvement.
557 + sprintf(ptr, "%s%s%08x%08x",dir,sep,lrand48(),lrand48());
560 + sprintf(ptr, "%s%s%08x%08x",dir,sep,rand(),rand());
562 + static int count = 1;
563 + sprintf(ptr, "%s%s%08x%04x%04x",dir,sep,time(0),(unsigned int)tmpbuf^((unsigned int)tmpbuf)>>16,count);
571 GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) {
573 //---------- Win32 ----------
575 // with this file name after the tmpnam call and before the fopen
576 // call. I will happily accept fixes to this function for non-Unix
578 - if (!(s = tmpnam(NULL))) {
579 + if (!(s = mktmpname(NULL))) {
582 *name = new GString(s);
584 (*name)->append("/XXXXXX")->append(ext);
585 fd = mkstemps((*name)->getCString(), strlen(ext));
587 - if (!(s = tmpnam(NULL))) {
588 + if (!(s = mktmpname(NULL))) {
591 *name = new GString(s);
593 (*name)->append("/XXXXXX");
594 fd = mkstemp((*name)->getCString());
595 #else // HAVE_MKSTEMP
596 - if (!(s = tmpnam(NULL))) {
597 + if (!(s = mktmpname(NULL))) {
600 *name = new GString(s);
602 ===================================================================
603 RCS file: /home/kramm/cvs/swftools.cache.cvsroot/swftools.cache/pdf2swf/xpdf/gfile.h,v
604 retrieving revision 1.9
605 retrieving revision 1.10
607 --- gfile.h 3 Dec 2005 10:11:33 -0000 1.9
608 +++ gfile.h 3 Dec 2005 10:30:41 -0000 1.10
610 // Get current directory.
611 extern GString *getCurrentDir();
613 +/* create a temporary filename */
614 +char* mktmpname(char*ptr);
616 // Append a file name to a path string. <path> may be an empty
617 // string, denoting the current directory). Returns <path>.
618 extern GString *appendToPath(GString *path, char *fileName);
619 Index: GlobalParams.h
620 ===================================================================
621 RCS file: /home/kramm/cvs/swftools.cache.cvsroot/swftools.cache/pdf2swf/xpdf/GlobalParams.h,v
622 retrieving revision 1.5
623 retrieving revision 1.6
625 --- GlobalParams.h 2006-10-10 19:54:29.000000000 +0200
626 +++ GlobalParams.h 2006-11-12 11:19:40.000000000 +0100
628 FILE *getUnicodeMapFile(GString *encodingName);
629 FILE *findCMapFile(GString *collection, GString *cMapName);
630 FILE *findToUnicodeFile(GString *name);
631 - DisplayFontParam *getDisplayFont(GString *fontName);
632 - DisplayFontParam *getDisplayCIDFont(GString *fontName, GString *collection);
633 + virtual DisplayFontParam *getDisplayFont(GString *fontName);
634 + virtual DisplayFontParam *getDisplayCIDFont(GString *fontName, GString *collection);
635 GString *getPSFile();
636 int getPSPaperWidth();
637 int getPSPaperHeight();
639 - void parseFile(GString *fileName, FILE *f);
640 +public: void parseFile(GString *fileName, FILE *f); private:
642 GBool loadPlugin(char *type, char *name);
645 + //----- config file base path
649 //----- static tables
651 NameToCharCode * // mapping from char name to
652 --- SplashOutputDev.h 2006-11-12 12:07:22.000000000 +0100
653 +++ SplashOutputDev.h 2006-11-12 12:08:48.000000000 +0100
655 //----- initialization and control
658 - virtual void startPage(int pageNum, GfxState *state);
659 + virtual void startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2);
662 virtual void endPage();
663 --- SplashOutputDev.cc 2006-11-12 12:07:06.000000000 +0100
664 +++ SplashOutputDev.cc 2006-11-12 12:09:36.000000000 +0100
669 -void SplashOutputDev::startPage(int pageNum, GfxState *state) {
670 +void SplashOutputDev::startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2) {
674 --- TextOutputDev.h 2006-11-12 12:23:01.000000000 +0100
675 +++ TextOutputDev.h 2006-11-12 12:25:31.000000000 +0100
677 //----- initialization and control
680 - virtual void startPage(int pageNum, GfxState *state);
681 + virtual void startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2);
684 virtual void endPage();
685 --- TextOutputDev.cc 2006-11-12 12:22:53.000000000 +0100
686 +++ TextOutputDev.cc 2006-11-12 12:25:03.000000000 +0100
687 @@ -3805,7 +3805,7 @@
691 -void TextOutputDev::startPage(int pageNum, GfxState *state) {
692 +void TextOutputDev::startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2) {
693 text->startPage(state);
696 --- CoreOutputDev.cc 2006-11-12 12:21:59.000000000 +0100
697 +++ CoreOutputDev.cc 2006-11-12 12:23:29.000000000 +0100
700 void CoreOutputDev::clear() {
702 - startPage(0, NULL);
703 + startPage(0, NULL, 0,0,0,0);
705 --- SplashFTFontEngine.cc 2006-11-19 22:30:44.000000000 +0100
706 +++ SplashFTFontEngine.cc 2006-11-19 22:30:56.000000000 +0100
717 --- SplashOutputDev.cc 2007-09-09 12:29:45.000000000 +0200
718 +++ SplashOutputDev.cc 2007-09-09 12:30:02.000000000 +0200
726 #include "GlobalParams.h"
727 --- SplashFontFile.cc 2007-09-09 12:33:00.000000000 +0200
728 +++ SplashFontFile.cc 2007-09-09 12:33:07.000000000 +0200
734 -# include <unistd.h>
738 #include "SplashFontFile.h"
739 #include "SplashFontFileID.h"
740 --- xpdf/SplashFont.h.orig 2008-09-09 21:31:01.000000000 +0200
741 +++ xpdf/SplashFont.h 2008-10-05 17:36:44.000000000 +0200
743 virtual GBool makeGlyph(int c, int xFrac, int yFrac,
744 SplashGlyphBitmap *bitmap) = 0;
746 + // return the number of characters in this font
747 + virtual int getNumChars() = 0;
749 // Return the path for a glyph.
750 virtual SplashPath *getGlyphPath(int c) = 0;
753 void getBBox(int *xMinA, int *yMinA, int *xMaxA, int *yMaxA)
754 { *xMinA = xMin; *yMinA = yMin; *xMaxA = xMax; *yMaxA = yMax; }
758 + double last_advance; //set after getGlyphPath()
761 SplashFontFile *fontFile;
762 --- orig/GfxFont.h 2007-07-28 00:11:06.000000000 +0200
763 +++ GfxFont.h 2007-09-09 18:31:31.000000000 +0200
765 virtual int getNextChar(char *s, int len, CharCode *code,
766 Unicode *u, int uSize, int *uLen,
767 double *dx, double *dy, double *ox, double *oy) = 0;
768 + virtual CharCodeToUnicode* getCTU() = 0;
773 virtual int getNextChar(char *s, int len, CharCode *code,
774 Unicode *u, int uSize, int *uLen,
775 double *dx, double *dy, double *ox, double *oy);
776 + virtual CharCodeToUnicode* getCTU();
778 // Return the encoding.
779 char **getEncoding() { return enc; }
781 virtual int getNextChar(char *s, int len, CharCode *code,
782 Unicode *u, int uSize, int *uLen,
783 double *dx, double *dy, double *ox, double *oy);
784 + virtual CharCodeToUnicode* getCTU();
786 // Return the writing mode (0=horizontal, 1=vertical).
787 virtual int getWMode();
788 --- orig/GfxFont.cc 2007-07-28 00:11:06.000000000 +0200
789 +++ GfxFont.cc 2007-09-09 18:33:37.000000000 +0200
794 +CharCodeToUnicode* Gfx8BitFont::getCTU() {
798 CharCodeToUnicode *Gfx8BitFont::getToUnicode() {
801 @@ -1417,6 +1421,10 @@
805 +CharCodeToUnicode* GfxCIDFont::getCTU() {
809 int GfxCIDFont::getNextChar(char *s, int len, CharCode *code,
810 Unicode *u, int uSize, int *uLen,
811 double *dx, double *dy, double *ox, double *oy) {
812 --- OutputDev.h Sat Jul 28 00:11:08 2007
813 +++ OutputDev.h Sun Sep 9 13:50:40 2007
817 #include "CharTypes.h"
822 --- SplashOutputDev.h 2007-10-20 13:17:02.000000000 +0200
823 +++ SplashOutputDev.h 2007-10-20 13:17:23.000000000 +0200
825 virtual void setVectorAntialias(GBool vaa);
828 + void doUpdateFont(GfxState *state);
831 void setupScreenParams(double hDPI, double vDPI);
833 SplashPattern *getColor(GfxGray gray, GfxRGB *rgb);
835 SplashPath *convertPath(GfxState *state, GfxPath *path);
836 - void doUpdateFont(GfxState *state);
837 void drawType3Glyph(T3FontCache *t3Font,
838 T3FontCacheTag *tag, Guchar *data);
839 static GBool imageMaskSrc(void *data, SplashColorPtr line);
840 --- xpdf/GlobalParams.h 2007-10-20 13:18:03.000000000 +0200
841 +++ xpdf/GlobalParams.h 2007-10-20 13:25:52.000000000 +0200
844 GlobalParams(char *cfgFileName);
847 + virtual ~GlobalParams();
849 void setBaseDir(char *dir);
850 void setupBaseFonts(char *dir);
851 --- xpdf/SplashOutputDev.h.orig 2007-10-21 17:43:29.000000000 +0200
852 +++ xpdf/SplashOutputDev.h 2007-11-19 10:07:27.000000000 +0100
856 void doUpdateFont(GfxState *state);
858 + SplashPath *convertPath(GfxState *state, GfxPath *path);
861 void setupScreenParams(double hDPI, double vDPI);
864 SplashPattern *getColor(GfxGray gray, GfxRGB *rgb);
866 - SplashPath *convertPath(GfxState *state, GfxPath *path);
867 void drawType3Glyph(T3FontCache *t3Font,
868 T3FontCacheTag *tag, Guchar *data);
869 static GBool imageMaskSrc(void *data, SplashColorPtr line);
870 --- xpdf/SplashFont.cc.orig 2008-09-09 21:31:01.000000000 +0200
871 +++ xpdf/SplashFont.cc 2008-10-05 17:37:08.000000000 +0200
875 xMin = yMin = xMax = yMax = 0;
882 void SplashFont::initCache() {
883 --- xpdf/SplashFTFont.cc.orig 2008-09-09 21:31:01.000000000 +0200
884 +++ xpdf/SplashFTFont.cc 2008-10-05 17:37:32.000000000 +0200
888 face = fontFileA->face;
890 if (FT_New_Size(face, &sizeObj)) {
894 if (FT_Set_Pixel_Sizes(face, 0, (int)size)) {
898 + this->ascender = face->ascender;
899 + this->descender = face->descender;
901 // if the textMat values are too small, FreeType's fixed point
902 // arithmetic doesn't work so well
903 textScale = splashSqrt(textMat[2]*textMat[2] + textMat[3]*textMat[3]) / size;
908 +int SplashFTFont::getNumChars()
910 + SplashFTFontFile* ff = (SplashFTFontFile *)fontFile;
911 + return ff->face->num_glyphs;
914 SplashPath *SplashFTFont::getGlyphPath(int c) {
915 static FT_Outline_Funcs outlineFuncs = {
916 #if FREETYPE_MINOR <= 1
921 + this->last_advance = -1;
923 ff = (SplashFTFontFile *)fontFile;
924 ff->face->size = sizeObj;
925 FT_Set_Transform(ff->face, &textMatrix, NULL);
927 if (FT_Get_Glyph(slot, &glyph)) {
930 + this->last_advance = glyph->advance.x/65536.0;
932 path.path = new SplashPath();
933 path.textScale = textScale;
934 path.needClose = gFalse;
935 --- xpdf/SplashFTFont.h.orig 2008-09-09 21:31:01.000000000 +0200
936 +++ xpdf/SplashFTFont.h 2008-10-04 17:39:57.000000000 +0200
938 virtual GBool makeGlyph(int c, int xFrac, int yFrac,
939 SplashGlyphBitmap *bitmap);
941 + // return the number of characters in this font
942 + virtual int getNumChars();
944 // Return the path for a glyph.
945 virtual SplashPath *getGlyphPath(int c);