⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xoutputdev.h

📁 source code: Covert TXT to PDF
💻 H
📖 第 1 页 / 共 2 页
字号:
//========================================================================//// XOutputDev.h//// Copyright 1996-2002 Glyph & Cog, LLC////========================================================================#ifndef XOUTPUTDEV_H#define XOUTPUTDEV_H#include <aconf.h>#ifdef USE_GCC_PRAGMAS#pragma interface#endif#include <stddef.h>#include <X11/Xlib.h>#include <X11/Xutil.h>#include "config.h"#include "CharTypes.h"#include "GlobalParams.h"#include "OutputDev.h"class GString;class GList;struct GfxRGB;class GfxFont;class GfxSubpath;class TextPage;class XOutputFontCache;struct T3FontCacheTag;class T3FontCache;struct T3GlyphStack;class XOutputDev;class Link;class Catalog;class DisplayFontParam;class UnicodeMap;class CharCodeToUnicode;#if HAVE_T1LIB_Hclass T1FontEngine;class T1FontFile;class T1Font;#endif#if FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H)class FTFontEngine;class FTFontFile;class FTFont;#endif#if !FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H)class TTFontEngine;class TTFontFile;class TTFont;#endif//------------------------------------------------------------------------// Constants//------------------------------------------------------------------------#define maxRGBCube 7		// max size of RGB color cube#define numTmpPoints 256	// number of XPoints in temporary array#define numTmpSubpaths 16	// number of elements in temporary arrays				//   for fill/clip//------------------------------------------------------------------------// Misc types//------------------------------------------------------------------------struct BoundingRect {  short xMin, xMax;		// min/max x values  short yMin, yMax;		// min/max y values};//------------------------------------------------------------------------// 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;};#endif // HAVE_T1LIB_H#if FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H)//------------------------------------------------------------------------// XOutputFTFont//------------------------------------------------------------------------class XOutputFTFont: public XOutputFont {public:  XOutputFTFont(Ref *idA, FTFontFile *fontFileA,		double m11OrigA, double m12OrigA,		double m21OrigA, double m22OrigA,		double m11A, double m12A,		double m21A, double m22A,		Display *displayA, XOutputDev *xOutA);  virtual ~XOutputFTFont();  // 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:  FTFontFile *fontFile;  FTFont *font;};#endif // FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H)#if !FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H)//------------------------------------------------------------------------// XOutputTTFont//------------------------------------------------------------------------class XOutputTTFont: public XOutputFont {public:  XOutputTTFont(Ref *idA, TTFontFile *fontFileA,		double m11OrigA, double m12OrigA,		double m21OrigA, double m22OrigA,		double m11A, double m12A,		double m21A, double m22A,		Display *displayA, XOutputDev *xOutA);  virtual ~XOutputTTFont();  // 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);private:  TTFontFile *fontFile;  TTFont *font;};#endif // !FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H)//------------------------------------------------------------------------// XOutputServer8BitFont//------------------------------------------------------------------------class XOutputServer8BitFont: public XOutputFont {public:  XOutputServer8BitFont(Ref *idA, GString *xlfdFmt,			UnicodeMap *xUMapA, CharCodeToUnicode *fontUMap,			double m11OrigA, double m12OrigA,			double m21OrigA, double m22OrigA,			double m11A, double m12A, double m21A, double m22A,			Display *displayA, XOutputDev *xOutA);  virtual ~XOutputServer8BitFont();  // 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);private:  XFontStruct *xFont;		// the X font  Gushort map[256];		// forward map (char code -> X font code)  UnicodeMap *xUMap;};//------------------------------------------------------------------------// XOutputServer16BitFont//------------------------------------------------------------------------class XOutputServer16BitFont: public XOutputFont {public:  XOutputServer16BitFont(Ref *idA, GString *xlfdFmt,			 UnicodeMap *xUMapA, CharCodeToUnicode *fontUMap,			 double m11OrigA, double m12OrigA,			 double m21OrigA, double m22OrigA,			 double m11A, double m12A, double m21A, double m22A,			 Display *displayA, XOutputDev *xOutA);  virtual ~XOutputServer16BitFont();  // 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);private:  XFontStruct *xFont;		// the X font  UnicodeMap *xUMap;};//------------------------------------------------------------------------// XOutputFontCache//------------------------------------------------------------------------#if HAVE_T1LIB_Hclass XOutputT1FontFile {public:  XOutputT1FontFile(int numA, int genA, GBool substA,		    T1FontFile *fontFileA, GString *tmpFileNameA)    { num = numA; gen = genA; subst = substA;      fontFile = fontFileA; tmpFileName = tmpFileNameA; }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -