psdrv.h 16.1 KB
Newer Older
Alexandre Julliard's avatar
Alexandre Julliard committed
1
/*
Alexandre Julliard's avatar
Alexandre Julliard committed
2
 *	PostScript driver definitions
Alexandre Julliard's avatar
Alexandre Julliard committed
3 4
 *
 *	Copyright 1998  Huw D M Davies
5 6 7 8 9 10 11 12 13 14 15 16 17
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Alexandre Julliard's avatar
Alexandre Julliard committed
19
 */
20 21 22 23

#ifndef __WINE_PSDRV_H
#define __WINE_PSDRV_H

24 25
#include <stdarg.h>

26
#include "windef.h"
27
#include "winbase.h"
28
#include "wingdi.h"
29
#include "winspool.h"
Alexandre Julliard's avatar
Alexandre Julliard committed
30

31 32
#include "wine/list.h"

33
typedef struct {
34 35
    INT		    index;
    LPCSTR	    sz;
36 37 38
} GLYPHNAME;

typedef struct {
39
    LONG	    UV;
40
    const GLYPHNAME *name;
41 42
} UNICODEGLYPH;

Alexandre Julliard's avatar
Alexandre Julliard committed
43 44 45 46 47 48 49 50 51 52
typedef struct {
    float	llx, lly, urx, ury;
} AFMBBOX;

typedef struct _tagAFMLIGS {
    char		*successor;
    char		*ligature;
    struct _tagAFMLIGS	*next;
} AFMLIGS;

53
typedef struct {
54
    int			C;		/* character */
55 56
    LONG     	    	UV;
    float		WX;
57
    const GLYPHNAME	*N;		/* name */
58
    AFMBBOX		B;
59
    const AFMLIGS	*L;		/* Ligatures */
60 61 62 63 64 65 66
} OLD_AFMMETRICS;

typedef struct {
    INT     	    	C;  	    	    	/* AFM encoding (or -1) */
    LONG    	    	UV; 	    	    	/* Unicode value */
    FLOAT   	    	WX; 	    	    	/* Advance width */
    const GLYPHNAME 	*N; 	    	    	/* Glyph name */
Alexandre Julliard's avatar
Alexandre Julliard committed
67 68
} AFMMETRICS;

69
typedef struct {
70 71 72 73
    USHORT    	    	usUnitsPerEm; 	    	/* head:unitsPerEm */
    SHORT   	    	sAscender;  	    	/* hhea:Ascender */
    SHORT   	    	sDescender; 	    	/* hhea:Descender */
    SHORT   	    	sLineGap;   	    	/* hhea:LineGap */
74
    SHORT   	    	sAvgCharWidth;	    	/* OS/2:xAvgCharWidth */
75 76 77 78 79
    SHORT   	    	sTypoAscender;	    	/* OS/2:sTypoAscender */
    SHORT   	    	sTypoDescender;     	/* OS/2:sTypoDescender */
    SHORT   	    	sTypoLineGap;	    	/* OS/2:sTypeLineGap */
    USHORT  	    	usWinAscent;	    	/* OS/2:usWinAscent */
    USHORT  	    	usWinDescent;	    	/* OS/2:usWinDescent */
80 81
} WINMETRICS;

Alexandre Julliard's avatar
Alexandre Julliard committed
82
typedef struct _tagAFM {
83 84 85 86
    LPCSTR		FontName;
    LPCSTR		FullName;
    LPCSTR		FamilyName;
    LPCSTR		EncodingScheme;
87
    LONG		Weight;			/* FW_NORMAL etc. */
Alexandre Julliard's avatar
Alexandre Julliard committed
88
    float		ItalicAngle;
89
    BOOL		IsFixedPitch;
Alexandre Julliard's avatar
Alexandre Julliard committed
90 91 92 93 94
    float		UnderlinePosition;
    float		UnderlineThickness;
    AFMBBOX		FontBBox;
    float		Ascender;
    float		Descender;
95
    WINMETRICS	    	WinMetrics;
Alexandre Julliard's avatar
Alexandre Julliard committed
96
    int			NumofMetrics;
97
    const AFMMETRICS	*Metrics;
98
} AFM;
Alexandre Julliard's avatar
Alexandre Julliard committed
99

Alexandre Julliard's avatar
Alexandre Julliard committed
100 101 102 103 104 105
/* Note no 'next' in AFM. Use AFMLISTENTRY as a container. This allow more than
   one list to exist without having to reallocate the entire AFM structure. We
   keep a global list of all afms (PSDRV_AFMFontList) plus a list of available
   fonts for each DC (dc->physDev->Fonts) */

