beta-0.89.2
[luatex.git] / source / libs / poppler / poppler-src / splash / SplashFontFile.h
blobec87504b9bc593d602b68828f92d28154e8f73e4
1 //========================================================================
2 //
3 // SplashFontFile.h
4 //
5 //========================================================================
7 //========================================================================
8 //
9 // Modified under the Poppler project - http://poppler.freedesktop.org
11 // All changes made under the Poppler project to this file are licensed
12 // under GPL version 2 or later
14 // Copyright (C) 2006 Takashi Iwai <tiwai@suse.de>
15 // Copyright (C) 2008, 2010 Albert Astals Cid <aacid@kde.org>
17 // To see a description of the changes please see the Changelog file that
18 // came with your tarball or type make ChangeLog if you are building from git
20 //========================================================================
22 #ifndef SPLASHFONTFILE_H
23 #define SPLASHFONTFILE_H
25 #ifdef USE_GCC_PRAGMAS
26 #pragma interface
27 #endif
29 #include "goo/gtypes.h"
30 #include "SplashTypes.h"
32 class GooString;
33 class SplashFontEngine;
34 class SplashFont;
35 class SplashFontFileID;
37 //------------------------------------------------------------------------
38 // SplashFontFile
39 //------------------------------------------------------------------------
41 class SplashFontSrc {
42 public:
43 SplashFontSrc();
45 void setFile(GooString *file, GBool del);
46 void setFile(const char *file, GBool del);
47 void setBuf(char *bufA, int buflenA, GBool del);
49 void ref();
50 void unref();
52 GBool isFile;
53 GooString *fileName;
54 char *buf;
55 int bufLen;
57 private:
58 ~SplashFontSrc();
59 int refcnt;
60 GBool deleteSrc;
63 class SplashFontFile {
64 public:
66 virtual ~SplashFontFile();
68 // Create a new SplashFont, i.e., a scaled instance of this font
69 // file.
70 virtual SplashFont *makeFont(SplashCoord *mat, SplashCoord *textMat) = 0;
72 // Get the font file ID.
73 SplashFontFileID *getID() { return id; }
75 // Increment the reference count.
76 void incRefCnt();
78 // Decrement the reference count. If the new value is zero, delete
79 // the SplashFontFile object.
80 void decRefCnt();
82 GBool doAdjustMatrix;
84 protected:
86 SplashFontFile(SplashFontFileID *idA, SplashFontSrc *srcA);
88 SplashFontFileID *id;
89 SplashFontSrc *src;
90 int refCnt;
92 friend class SplashFontEngine;
95 #endif