]>
git.ipfire.org Git - thirdparty/cups.git/blob - pdftops/SplashFTFontFile.cxx
1 //========================================================================
5 //========================================================================
9 #if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
11 #ifdef USE_GCC_PRAGMAS
12 #pragma implementation
16 #include "SplashFTFontEngine.h"
17 #include "SplashFTFont.h"
18 #include "SplashFTFontFile.h"
20 //------------------------------------------------------------------------
22 //------------------------------------------------------------------------
24 SplashFontFile
*SplashFTFontFile::loadType1Font(SplashFTFontEngine
*engineA
,
25 SplashFontFileID
*idA
,
34 if (FT_New_Face(engineA
->lib
, fileNameA
, 0, &faceA
)) {
37 codeToGIDA
= (Gushort
*)gmallocn(256, sizeof(int));
38 for (i
= 0; i
< 256; ++i
) {
40 if ((name
= encA
[i
])) {
41 codeToGIDA
[i
] = (Gushort
)FT_Get_Name_Index(faceA
, name
);
45 return new SplashFTFontFile(engineA
, idA
, fileNameA
, deleteFileA
,
46 faceA
, codeToGIDA
, 256);
49 SplashFontFile
*SplashFTFontFile::loadCIDFont(SplashFTFontEngine
*engineA
,
50 SplashFontFileID
*idA
,
57 if (FT_New_Face(engineA
->lib
, fileNameA
, 0, &faceA
)) {
61 return new SplashFTFontFile(engineA
, idA
, fileNameA
, deleteFileA
,
62 faceA
, codeToGIDA
, codeToGIDLenA
);
65 SplashFontFile
*SplashFTFontFile::loadTrueTypeFont(SplashFTFontEngine
*engineA
,
66 SplashFontFileID
*idA
,
73 if (FT_New_Face(engineA
->lib
, fileNameA
, 0, &faceA
)) {
77 return new SplashFTFontFile(engineA
, idA
, fileNameA
, deleteFileA
,
78 faceA
, codeToGIDA
, codeToGIDLenA
);
81 SplashFTFontFile::SplashFTFontFile(SplashFTFontEngine
*engineA
,
82 SplashFontFileID
*idA
,
83 char *fileNameA
, GBool deleteFileA
,
85 Gushort
*codeToGIDA
, int codeToGIDLenA
):
86 SplashFontFile(idA
, fileNameA
, deleteFileA
)
90 codeToGID
= codeToGIDA
;
91 codeToGIDLen
= codeToGIDLenA
;
94 SplashFTFontFile::~SplashFTFontFile() {
103 SplashFont
*SplashFTFontFile::makeFont(SplashCoord
*mat
) {
106 font
= new SplashFTFont(this, mat
);
111 #endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H