typedef struct _tagAFMLISTENTRY {
106
    const AFM			*afm;
Alexandre Julliard's avatar
Alexandre Julliard committed
107 108 109 110
    struct _tagAFMLISTENTRY	*next;
} AFMLISTENTRY;

typedef struct _tagFONTFAMILY {
Alexandre Julliard's avatar
Alexandre Julliard committed
111
    char			*FamilyName; /* family name */
Alexandre Julliard's avatar
Alexandre Julliard committed
112 113 114 115
    AFMLISTENTRY		*afmlist;    /* list of afms for this family */
    struct _tagFONTFAMILY	*next;       /* next family */
} FONTFAMILY;

116
extern FONTFAMILY   *PSDRV_AFMFontList;
117
extern const AFM    *const PSDRV_BuiltinAFMs[];     /* last element is NULL */
Alexandre Julliard's avatar
Alexandre Julliard committed
118 119 120 121 122 123 124 125 126 127 128 129 130 131

typedef struct _tagFONTNAME {
    char		*Name;
    struct _tagFONTNAME *next;
} FONTNAME;

typedef struct {
    float	llx, lly, urx, ury;
} IMAGEABLEAREA;

typedef struct {
    float	x, y;
} PAPERDIMENSION;

132 133
/* Solaris kludge */
#undef PAGESIZE
Alexandre Julliard's avatar
Alexandre Julliard committed
134
typedef struct _tagPAGESIZE {
135
    struct list         entry;
Alexandre Julliard's avatar
Alexandre Julliard committed
136 137 138 139 140 141 142 143 144
    char		*Name;
    char		*FullName;
    char		*InvocationString;
    IMAGEABLEAREA	*ImageableArea;
    PAPERDIMENSION	*PaperDimension;
    WORD		WinPage; /*eg DMPAPER_A4. Doesn't really belong here */
} PAGESIZE;


145 146 147 148 149 150 151 152
/* For BANDINFO Escape */
typedef struct _BANDINFOSTRUCT
{
    BOOL GraphicsFlag;
    BOOL TextFlag;
    RECT GraphicsRect;
} BANDINFOSTRUCT, *PBANDINFOSTRUCT;

Alexandre Julliard's avatar
Alexandre Julliard committed
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
typedef struct _tagOPTIONENTRY {
    char			*Name;		/* eg "True" */
    char			*FullName;	/* eg "Installed" */
    char			*InvocationString; /* Often NULL */
    struct _tagOPTIONENTRY	*next;
} OPTIONENTRY;

typedef struct _tagOPTION { /* Treat bool as a special case of pickone */
    char			*OptionName;	/* eg "*Option1" */
    char			*FullName;	/* eg "Envelope Feeder" */
    char			*DefaultOption; /* eg "False" */
    OPTIONENTRY			*Options;
    struct _tagOPTION		*next;
} OPTION;

typedef struct _tagCONSTRAINT {
    char			*Feature1;
    char			*Value1;
    char			*Feature2;
    char			*Value2;
    struct _tagCONSTRAINT	*next;
} CONSTRAINT;

typedef struct _tagINPUTSLOT {
177 178
    const char			*Name;
    const char			*FullName;
Alexandre Julliard's avatar
Alexandre Julliard committed
179 180 181 182 183
    char			*InvocationString;
    WORD			WinBin; /* eg DMBIN_LOWER */
    struct _tagINPUTSLOT	*next;
} INPUTSLOT;

184 185 186
typedef enum _RASTERIZEROPTION
  {RO_None, RO_Accept68K, RO_Type42, RO_TrueImage} RASTERIZEROPTION;

187 188 189 190 191 192 193 194
typedef struct _tagDUPLEX {
    char                        *Name;
    char                        *FullName;
    char                        *InvocationString;
    WORD                        WinDuplex; /* eg DMDUP_SIMPLEX */
    struct _tagDUPLEX           *next;
} DUPLEX;

195
/* Many Mac OS X based ppd files don't include a *ColorDevice line, so
196 197 198 199 200 201 202 203
   we use a tristate here rather than a boolean.  Code that
   cares is expected to treat these as if they were colour. */
typedef enum {
    CD_NotSpecified,
    CD_False,
    CD_True
} COLORDEVICE;

