+//------------------------------------------------------------------------
+// XOutputFont
+//------------------------------------------------------------------------
+
+class XOutputFont {
+public:
+
+ XOutputFont(Ref *idA, double m11OrigA, double m12OrigA,
+ double m21OrigA, double m22OrigA,
+ double m11A, double m12A, double m21A, double m22A,
+ Display *displayA, XOutputDev *xOutA);
+
+ virtual ~XOutputFont();
+
+ // Does this font match the ID and transform?
+ GBool matches(Ref *idA, double m11OrigA, double m12OrigA,
+ double m21OrigA, double m22OrigA)
+ { return id.num == idA->num && id.gen == idA->gen &&
+ m11Orig == m11OrigA && m12Orig == m12OrigA &&
+ m21Orig == m21OrigA && m22Orig == m22OrigA; }
+
+ // Was font created successfully?
+ virtual GBool isOk() = 0;
+
+ // Update <gc> with this font.
+ virtual void updateGC(GC gc) = 0;
+
+ // Draw character <c>/<u> at <x>,<y> (in device space).
+ virtual void drawChar(GfxState *state, Pixmap pixmap, int w, int h,
+ GC gc, GfxRGB *rgb,
+ double x, double y, double dx, double dy,
+ CharCode c, Unicode *u, int uLen) = 0;
+
+ // Returns true if this XOutputFont subclass provides the
+ // getCharPath function.
+ virtual GBool hasGetCharPath() { return gFalse; }
+
+ // Add the character outline for <c>/<u> to the current path.
+ virtual void getCharPath(GfxState *state,
+ CharCode c, Unicode *u, int ulen);
+
+protected:
+
+ Ref id; // font ID
+ double m11Orig, m12Orig, // original transform matrix
+ m21Orig, m22Orig;
+ double m11, m12, m21, m22; // actual transform matrix (possibly
+ // modified for font substitution)
+ Display *display; // X display
+ XOutputDev *xOut;
+};
+
+#if HAVE_T1LIB_H
+//------------------------------------------------------------------------
+// XOutputT1Font
+//------------------------------------------------------------------------
+
+class XOutputT1Font: public XOutputFont {
+public:
+
+ XOutputT1Font(Ref *idA, T1FontFile *fontFileA,
+ double m11OrigA, double m12OrigA,
+ double m21OrigA, double m22OrigA,
+ double m11A, double m12A,
+ double m21A, double m22A,
+ Display *displayA, XOutputDev *xOutA);
+
+ virtual ~XOutputT1Font();
+
+ // Was font created successfully?
+ virtual GBool isOk();
+
+ // Update <gc> with this font.
+ virtual void updateGC(GC gc);
+
+ // Draw character <c>/<u> at <x>,<y>.
+ virtual void drawChar(GfxState *state, Pixmap pixmap, int w, int h,
+ GC gc, GfxRGB *rgb,
+ double x, double y, double dx, double dy,
+ CharCode c, Unicode *u, int uLen);
+
+ // Returns true if this XOutputFont subclass provides the
+ // getCharPath function.
+ virtual GBool hasGetCharPath() { return gTrue; }
+
+ // Add the character outline for <c>/<u> to the current path.
+ virtual void getCharPath(GfxState *state,
+ CharCode c, Unicode *u, int ulen);
+
+private:
+
+ T1FontFile *fontFile;
+ T1Font *font;