Lines 105-123
Link Here
|
105 |
} |
105 |
} |
106 |
|
106 |
|
107 |
SplashFontFile *SplashFontEngine::loadType1Font(SplashFontFileID *idA, |
107 |
SplashFontFile *SplashFontEngine::loadType1Font(SplashFontFileID *idA, |
108 |
char *fileName, |
108 |
SplashFontSrc *src, char **enc) { |
109 |
GBool deleteFile, char **enc) { |
|
|
110 |
SplashFontFile *fontFile; |
109 |
SplashFontFile *fontFile; |
111 |
|
110 |
|
112 |
fontFile = NULL; |
111 |
fontFile = NULL; |
113 |
#if HAVE_T1LIB_H |
112 |
#if HAVE_T1LIB_H |
114 |
if (!fontFile && t1Engine) { |
113 |
if (!fontFile && t1Engine) { |
115 |
fontFile = t1Engine->loadType1Font(idA, fileName, deleteFile, enc); |
114 |
fontFile = t1Engine->loadType1Font(idA, src, enc); |
116 |
} |
115 |
} |
117 |
#endif |
116 |
#endif |
118 |
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H |
117 |
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H |
119 |
if (!fontFile && ftEngine) { |
118 |
if (!fontFile && ftEngine) { |
120 |
fontFile = ftEngine->loadType1Font(idA, fileName, deleteFile, enc); |
119 |
fontFile = ftEngine->loadType1Font(idA, src, enc); |
121 |
} |
120 |
} |
122 |
#endif |
121 |
#endif |
123 |
|
122 |
|
Lines 125-152
Link Here
|
125 |
// semantics, this will remove the last link; otherwise it will |
124 |
// semantics, this will remove the last link; otherwise it will |
126 |
// return an error, leaving the file to be deleted later (if |
125 |
// return an error, leaving the file to be deleted later (if |
127 |
// loadXYZFont failed, the file will always be deleted) |
126 |
// loadXYZFont failed, the file will always be deleted) |
128 |
if (deleteFile) { |
127 |
src->unref(); |
129 |
unlink(fontFile ? fontFile->fileName->getCString() : fileName); |
|
|
130 |
} |
131 |
|
128 |
|
132 |
return fontFile; |
129 |
return fontFile; |
133 |
} |
130 |
} |
134 |
|
131 |
|
135 |
SplashFontFile *SplashFontEngine::loadType1CFont(SplashFontFileID *idA, |
132 |
SplashFontFile *SplashFontEngine::loadType1CFont(SplashFontFileID *idA, |
136 |
char *fileName, |
133 |
SplashFontSrc *src, |
137 |
GBool deleteFile, |
|
|
138 |
char **enc) { |
134 |
char **enc) { |
139 |
SplashFontFile *fontFile; |
135 |
SplashFontFile *fontFile; |
140 |
|
136 |
|
141 |
fontFile = NULL; |
137 |
fontFile = NULL; |
142 |
#if HAVE_T1LIB_H |
138 |
#if HAVE_T1LIB_H |
143 |
if (!fontFile && t1Engine) { |
139 |
if (!fontFile && t1Engine) { |
144 |
fontFile = t1Engine->loadType1CFont(idA, fileName, deleteFile, enc); |
140 |
fontFile = t1Engine->loadType1CFont(idA, src, enc); |
145 |
} |
141 |
} |
146 |
#endif |
142 |
#endif |
147 |
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H |
143 |
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H |
148 |
if (!fontFile && ftEngine) { |
144 |
if (!fontFile && ftEngine) { |
149 |
fontFile = ftEngine->loadType1CFont(idA, fileName, deleteFile, enc); |
145 |
fontFile = ftEngine->loadType1CFont(idA, src, enc); |
150 |
} |
146 |
} |
151 |
#endif |
147 |
#endif |
152 |
|
148 |
|
Lines 154-175
Link Here
|
154 |
// semantics, this will remove the last link; otherwise it will |
150 |
// semantics, this will remove the last link; otherwise it will |
155 |
// return an error, leaving the file to be deleted later (if |
151 |
// return an error, leaving the file to be deleted later (if |
156 |
// loadXYZFont failed, the file will always be deleted) |
152 |
// loadXYZFont failed, the file will always be deleted) |
157 |
if (deleteFile) { |
153 |
src->unref(); |
158 |
unlink(fontFile ? fontFile->fileName->getCString() : fileName); |
|
|
159 |
} |
160 |
|
154 |
|
161 |
return fontFile; |
155 |
return fontFile; |
162 |
} |
156 |
} |
163 |
|
157 |
|
164 |
SplashFontFile *SplashFontEngine::loadCIDFont(SplashFontFileID *idA, |
158 |
SplashFontFile *SplashFontEngine::loadCIDFont(SplashFontFileID *idA, |
165 |
char *fileName, |
159 |
SplashFontSrc *src) { |
166 |
GBool deleteFile) { |
|
|
167 |
SplashFontFile *fontFile; |
160 |
SplashFontFile *fontFile; |
168 |
|
161 |
|
169 |
fontFile = NULL; |
162 |
fontFile = NULL; |
170 |
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H |
163 |
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H |
171 |
if (!fontFile && ftEngine) { |
164 |
if (!fontFile && ftEngine) { |
172 |
fontFile = ftEngine->loadCIDFont(idA, fileName, deleteFile); |
165 |
fontFile = ftEngine->loadCIDFont(idA, src); |
173 |
} |
166 |
} |
174 |
#endif |
167 |
#endif |
175 |
|
168 |
|
Lines 177-192
Link Here
|
177 |
// semantics, this will remove the last link; otherwise it will |
170 |
// semantics, this will remove the last link; otherwise it will |
178 |
// return an error, leaving the file to be deleted later (if |
171 |
// return an error, leaving the file to be deleted later (if |
179 |
// loadXYZFont failed, the file will always be deleted) |
172 |
// loadXYZFont failed, the file will always be deleted) |
180 |
if (deleteFile) { |
173 |
src->unref(); |
181 |
unlink(fontFile ? fontFile->fileName->getCString() : fileName); |
|
|
182 |
} |
183 |
|
174 |
|
184 |
return fontFile; |
175 |
return fontFile; |
185 |
} |
176 |
} |
186 |
|
177 |
|
187 |
SplashFontFile *SplashFontEngine::loadTrueTypeFont(SplashFontFileID *idA, |
178 |
SplashFontFile *SplashFontEngine::loadTrueTypeFont(SplashFontFileID *idA, |
188 |
char *fileName, |
179 |
SplashFontSrc *src, |
189 |
GBool deleteFile, |
|
|
190 |
Gushort *codeToGID, |
180 |
Gushort *codeToGID, |
191 |
int codeToGIDLen) { |
181 |
int codeToGIDLen) { |
192 |
SplashFontFile *fontFile; |
182 |
SplashFontFile *fontFile; |
Lines 194-200
Link Here
|
194 |
fontFile = NULL; |
184 |
fontFile = NULL; |
195 |
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H |
185 |
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H |
196 |
if (!fontFile && ftEngine) { |
186 |
if (!fontFile && ftEngine) { |
197 |
fontFile = ftEngine->loadTrueTypeFont(idA, fileName, deleteFile, |
187 |
fontFile = ftEngine->loadTrueTypeFont(idA, src, |
198 |
codeToGID, codeToGIDLen); |
188 |
codeToGID, codeToGIDLen); |
199 |
} |
189 |
} |
200 |
#endif |
190 |
#endif |
Lines 207-215
Link Here
|
207 |
// semantics, this will remove the last link; otherwise it will |
197 |
// semantics, this will remove the last link; otherwise it will |
208 |
// return an error, leaving the file to be deleted later (if |
198 |
// return an error, leaving the file to be deleted later (if |
209 |
// loadXYZFont failed, the file will always be deleted) |
199 |
// loadXYZFont failed, the file will always be deleted) |
210 |
if (deleteFile) { |
200 |
src->unref(); |
211 |
unlink(fontFile ? fontFile->fileName->getCString() : fileName); |
|
|
212 |
} |
213 |
|
201 |
|
214 |
return fontFile; |
202 |
return fontFile; |
215 |
} |
203 |
} |