Alexandre Julliard's avatar
Alexandre Julliard committed
204 205 206
typedef struct {
    char		*NickName;
    int			LanguageLevel;
207
    COLORDEVICE	        ColorDevice;
Alexandre Julliard's avatar
Alexandre Julliard committed
208
    int			DefaultResolution;
Alexandre Julliard's avatar
Alexandre Julliard committed
209
    signed int		LandscapeOrientation;
Alexandre Julliard's avatar
Alexandre Julliard committed
210 211 212 213 214
    char		*JCLBegin;
    char		*JCLToPSInterpreter;
    char		*JCLEnd;
    char		*DefaultFont;
    FONTNAME		*InstalledFonts; /* ptr to a list of FontNames */
215
    struct list         PageSizes;
216
    PAGESIZE            *DefaultPageSize;
Alexandre Julliard's avatar
Alexandre Julliard committed
217 218 219
    OPTION		*InstalledOptions;
    CONSTRAINT		*Constraints;
    INPUTSLOT		*InputSlots;
220
    RASTERIZEROPTION    TTRasterizer;
221 222
    DUPLEX              *Duplexes;
    DUPLEX              *DefaultDuplex;
Alexandre Julliard's avatar
Alexandre Julliard committed
223 224 225
} PPD;

typedef struct {
226
    DEVMODEA			dmPublic;
Alexandre Julliard's avatar
Alexandre Julliard committed
227
    struct _tagdocprivate {
Patrik Stridvall's avatar
Patrik Stridvall committed
228
      int dummy;
Alexandre Julliard's avatar
Alexandre Julliard committed
229 230
    }				dmDocPrivate;
    struct _tagdrvprivate {
231
      UINT	numInstalledOptions; /* Options at end of struct */
Alexandre Julliard's avatar
Alexandre Julliard committed
232 233 234 235 236 237 238 239
    }				dmDrvPrivate;

/* Now comes:

numInstalledOptions of OPTIONs

*/

240
} PSDRV_DEVMODEA;
Alexandre Julliard's avatar
Alexandre Julliard committed
241

Alexandre Julliard's avatar
Alexandre Julliard committed
242
typedef struct _tagPI {
243 244 245 246 247 248 249
    char		    *FriendlyName;
    PPD			    *ppd;
    PSDRV_DEVMODEA	    *Devmode;
    FONTFAMILY		    *Fonts;
    PPRINTER_ENUM_VALUESA   FontSubTable;
    DWORD		    FontSubTableSize;
    struct _tagPI	    *next;
Alexandre Julliard's avatar
Alexandre Julliard committed
250
} PRINTERINFO;
Alexandre Julliard's avatar
Alexandre Julliard committed
251

Alexandre Julliard's avatar
Alexandre Julliard committed
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
typedef struct {
    float		r, g, b;
} PSRGB;

typedef struct {
    float		i;
} PSGRAY;


/* def's for PSCOLOR.type */
#define PSCOLOR_GRAY	0
#define PSCOLOR_RGB	1

typedef struct {
    int			type;
    union {
        PSRGB  rgb;
        PSGRAY gray;
    }                   value;
} PSCOLOR;

Alexandre Julliard's avatar
Alexandre Julliard committed
273
typedef struct {
274
    const AFM           *afm;
275
    float               scale;
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308
    TEXTMETRICW         tm;
} BUILTIN;

typedef struct tagTYPE42 TYPE42;

typedef struct tagTYPE1 TYPE1;

enum downloadtype {
  Type1, Type42
};

typedef struct _tagDOWNLOAD {
  enum downloadtype type;
  union {
    TYPE1  *Type1;
    TYPE42 *Type42;
  } typeinfo;
  char *ps_name;
  struct _tagDOWNLOAD *next;
} DOWNLOAD;

enum fontloc {
  Builtin, Download
};

typedef struct {
    enum fontloc        fontloc;
    union {
        BUILTIN  Builtin;
        DOWNLOAD *Download;
    }                   fontinfo;

    int                 size;
309 310
    PSCOLOR             color;
    BOOL                set;		/* Have we done a setfont yet */
311 312 313 314 315 316 317 318

  /* These are needed by PSDRV_ExtTextOut */
    int                 escapement;
    int                 underlineThickness;
    int                 underlinePosition;
    int                 strikeoutThickness;
    int                 strikeoutPosition;

Alexandre Julliard's avatar
Alexandre Julliard committed
319 320
} PSFONT;

