1 #ifndef __charoutputdev_h__
2 #define __charoutputdev_h__
4 #include "../gfxdevice.h"
5 #include "../gfxsource.h"
6 #include "../gfxtools.h"
9 #include "InfoOutputDev.h"
11 #include "GlobalParams.h"
12 #include "CommonOutputDev.h"
14 extern void addGlobalFont(const char*filename
);
15 extern void addGlobalLanguageDir(const char*dir
);
16 extern void addGlobalFontDir(const char*dirname
);
20 class CharOutputDev
: public CommonOutputDev
{
24 CharOutputDev(InfoOutputDev
*info
, PDFDoc
*doc
, int*page2page
, int num_pages
, int x
, int y
, int x1
, int y1
, int x2
, int y2
);
25 virtual ~CharOutputDev();
27 virtual void setDevice(gfxdevice_t
*dev
);
28 virtual void setParameter(const char*key
, const char*value
);
30 virtual void beginPage(GfxState
*state
, int pageNum
);
31 virtual void endPage();
33 virtual GBool
upsideDown();
34 virtual GBool
useDrawChar();
36 virtual void processLink(Link
*link
, Catalog
*catalog
);
37 virtual void saveState(GfxState
*state
) ;
38 virtual void restoreState(GfxState
*state
) ;
40 //----- update graphics state
41 virtual void updateFont(GfxState
*state
);
42 virtual void updateTextMat(GfxState
*state
);
45 virtual void beginString(GfxState
*state
, GString
*s
) ;
46 virtual void endString(GfxState
*state
) ;
47 virtual void endTextObject(GfxState
*state
);
48 virtual void drawChar(GfxState
*state
, double x
, double y
,
50 double originX
, double originY
,
51 CharCode code
, int nBytes
, Unicode
*u
, int uLen
);
54 virtual GBool
beginType3Char(GfxState
*state
, double x
, double y
, double dx
, double dy
, CharCode code
, Unicode
*u
, int uLen
);
55 virtual void endType3Char(GfxState
*state
);
57 virtual void type3D0(GfxState
*state
, double wx
, double wy
);
58 virtual void type3D1(GfxState
*state
, double wx
, double wy
, double llx
, double lly
, double urx
, double ury
);
60 virtual GBool
needNonText();
65 int type3active
; // are we between beginType3()/endType3()?
67 gfxline_t
* current_text_stroke
;
68 gfxline_t
* current_text_clip
;
70 // state variables for space char detection
74 double last_char_x_fontsize
;
75 double last_char_y_fontsize
;
76 double last_char_advance
;
77 double last_average_advance
;
80 char last_char_was_space
;
83 GFXLink
*previous_link
;
87 int config_use_fontconfig
;
88 int config_remapunicode
;
89 int config_extrafontdata
;
91 int config_detectspaces
;
92 int config_space_between_lines
;
93 double config_fontquality
;
94 char* config_linkdatafile
;
105 void draw(CharOutputDev
*out
, gfxdevice_t
*dev
);
106 void addchar(int unicode
);
107 GFXLink(GFXLink
*last
, const char*action
, double x1
, double y1
, double x2
, double y2
);
111 class GFXGlobalParams
: public GlobalParams
{
115 virtual DisplayFontParam
*getDisplayFont(GString
*fontName
);
118 #endif //__charoutputdev_h__