SplashOutFontFileID *id;
SplashFontFile *fontFile;
SplashFontSrc *fontsrc = NULL;
+ const char *fontName = "(unnamed)";
FoFiTrueType *ff;
Ref embRef;
Object refObj, strObj;
delete id;
} else {
+ if (gfxFont->getName()) {
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR <= 71
+ fontName = gfxFont->getName()->getCString();
+#else
+ fontName = gfxFont->getName()->c_str();
+#endif
+ }
// if there is an embedded font, write it to disk
if (gfxFont->getEmbeddedFontID(&embRef)) {
fileName = globalParams->findSystemFontFile(gfxFont,&sftype,
&faceIndex, NULL);
if (fileName == 0) {
- opvpError(-1, "Couldn't find a font for '%s'",
- gfxFont->getName() ? gfxFont->getName()->getCString()
- : "(unnamed)");
+ opvpError(-1, "Couldn't find a font for '%s'", fontName);
goto err2;
}
switch (sftype) {
fontsrc,
(const char **)
((Gfx8BitFont *)gfxFont)->getEncoding()))) {
- opvpError(-1, "Couldn't create a font for '%s'",
- gfxFont->getName() ? gfxFont->getName()->getCString()
- : "(unnamed)");
+ opvpError(-1, "Couldn't create a font for '%s'", fontName);
goto err2;
}
break;
fontsrc,
(const char **)
((Gfx8BitFont *)gfxFont)->getEncoding()))) {
- opvpError(-1, "Couldn't create a font for '%s'",
- gfxFont->getName() ? gfxFont->getName()->getCString()
- : "(unnamed)");
+ opvpError(-1, "Couldn't create a font for '%s'", fontName);
goto err2;
}
break;
fontsrc,
(const char **)
((Gfx8BitFont *)gfxFont)->getEncoding()))) {
- opvpError(-1, "Couldn't create a font for '%s'",
- gfxFont->getName() ? gfxFont->getName()->getCString()
- : "(unnamed)");
+ opvpError(-1, "Couldn't create a font for '%s'", fontName);
goto err2;
}
break;
case fontTrueTypeOT:
case fontTrueType:
if (fileName)
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR <= 71
ff = FoFiTrueType::load(fileName->getCString());
+#else
+ ff = FoFiTrueType::load(fileName->c_str());
+#endif
else
ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
if (ff) {
id,
fontsrc,
codeToGID, n))) {
- opvpError(-1, "Couldn't create a font for '%s'",
- gfxFont->getName() ? gfxFont->getName()->getCString()
- : "(unnamed)");
+ opvpError(-1, "Couldn't create a font for '%s'", fontName);
goto err2;
}
break;
if (!(fontFile = fontEngine->loadCIDFont(
id,
fontsrc))) {
- opvpError(-1, "Couldn't create a font for '%s'",
- gfxFont->getName() ? gfxFont->getName()->getCString()
- : "(unnamed)");
+ opvpError(-1, "Couldn't create a font for '%s'", fontName);
goto err2;
}
break;
if (!(fontFile = fontEngine->loadOpenTypeCFFFont(
id,
fontsrc,codeToGID,n))) {
- opvpError(-1, "Couldn't create a font for '%s'",
- gfxFont->getName() ? gfxFont->getName()->getCString()
- : "(unnamed)");
+ opvpError(-1, "Couldn't create a font for '%s'", fontName);
goto err2;
}
break;
}
} else {
if (fileName)
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR <= 71
ff = FoFiTrueType::load(fileName->getCString());
+#else
+ ff = FoFiTrueType::load(fileName->c_str());
+#endif
else
ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
if (! ff)
id,
fontsrc,
codeToGID, n, faceIndex))) {
- opvpError(-1, "Couldn't create a font for '%s'",
- gfxFont->getName() ? gfxFont->getName()->getCString()
- : "(unnamed)");
+ opvpError(-1, "Couldn't create a font for '%s'", fontName);
goto err2;
}
break;
if (choices != 0) free(choices);
}
+#if POPPLER_VERSION_MAJOR == 0 && POPPLER_VERSION_MINOR <= 71
strncpy(jobInfo,jobInfoStr.getCString(),sizeof(jobInfo)-1);
jobInfo[sizeof(jobInfo)-1] = '\0';
strncpy(docInfo,docInfoStr.getCString(),sizeof(docInfo)-1);
docInfo[sizeof(docInfo)-1] = '\0';
strncpy(pageInfo,pageInfoStr.getCString(),sizeof(pageInfo)-1);
pageInfo[sizeof(pageInfo)-1] = '\0';
+#else
+ strncpy(jobInfo,jobInfoStr.c_str(),sizeof(jobInfo)-1);
+ jobInfo[sizeof(jobInfo)-1] = '\0';
+ strncpy(docInfo,docInfoStr.c_str(),sizeof(docInfo)-1);
+ docInfo[sizeof(docInfo)-1] = '\0';
+ strncpy(pageInfo,pageInfoStr.c_str(),sizeof(pageInfo)-1);
+ pageInfo[sizeof(pageInfo)-1] = '\0';
+#endif
colorProfile = getColorProfilePath(ppd,&colorProfilePath);
name.append("/tmp");
}
name.append("/XXXXXX");
+#if POPPLER_VERSION_MAJOR == 0 && POPPLER_VERSION_MINOR <= 71
fd = mkstemp(name.getCString());
+#else
+ std::string t = name.toStr();
+ fd = mkstemp(&t[0]);
+ name = GooString(std::move(t));
+#endif
if (fd < 0) {
opvpError(-1,"Can't create temporary file");
exitCode = 2;
close(fd);
doc = new PDFDoc(&name);
/* remove name */
+#if POPPLER_VERSION_MAJOR == 0 && POPPLER_VERSION_MINOR <= 71
unlink(name.getCString());
+#else
+ unlink(name.c_str());
+#endif
} else {
/* no jcl check */
doc = new PDFDoc(fileName.copy());