Alexandre Julliard's avatar
Alexandre Julliard committed
321 322
typedef struct {
    PSCOLOR		color;
323
    BOOL		set;
Alexandre Julliard's avatar
Alexandre Julliard committed
324 325 326
} PSBRUSH;

typedef struct {
327
    INT                 style;
328 329 330
    INT                 width;
    BYTE                join;
    BYTE                endcap;
331
    const char*		dash;
Alexandre Julliard's avatar
Alexandre Julliard committed
332
    PSCOLOR		color;
333
    BOOL		set;
Alexandre Julliard's avatar
Alexandre Julliard committed
334 335
} PSPEN;

Alexandre Julliard's avatar
Alexandre Julliard committed
336
typedef struct {
337
    DWORD		id;             /* Job id */
Alexandre Julliard's avatar
Alexandre Julliard committed
338
    LPSTR		output;		/* Output file/port */
339
    LPSTR               DocName;        /* Document Name */
340 341 342
    BOOL		banding;        /* Have we received a NEXTBAND */
    BOOL		OutOfPage;      /* Page header not sent yet */
    INT			PageNo;
343
    BOOL                quiet;          /* Don't actually output anything */
344 345
    BOOL                in_passthrough; /* In PASSTHROUGH mode */
    BOOL                had_passthrough_rect; /* See the comment in PSDRV_Rectangle */
Alexandre Julliard's avatar
Alexandre Julliard committed
346 347
} JOB;

Alexandre Julliard's avatar
Alexandre Julliard committed
348
typedef struct {
349
    HDC                 hdc;
Alexandre Julliard's avatar
Alexandre Julliard committed
350
    PSFONT		font;		/* Current PS font */
351
    DOWNLOAD            *downloaded_fonts;
Alexandre Julliard's avatar
Alexandre Julliard committed
352 353 354 355
    PSPEN		pen;
    PSBRUSH		brush;
    PSCOLOR		bkColor;
    PSCOLOR		inkColor;	/* Last colour set */
Alexandre Julliard's avatar
Alexandre Julliard committed
356
    JOB			job;
357
    PSDRV_DEVMODEA	*Devmode;
Alexandre Julliard's avatar
Alexandre Julliard committed
358
    PRINTERINFO		*pi;
359 360 361 362 363 364
    SIZE                PageSize;      /* Physical page size in device units */
    RECT                ImageableArea; /* Imageable area in device units */
                                       /* NB both PageSize and ImageableArea
					  are not rotated in landscape mode,
					  so PageSize.cx is generally
					  < PageSize.cy */
365 366 367 368 369 370
    int                 horzRes;       /* device caps */
    int                 vertRes;
    int                 horzSize;
    int                 vertSize;
    int                 logPixelsX;
    int                 logPixelsY;
371 372

    int                 pathdepth;
Alexandre Julliard's avatar
Alexandre Julliard committed
373 374
} PSDRV_PDEVICE;

375 376 377 378
typedef struct {
    PRINTERINFO *pi;
    PSDRV_DEVMODEA *dlgdm;
} PSDRV_DLGINFO;
379

380 381 382 383

/*
 *  Every glyph name in the Adobe Glyph List and the 35 core PostScript fonts
 */
384

385 386 387 388 389 390 391
extern const INT    PSDRV_AGLGlyphNamesSize;
extern GLYPHNAME    PSDRV_AGLGlyphNames[];


/*
 *  The AGL encoding vector
 */
392

393 394 395 396 397 398
extern const INT    	    PSDRV_AGLbyNameSize;    /* sorted by name -     */
extern const UNICODEGLYPH   PSDRV_AGLbyName[];	    /*  duplicates omitted  */

extern const INT    	    PSDRV_AGLbyUVSize;	    /* sorted by UV -	    */
extern const UNICODEGLYPH   PSDRV_AGLbyUV[];	    /*  duplicates included */

399
extern HINSTANCE PSDRV_hInstance;
400
extern HANDLE PSDRV_Heap;
Alexandre Julliard's avatar
Alexandre Julliard committed
401
extern char *PSDRV_ANSIVector[256];
Alexandre Julliard's avatar
Alexandre Julliard committed
402

403
extern void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2,
Alexandre Julliard's avatar
Alexandre Julliard committed
404
			 PRINTERINFO *pi);
405
extern BOOL PSDRV_GetFontMetrics(void);
Alexandre Julliard's avatar
Alexandre Julliard committed
406 407
extern PPD *PSDRV_ParsePPD(char *fname);
extern PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name);
408
extern const AFM *PSDRV_FindAFMinList(FONTFAMILY *head, LPCSTR name);
409 410
extern BOOL PSDRV_AddAFMtoList(FONTFAMILY **head, const AFM *afm,
    	BOOL *p_added);
