]>
git.ipfire.org Git - thirdparty/cups.git/blob - pdftops/FontFile.h
1 //========================================================================
5 // Copyright 1999 Derek B. Noonburg
7 //========================================================================
19 #include "FontEncoding.h"
21 //------------------------------------------------------------------------
23 //------------------------------------------------------------------------
31 // Returns the font name, as specified internally by the font file.
32 // Returns NULL if no name is available.
33 virtual const char *getName() = 0;
35 // Returns the custom font encoding, or NULL if the encoding is
36 // not available. If <taken> is set, the caller of this function
37 // will be responsible for freeing the encoding object.
38 virtual FontEncoding
*getEncoding(GBool taken
) = 0;
41 //------------------------------------------------------------------------
43 //------------------------------------------------------------------------
45 class Type1FontFile
: public FontFile
{
48 Type1FontFile(const char *file
, int len
);
49 virtual ~Type1FontFile();
50 virtual const char *getName() { return name
; }
51 virtual FontEncoding
*getEncoding(GBool taken
);
56 FontEncoding
*encoding
;
60 //------------------------------------------------------------------------
62 //------------------------------------------------------------------------
64 class Type1CFontFile
: public FontFile
{
67 Type1CFontFile(const char *file
, int len
);
68 virtual ~Type1CFontFile();
69 virtual const char *getName() { return name
; }
70 virtual FontEncoding
*getEncoding(GBool taken
);
75 FontEncoding
*encoding
;
79 //------------------------------------------------------------------------
80 // Type1CFontConverter
81 //------------------------------------------------------------------------
83 class Type1CFontConverter
{
86 Type1CFontConverter(const char *file
, int len
, FILE *out
);
87 ~Type1CFontConverter();
92 void eexecWrite(const char *s
);
93 void cvtGlyph(const char *name
, Guchar
*s
, int n
);
94 void cvtGlyphWidth(GBool useOp
);
95 void eexecDumpNum(double x
, GBool fp
);
96 void eexecDumpOp1(int op
);
97 void eexecDumpOp2(int op
);
98 void eexecWriteCharstring(Guchar
*s
, int n
);
99 void getDeltaInt(char *buf
, const char *name
, double *op
, int n
);
100 void getDeltaReal(char *buf
, const char *name
, double *op
, int n
);
105 double op
[48]; // operands
106 GBool fp
[48]; // true if operand is fixed point
107 int nOps
; // number of operands
108 double defaultWidthX
; // default glyph width
109 double nominalWidthX
; // nominal glyph width
110 GBool defaultWidthXFP
; // true if defaultWidthX is fixed point
111 GBool nominalWidthXFP
; // true if nominalWidthX is fixed point
112 Gushort r1
; // eexec encryption key
113 GString
*charBuf
; // charstring output buffer
114 int line
; // number of eexec chars on current line