1 //========================================================================
5 //========================================================================
11 #ifdef USE_GCC_PRAGMAS
12 #pragma implementation
18 #include "SplashT1FontEngine.h"
19 #include "SplashT1Font.h"
20 #include "SplashT1FontFile.h"
22 //------------------------------------------------------------------------
24 //------------------------------------------------------------------------
26 SplashFontFile *SplashT1FontFile::loadType1Font(SplashT1FontEngine *engineA,
27 SplashFontFileID *idA,
39 if ((t1libIDA = T1_AddFont(fileNameA)) < 0) {
42 T1_LoadFont(t1libIDA);
46 for (i = 0; i < 256; ++i) {
48 encStrSize += strlen(encA[i]) + 1;
51 encTmp = (char **)gmalloc(257 * sizeof(char *));
52 encStrTmp = (char *)gmalloc(encStrSize * sizeof(char));
54 for (i = 0; i < 256; ++i) {
56 strcpy(encPtr, encA[i]);
58 encPtr += strlen(encPtr) + 1;
60 encTmp[i] = ".notdef";
63 encTmp[256] = "custom";
64 T1_ReencodeFont(t1libIDA, encTmp);
66 return new SplashT1FontFile(engineA, idA, fileNameA, deleteFileA,
67 t1libIDA, encTmp, encStrTmp);
70 SplashT1FontFile::SplashT1FontFile(SplashT1FontEngine *engineA,
71 SplashFontFileID *idA,
72 char *fileNameA, GBool deleteFileA,
73 int t1libIDA, char **encA, char *encStrA):
74 SplashFontFile(idA, fileNameA, deleteFileA)
82 SplashT1FontFile::~SplashT1FontFile() {
85 T1_DeleteFont(t1libID);
88 SplashFont *SplashT1FontFile::makeFont(SplashCoord *mat) {
91 font = new SplashT1Font(this, mat);
96 #endif // HAVE_T1LIB_H