Alexandre Julliard's avatar
Alexandre Julliard committed
411
extern void PSDRV_FreeAFMList( FONTFAMILY *head );
Alexandre Julliard's avatar
Alexandre Julliard committed
412

413 414 415
extern INT PSDRV_XWStoDS( PSDRV_PDEVICE *physDev, INT width );
extern INT PSDRV_YWStoDS( PSDRV_PDEVICE *physDev, INT height );

416 417 418
extern BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO);
extern BOOL PSDRV_SetFont( PSDRV_PDEVICE *physDev );
extern BOOL PSDRV_SetPen( PSDRV_PDEVICE *physDev );
Alexandre Julliard's avatar
Alexandre Julliard committed
419

420 421 422
extern void PSDRV_SetClip(PSDRV_PDEVICE* phyDev);
extern void PSDRV_ResetClip(PSDRV_PDEVICE* phyDev);

423
extern BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2);
Alexandre Julliard's avatar
Alexandre Julliard committed
424 425
extern void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
		     COLORREF wincolor );
426
extern char PSDRV_UnicodeToANSI(int u);
Alexandre Julliard's avatar
Alexandre Julliard committed
427

428 429 430 431 432 433 434
extern INT PSDRV_WriteHeader( PSDRV_PDEVICE *physDev, LPCSTR title );
extern INT PSDRV_WriteFooter( PSDRV_PDEVICE *physDev );
extern INT PSDRV_WriteNewPage( PSDRV_PDEVICE *physDev );
extern INT PSDRV_WriteEndPage( PSDRV_PDEVICE *physDev );
extern BOOL PSDRV_WriteMoveTo(PSDRV_PDEVICE *physDev, INT x, INT y);
extern BOOL PSDRV_WriteLineTo(PSDRV_PDEVICE *physDev, INT x, INT y);
extern BOOL PSDRV_WriteStroke(PSDRV_PDEVICE *physDev);
435
extern BOOL PSDRV_WriteRectangle(PSDRV_PDEVICE *physDev, INT x, INT y, INT width,
436
			INT height);
437
extern BOOL PSDRV_WriteRRectangle(PSDRV_PDEVICE *physDev, INT x, INT y, INT width,
438
			INT height);
439 440 441
extern BOOL PSDRV_WriteSetFont(PSDRV_PDEVICE *physDev, const char *name, INT size,
                               INT escapement);
extern BOOL PSDRV_WriteGlyphShow(PSDRV_PDEVICE *physDev, LPCSTR g_name);
442 443
extern BOOL PSDRV_WriteSetPen(PSDRV_PDEVICE *physDev);
extern BOOL PSDRV_WriteArc(PSDRV_PDEVICE *physDev, INT x, INT y, INT w, INT h,
444
			     double ang1, double ang2);
445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461
extern BOOL PSDRV_WriteSetColor(PSDRV_PDEVICE *physDev, PSCOLOR *color);
extern BOOL PSDRV_WriteSetBrush(PSDRV_PDEVICE *physDev);
extern BOOL PSDRV_WriteFill(PSDRV_PDEVICE *physDev);
extern BOOL PSDRV_WriteEOFill(PSDRV_PDEVICE *physDev);
extern BOOL PSDRV_WriteGSave(PSDRV_PDEVICE *physDev);
extern BOOL PSDRV_WriteGRestore(PSDRV_PDEVICE *physDev);
extern BOOL PSDRV_WriteNewPath(PSDRV_PDEVICE *physDev);
extern BOOL PSDRV_WriteClosePath(PSDRV_PDEVICE *physDev);
extern BOOL PSDRV_WriteClip(PSDRV_PDEVICE *physDev);
extern BOOL PSDRV_WriteRectClip(PSDRV_PDEVICE *physDev, INT x, INT y, INT w, INT h);
extern BOOL PSDRV_WriteRectClip2(PSDRV_PDEVICE *physDev, CHAR *pszArrayName);
extern BOOL PSDRV_WriteEOClip(PSDRV_PDEVICE *physDev);
extern BOOL PSDRV_WriteHatch(PSDRV_PDEVICE *physDev);
extern BOOL PSDRV_WriteRotate(PSDRV_PDEVICE *physDev, float ang);
extern BOOL PSDRV_WriteIndexColorSpaceBegin(PSDRV_PDEVICE *physDev, int size);
extern BOOL PSDRV_WriteIndexColorSpaceEnd(PSDRV_PDEVICE *physDev);
extern BOOL PSDRV_WriteRGB(PSDRV_PDEVICE *physDev, COLORREF *map, int number);
462 463 464
extern BOOL PSDRV_WriteImage(PSDRV_PDEVICE *physDev, WORD depth, INT xDst, INT yDst,
			     INT widthDst, INT heightDst, INT widthSrc,
			     INT heightSrc, BOOL mask);
