]> www.fi.muni.cz Git - evince.git/blob - pdf/xpdf/XOutputDev.h
7a6544dd6fd97aa447862725407972c3b6dc13d9
[evince.git] / pdf / xpdf / XOutputDev.h
1 //========================================================================
2 //
3 // XOutputDev.h
4 //
5 // Copyright 1996-2003 Glyph & Cog, LLC
6 //
7 //========================================================================
8
9 #ifndef XOUTPUTDEV_H
10 #define XOUTPUTDEV_H
11
12 #include <aconf.h>
13
14 #ifdef USE_GCC_PRAGMAS
15 #pragma interface
16 #endif
17
18 #include <stddef.h>
19 #include <X11/Xlib.h>
20 #include <X11/Xutil.h>
21 #include "config.h"
22 #include "Object.h"
23 #include "CharTypes.h"
24 #include "GlobalParams.h"
25 #include "OutputDev.h"
26
27 class GString;
28 class GList;
29 struct GfxRGB;
30 class GfxFont;
31 class GfxSubpath;
32 class TextPage;
33 class XOutputFontCache;
34 struct T3FontCacheTag;
35 class T3FontCache;
36 struct T3GlyphStack;
37 class XOutputDev;
38 class Link;
39 class Catalog;
40 class DisplayFontParam;
41 class UnicodeMap;
42 class CharCodeToUnicode;
43
44 #if HAVE_T1LIB_H
45 class T1FontEngine;
46 class T1FontFile;
47 class T1Font;
48 #endif
49
50 #if FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H)
51 class FTFontEngine;
52 class FTFontFile;
53 class FTFont;
54 #endif
55
56 #if !FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H)
57 class TTFontEngine;
58 class TTFontFile;
59 class TTFont;
60 #endif
61
62 //------------------------------------------------------------------------
63 // Constants
64 //------------------------------------------------------------------------
65
66 #define maxRGBCube 7            // max size of RGB color cube
67
68 #define numTmpPoints 256        // number of XPoints in temporary array
69 #define numTmpSubpaths 16       // number of elements in temporary arrays
70                                 //   for fill/clip
71
72 //------------------------------------------------------------------------
73 // Misc types
74 //------------------------------------------------------------------------
75
76 struct BoundingRect {
77   short xMin, xMax;             // min/max x values
78   short yMin, yMax;             // min/max y values
79 };
80
81 //------------------------------------------------------------------------
82 // XOutputFont
83 //------------------------------------------------------------------------
84
85 class XOutputFont {
86 public:
87
88   XOutputFont(Ref *idA, double m11OrigA, double m12OrigA,
89               double m21OrigA, double m22OrigA,
90               double m11A, double m12A, double m21A, double m22A,
91               Display *displayA, XOutputDev *xOutA);
92
93   virtual ~XOutputFont();
94
95   // Does this font match the ID and transform?
96   GBool matches(Ref *idA, double m11OrigA, double m12OrigA,
97                 double m21OrigA, double m22OrigA)
98     { return id.num == idA->num && id.gen == idA->gen &&
99              m11Orig == m11OrigA && m12Orig == m12OrigA &&
100              m21Orig == m21OrigA && m22Orig == m22OrigA; }
101
102   // Was font created successfully?
103   virtual GBool isOk() = 0;
104
105   // Update <gc> with this font.
106   virtual void updateGC(GC gc) = 0;
107
108   // Draw character <c>/<u> at <x>,<y> (in device space).
109   virtual void drawChar(GfxState *state, Pixmap pixmap, int w, int h,
110                         GC gc, GfxRGB *rgb,
111                         double x, double y, double dx, double dy,
112                         CharCode c, Unicode *u, int uLen) = 0;
113
114   // Returns true if this XOutputFont subclass provides the
115   // getCharPath function.
116   virtual GBool hasGetCharPath() { return gFalse; }
117
118   // Add the character outline for <c>/<u> to the current path.
119   virtual void getCharPath(GfxState *state,
120                            CharCode c, Unicode *u, int ulen);
121
122 protected:
123
124   Ref id;                       // font ID
125   double m11Orig, m12Orig,      // original transform matrix
126          m21Orig, m22Orig;
127   double m11, m12, m21, m22;    // actual transform matrix (possibly
128                                 //   modified for font substitution)
129   Display *display;             // X display
130   XOutputDev *xOut;
131 };
132
133 #if HAVE_T1LIB_H
134 //------------------------------------------------------------------------
135 // XOutputT1Font
136 //------------------------------------------------------------------------
137
138 class XOutputT1Font: public XOutputFont {
139 public:
140
141   XOutputT1Font(Ref *idA, T1FontFile *fontFileA,
142                 double m11OrigA, double m12OrigA,
143                 double m21OrigA, double m22OrigA,
144                 double m11A, double m12A,
145                 double m21A, double m22A,
146                 Display *displayA, XOutputDev *xOutA);
147
148   virtual ~XOutputT1Font();
149
150   // Was font created successfully?
151   virtual GBool isOk();
152
153   // Update <gc> with this font.
154   virtual void updateGC(GC gc);
155
156   // Draw character <c>/<u> at <x>,<y>.
157   virtual void drawChar(GfxState *state, Pixmap pixmap, int w, int h,
158                         GC gc, GfxRGB *rgb,
159                         double x, double y, double dx, double dy,
160                         CharCode c, Unicode *u, int uLen);
161
162   // Returns true if this XOutputFont subclass provides the
163   // getCharPath function.
164   virtual GBool hasGetCharPath() { return gTrue; }
165
166   // Add the character outline for <c>/<u> to the current path.
167   virtual void getCharPath(GfxState *state,
168                            CharCode c, Unicode *u, int ulen);
169
170 private:
171
172   T1FontFile *fontFile;
173   T1Font *font;
174 };
175 #endif // HAVE_T1LIB_H
176
177 #if FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H)
178 //------------------------------------------------------------------------
179 // XOutputFTFont
180 //------------------------------------------------------------------------
181
182 class XOutputFTFont: public XOutputFont {
183 public:
184
185   XOutputFTFont(Ref *idA, FTFontFile *fontFileA,
186                 double m11OrigA, double m12OrigA,
187                 double m21OrigA, double m22OrigA,
188                 double m11A, double m12A,
189                 double m21A, double m22A,
190                 Display *displayA, XOutputDev *xOutA);
191
192   virtual ~XOutputFTFont();
193
194   // Was font created successfully?
195   virtual GBool isOk();
196
197   // Update <gc> with this font.
198   virtual void updateGC(GC gc);
199
200   // Draw character <c>/<u> at <x>,<y>.
201   virtual void drawChar(GfxState *state, Pixmap pixmap, int w, int h,
202                         GC gc, GfxRGB *rgb,
203                         double x, double y, double dx, double dy,
204                         CharCode c, Unicode *u, int uLen);
205
206   // Returns true if this XOutputFont subclass provides the
207   // getCharPath function.
208   virtual GBool hasGetCharPath() { return gTrue; }
209
210   // Add the character outline for <c>/<u> to the current path.
211   virtual void getCharPath(GfxState *state,
212                            CharCode c, Unicode *u, int ulen);
213
214 private:
215
216   FTFontFile *fontFile;
217   FTFont *font;
218 };
219 #endif // FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H)
220
221 #if !FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H)
222 //------------------------------------------------------------------------
223 // XOutputTTFont
224 //------------------------------------------------------------------------
225
226 class XOutputTTFont: public XOutputFont {
227 public:
228
229   XOutputTTFont(Ref *idA, TTFontFile *fontFileA,
230                 double m11OrigA, double m12OrigA,
231                 double m21OrigA, double m22OrigA,
232                 double m11A, double m12A,
233                 double m21A, double m22A,
234                 Display *displayA, XOutputDev *xOutA);
235
236   virtual ~XOutputTTFont();
237
238   // Was font created successfully?
239   virtual GBool isOk();
240
241   // Update <gc> with this font.
242   virtual void updateGC(GC gc);
243
244   // Draw character <c>/<u> at <x>,<y>.
245   virtual void drawChar(GfxState *state, Pixmap pixmap, int w, int h,
246                         GC gc, GfxRGB *rgb,
247                         double x, double y, double dx, double dy,
248                         CharCode c, Unicode *u, int uLen);
249
250 private:
251
252   TTFontFile *fontFile;
253   TTFont *font;
254 };
255 #endif // !FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H)
256
257 //------------------------------------------------------------------------
258 // XOutputServer8BitFont
259 //------------------------------------------------------------------------
260
261 class XOutputServer8BitFont: public XOutputFont {
262 public:
263
264   XOutputServer8BitFont(Ref *idA, GString *xlfdFmt,
265                         UnicodeMap *xUMapA, CharCodeToUnicode *fontUMap,
266                         double m11OrigA, double m12OrigA,
267                         double m21OrigA, double m22OrigA,
268                         double m11A, double m12A, double m21A, double m22A,
269                         Display *displayA, XOutputDev *xOutA);
270
271   virtual ~XOutputServer8BitFont();
272
273   // Was font created successfully?
274   virtual GBool isOk();
275
276   // Update <gc> with this font.
277   virtual void updateGC(GC gc);
278
279   // Draw character <c>/<u> at <x>,<y>.
280   virtual void drawChar(GfxState *state, Pixmap pixmap, int w, int h,
281                         GC gc, GfxRGB *rgb,
282                         double x, double y, double dx, double dy,
283                         CharCode c, Unicode *u, int uLen);
284
285 private:
286
287   XFontStruct *xFont;           // the X font
288   Gushort map[256];             // forward map (char code -> X font code)
289   UnicodeMap *xUMap;
290 };
291
292 //------------------------------------------------------------------------
293 // XOutputServer16BitFont
294 //------------------------------------------------------------------------
295
296 class XOutputServer16BitFont: public XOutputFont {
297 public:
298
299   XOutputServer16BitFont(Ref *idA, GString *xlfdFmt,
300                          UnicodeMap *xUMapA, CharCodeToUnicode *fontUMap,
301                          double m11OrigA, double m12OrigA,
302                          double m21OrigA, double m22OrigA,
303                          double m11A, double m12A, double m21A, double m22A,
304                          Display *displayA, XOutputDev *xOutA);
305
306   virtual ~XOutputServer16BitFont();
307
308   // Was font created successfully?
309   virtual GBool isOk();
310
311   // Update <gc> with this font.
312   virtual void updateGC(GC gc);
313
314   // Draw character <c>/<u> at <x>,<y>.
315   virtual void drawChar(GfxState *state, Pixmap pixmap, int w, int h,
316                         GC gc, GfxRGB *rgb,
317                         double x, double y, double dx, double dy,
318                         CharCode c, Unicode *u, int uLen);
319
320 private:
321
322   XFontStruct *xFont;           // the X font
323   UnicodeMap *xUMap;
324 };
325
326 //------------------------------------------------------------------------
327 // XOutputFontCache
328 //------------------------------------------------------------------------
329
330 #if HAVE_T1LIB_H
331 class XOutputT1FontFile {
332 public:
333   XOutputT1FontFile(int numA, int genA, GBool substA,
334                     T1FontFile *fontFileA, GString *tmpFileNameA)
335     { num = numA; gen = genA; subst = substA;
336       fontFile = fontFileA; tmpFileName = tmpFileNameA; }
337   ~XOutputT1FontFile();
338   int num, gen;
339   GBool subst;
340   T1FontFile *fontFile;
341   GString *tmpFileName;
342 };
343 #endif
344
345 #if FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H)
346 class XOutputFTFontFile {
347 public:
348   XOutputFTFontFile(int numA, int genA, GBool substA,
349                     FTFontFile *fontFileA, GString *tmpFileNameA)
350     { num = numA; gen = genA; subst = substA;
351       fontFile = fontFileA; tmpFileName = tmpFileNameA; }
352   ~XOutputFTFontFile();
353   int num, gen;
354   GBool subst;
355   FTFontFile *fontFile;
356   GString *tmpFileName;
357 };
358 #endif
359
360 #if !FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H)
361 class XOutputTTFontFile {
362 public:
363   XOutputTTFontFile(int numA, int genA, GBool substA,
364                     TTFontFile *fontFileA, GString *tmpFileNameA)
365     { num = numA; gen = genA; subst = substA;
366       fontFile = fontFileA; tmpFileName = tmpFileNameA; }
367   ~XOutputTTFontFile();
368   int num, gen;
369   GBool subst;
370   TTFontFile *fontFile;
371   GString *tmpFileName;
372 };
373 #endif
374
375 class XOutputFontCache {
376 public:
377
378   // Constructor.
379   XOutputFontCache(Display *displayA, Guint depthA,
380                    XOutputDev *xOutA,
381                    FontRastControl t1libControlA,
382                    FontRastControl freetypeControlA);
383
384   // Destructor.
385   ~XOutputFontCache();
386
387   // Initialize (or re-initialize) the font cache for a new document.
388   void startDoc(int screenNum, Visual *visual,
389                 Colormap colormap, GBool trueColor,
390                 int rMul, int gMul, int bMul,
391                 int rShift, int gShift, int bShift,
392                 Gulong *colors, int numColors);
393
394   // Get a font.  This creates a new font if necessary.
395   XOutputFont *getFont(XRef *xref, GfxFont *gfxFont, double m11, double m12,
396                        double m21, double m22);
397
398 private:
399
400   void delFonts();
401   void clear();
402   XOutputFont *tryGetFont(XRef *xref, DisplayFontParam *dfp, GfxFont *gfxFont,
403                           double m11Orig, double m12Orig,
404                           double m21Orig, double m22Orig,
405                           double m11, double m12, double m21, double m22,
406                           GBool subst);
407 #if HAVE_T1LIB_H
408   XOutputFont *tryGetT1Font(XRef *xref, GfxFont *gfxFont,
409                             double m11, double m12, double m21, double m22);
410   XOutputFont *tryGetT1FontFromFile(XRef *xref, GString *fileName,
411                                     GBool deleteFile, GfxFont *gfxFont,
412                                     double m11Orig, double m12Orig,
413                                     double m21Orig, double m22Orig,
414                                     double m11, double m12,
415                                     double m21, double m22, GBool subst);
416 #endif
417 #if FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H)
418   XOutputFont *tryGetFTFont(XRef *xref, GfxFont *gfxFont,
419                             double m11, double m12, double m21, double m22);
420   XOutputFont *tryGetFTFontFromFile(XRef *xref, GString *fileName,
421                                     GBool deleteFile, GfxFont *gfxFont,
422                                     double m11Orig, double m12Orig,
423                                     double m21Orig, double m22Orig,
424                                     double m11, double m12,
425                                     double m21, double m22,
426                                     GBool embedded, GBool subst);
427 #endif
428 #if !FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H)
429   XOutputFont *tryGetTTFont(XRef *xref, GfxFont *gfxFont,
430                             double m11, double m12, double m21, double m22);
431   XOutputFont *tryGetTTFontFromFile(XRef *xref, GString *fileName,
432                                     GBool deleteFile, GfxFont *gfxFont,
433                                     double m11Orig, double m12Orig,
434                                     double m21Orig, double m22Orig,
435                                     double m11, double m12,
436                                     double m21, double m22, GBool subst);
437 #endif
438   XOutputFont *tryGetServerFont(GString *xlfd, GString *encodingName,
439                                 GfxFont *gfxFont,
440                                 double m11Orig, double m12Orig,
441                                 double m21Orig, double m22Orig,
442                                 double m11, double m12,
443                                 double m21, double m22);
444
445   Display *display;             // X display pointer
446   XOutputDev *xOut;
447   Guint depth;                  // pixmap depth
448
449   XOutputFont *
450     fonts[xOutFontCacheSize];
451   int nFonts;
452
453 #if HAVE_T1LIB_H
454   FontRastControl t1libControl; // t1lib settings
455   T1FontEngine *t1Engine;       // Type 1 font engine
456   GList *t1FontFiles;           // list of Type 1 font files
457                                 //   [XOutputT1FontFile]
458 #endif
459
460 #if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
461   FontRastControl               // FreeType settings
462     freetypeControl;
463 #endif
464 #if FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H)
465   FTFontEngine *ftEngine;       // FreeType font engine
466   GList *ftFontFiles;           // list of FreeType font files
467                                 //   [XOutputFTFontFile]
468 #endif
469 #if !FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H)
470   TTFontEngine *ttEngine;       // TrueType font engine
471   GList *ttFontFiles;           // list of TrueType font files
472                                 //   [XOutputTTFontFile]
473 #endif
474 };
475
476 //------------------------------------------------------------------------
477 // XOutputState
478 //------------------------------------------------------------------------
479
480 struct XOutputState {
481   GC strokeGC;
482   GC fillGC;
483   Region clipRegion;
484   XOutputState *next;
485 };
486
487 //------------------------------------------------------------------------
488 // XOutputDev
489 //------------------------------------------------------------------------
490
491 class XOutputDev: public OutputDev {
492 public:
493
494   // Constructor.
495   XOutputDev(Display *displayA, int screenNumA,
496              Visual *visualA, Colormap colormapA,
497              GBool reverseVideoA, unsigned long paperColorA,
498              GBool installCmap, int rgbCubeSize,
499              int forceDepth = 0);
500
501   // Destructor.
502   virtual ~XOutputDev();
503
504   //---- get info about output device
505
506   // Does this device use upside-down coordinates?
507   // (Upside-down means (0,0) is the top left corner of the page.)
508   virtual GBool upsideDown() { return gTrue; }
509
510   // Does this device use drawChar() or drawString()?
511   virtual GBool useDrawChar() { return gTrue; }
512
513   // Does this device use beginType3Char/endType3Char?  Otherwise,
514   // text in Type 3 fonts will be drawn with drawChar/drawString.
515   virtual GBool interpretType3Chars() { return gTrue; }
516
517   //----- initialization and control
518
519   // Start a page.
520   virtual void startPage(int pageNum, GfxState *state);
521
522   // End a page.
523   virtual void endPage();
524
525   //----- link borders
526   virtual void drawLink(Link *link, Catalog *catalog);
527
528   //----- save/restore graphics state
529   virtual void saveState(GfxState *state);
530   virtual void restoreState(GfxState *state);
531
532   //----- update graphics state
533   virtual void updateAll(GfxState *state);
534   virtual void updateCTM(GfxState *state, double m11, double m12,
535                          double m21, double m22, double m31, double m32);
536   virtual void updateLineDash(GfxState *state);
537   virtual void updateFlatness(GfxState *state);
538   virtual void updateLineJoin(GfxState *state);
539   virtual void updateLineCap(GfxState *state);
540   virtual void updateMiterLimit(GfxState *state);
541   virtual void updateLineWidth(GfxState *state);
542   virtual void updateFillColor(GfxState *state);
543   virtual void updateStrokeColor(GfxState *state);
544
545   //----- update text state
546   virtual void updateFont(GfxState *state);
547
548   //----- path painting
549   virtual void stroke(GfxState *state);
550   virtual void fill(GfxState *state);
551   virtual void eoFill(GfxState *state);
552
553   //----- path clipping
554   virtual void clip(GfxState *state);
555   virtual void eoClip(GfxState *state);
556
557   //----- text drawing
558   virtual void beginString(GfxState *state, GString *s);
559   virtual void endString(GfxState *state);
560   virtual void drawChar(GfxState *state, double x, double y,
561                         double dx, double dy,
562                         double originX, double originY,
563                         CharCode code, Unicode *u, int uLen);
564   virtual GBool beginType3Char(GfxState *state,
565                                CharCode code, Unicode *u, int uLen);
566   virtual void endType3Char(GfxState *state);
567
568   //----- image drawing
569   virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
570                              int width, int height, GBool invert,
571                              GBool inlineImg);
572   virtual void drawImage(GfxState *state, Object *ref, Stream *str,
573                          int width, int height, GfxImageColorMap *colorMap,
574                          int *maskColors, GBool inlineImg);
575
576   //----- Type 3 font operators
577   virtual void type3D0(GfxState *state, double wx, double wy);
578   virtual void type3D1(GfxState *state, double wx, double wy,
579                        double llx, double lly, double urx, double ury);
580
581   //----- special access
582
583   // Called to indicate that a new PDF document has been loaded.
584   void startDoc(XRef *xrefA);
585
586   // Find a string.  If <top> is true, starts looking at <xMin>,<yMin>;
587   // otherwise starts looking at top of page.  If <bottom> is true,
588   // stops looking at <xMax>,<yMax>; otherwise stops looking at bottom
589   // of page.  If found, sets the text bounding rectange and returns
590   // true; otherwise returns false.
591   GBool findText(Unicode *s, int len, GBool top, GBool bottom,
592                  int *xMin, int *yMin, int *xMax, int *yMax);
593
594   // Get the text which is inside the specified rectangle.
595   GString *getText(int xMin, int yMin, int xMax, int yMax);
596
597   GBool isReverseVideo() { return reverseVideo; }
598
599   // Update pixmap ID after a page change.
600   void setPixmap(Pixmap pixmapA, int pixmapWA, int pixmapHA)
601     { pixmap = pixmapA; pixmapW = pixmapWA; pixmapH = pixmapHA; }
602
603   // Get the off-screen pixmap, its size, various display info.
604   Pixmap getPixmap() { return pixmap; }
605   int getPixmapWidth() { return pixmapW; }
606   int getPixmapHeight() { return pixmapH; }
607   Display *getDisplay() { return display; }
608   Guint getDepth() { return depth; }
609
610   Gulong findColor(GfxRGB *rgb);
611
612 private:
613
614   XRef *xref;                   // the xref table for this PDF file
615   Display *display;             // X display pointer
616   int screenNum;                // X screen number
617   Pixmap pixmap;                // pixmap to draw into
618   int pixmapW, pixmapH;         // size of pixmap
619   Guint depth;                  // pixmap depth
620   Visual *visual;               // X visual
621   Colormap colormap;            // X colormap
622   int flatness;                 // line flatness
623   GC paperGC;                   // GC for background
624   GC strokeGC;                  // GC with stroke color
625   GC fillGC;                    // GC with fill color
626   Region clipRegion;            // clipping region
627   GBool trueColor;              // set if using a TrueColor visual
628   int rMul, gMul, bMul;         // RGB multipliers (for TrueColor)
629   int rShift, gShift, bShift;   // RGB shifts (for TrueColor)
630   Gulong                        // color cube
631     colors[maxRGBCube * maxRGBCube * maxRGBCube];
632   unsigned long paperColor;     // paper color (pixel value)
633   int numColors;                // size of color cube
634   double redMap[256];           // map pixel (from color cube) to red value
635   GBool reverseVideo;           // reverse video mode
636   XPoint                        // temporary points array
637     tmpPoints[numTmpPoints];
638   int                           // temporary arrays for fill/clip
639     tmpLengths[numTmpSubpaths];
640   BoundingRect
641     tmpRects[numTmpSubpaths];
642   GfxFont *gfxFont;             // current PDF font
643   XOutputFont *font;            // current font
644   GBool needFontUpdate;         // set when the font needs to be updated
645   XOutputFontCache *fontCache;  // font cache
646   T3FontCache *                 // Type 3 font cache
647     t3FontCache[xOutT3FontCacheSize];
648   int nT3Fonts;                 // number of valid entries in t3FontCache
649   T3GlyphStack *t3GlyphStack;   // Type 3 glyph context stack
650   XOutputState *save;           // stack of saved states
651
652   TextPage *text;               // text from the current page
653
654   void updateLineAttrs(GfxState *state, GBool updateDash);
655   void doFill(GfxState *state, int rule);
656   void doClip(GfxState *state, int rule);
657   int convertPath(GfxState *state, XPoint **points, int *size,
658                   int *numPoints, int **lengths, GBool fillHack);
659   void convertSubpath(GfxState *state, GfxSubpath *subpath,
660                       XPoint **points, int *size, int *n);
661   void doCurve(XPoint **points, int *size, int *k,
662                double x0, double y0, double x1, double y1,
663                double x2, double y2, double x3, double y3);
664   void addPoint(XPoint **points, int *size, int *k, int x, int y);
665   void drawType3Glyph(T3FontCache *t3Font,
666                       T3FontCacheTag *tag, Guchar *data,
667                       double x, double y, GfxRGB *color);
668   Gulong findColor(GfxRGB *x, GfxRGB *err);
669 };
670
671 #endif