465 466
extern BOOL PSDRV_WriteBytes(PSDRV_PDEVICE *physDev, const BYTE *bytes, DWORD number);
extern BOOL PSDRV_WriteData(PSDRV_PDEVICE *physDev, const BYTE *byte, DWORD number);
467
extern DWORD PSDRV_WriteSpool(PSDRV_PDEVICE *physDev, LPCSTR lpData, DWORD cch);
468
extern BOOL PSDRV_WritePatternDict(PSDRV_PDEVICE *physDev, BITMAP *bm, BYTE *bits);
469
extern BOOL PSDRV_WriteDIBPatternDict(PSDRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usage);
470 471 472
extern BOOL PSDRV_WriteArrayPut(PSDRV_PDEVICE *physDev, CHAR *pszArrayName, INT nIndex, LONG lCoord);
extern BOOL PSDRV_WriteArrayDef(PSDRV_PDEVICE *physDev, CHAR *pszArrayName, INT nSize);

473 474
extern INT CDECL PSDRV_StartPage( PSDRV_PDEVICE *physDev );

475
INT PSDRV_GlyphListInit(void);
476
const GLYPHNAME *PSDRV_GlyphName(LPCSTR szName);
477 478 479
VOID PSDRV_IndexGlyphList(void);
BOOL PSDRV_GetTrueTypeMetrics(void);
BOOL PSDRV_GetType1Metrics(void);
480 481
const AFMMETRICS *PSDRV_UVMetrics(LONG UV, const AFM *afm);
SHORT PSDRV_CalcAvgCharWidth(const AFM *afm);
482

483 484 485 486 487 488 489 490 491
extern BOOL PSDRV_SelectBuiltinFont(PSDRV_PDEVICE *physDev, HFONT hfont,
				    LOGFONTW *plf, LPSTR FaceName);
extern BOOL PSDRV_WriteSetBuiltinFont(PSDRV_PDEVICE *physDev);
extern BOOL PSDRV_WriteBuiltinGlyphShow(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count);

extern BOOL PSDRV_SelectDownloadFont(PSDRV_PDEVICE *physDev);
extern BOOL PSDRV_WriteSetDownloadFont(PSDRV_PDEVICE *physDev);
extern BOOL PSDRV_WriteDownloadGlyphShow(PSDRV_PDEVICE *physDev, WORD *glpyhs,
					 UINT count);
492
extern BOOL PSDRV_EmptyDownloadList(PSDRV_PDEVICE *physDev, BOOL write_undef);
493 494

extern DWORD write_spool( PSDRV_PDEVICE *physDev, const void *data, DWORD num );
495 496 497 498

#define MAX_G_NAME 31 /* max length of PS glyph name */
extern void get_glyph_name(HDC hdc, WORD index, char *name);

499 500
extern TYPE1 *T1_download_header(PSDRV_PDEVICE *physDev, char *ps_name,
                                 RECT *bbox, UINT emsize);
501 502 503 504
extern BOOL T1_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl,
			      DWORD index, char *glyph_name);
extern void T1_free(TYPE1 *t1);

505 506
extern TYPE42 *T42_download_header(PSDRV_PDEVICE *physDev, char *ps_name,
                                   RECT *bbox, UINT emsize);
507 508 509
extern BOOL T42_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl,
			       DWORD index, char *glyph_name);
extern void T42_free(TYPE42 *t42);
510 511 512 513

extern DWORD RLE_encode(BYTE *in_buf, DWORD len, BYTE *out_buf);
extern DWORD ASCII85_encode(BYTE *in_buf, DWORD len, BYTE *out_buf);

514 515 516 517 518 519 520 521 522
#define push_lc_numeric(x) do {					\
	const char *tmplocale = setlocale(LC_NUMERIC,NULL);	\
	setlocale(LC_NUMERIC,x);

#define pop_lc_numeric()					\
	setlocale(LC_NUMERIC,tmplocale);			\
} while (0)


523
#endif