summaryrefslogtreecommitdiff
path: root/poppler/GfxFont.h
diff options
context:
space:
mode:
Diffstat (limited to 'poppler/GfxFont.h')
-rw-r--r--poppler/GfxFont.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/poppler/GfxFont.h b/poppler/GfxFont.h
index 0510acb1..e8cb4e3d 100644
--- a/poppler/GfxFont.h
+++ b/poppler/GfxFont.h
@@ -34,6 +34,8 @@
#ifndef GFXFONT_H
#define GFXFONT_H
+#include <optional>
+
#include "goo/GooString.h"
#include "Object.h"
#include "CharTypes.h"
@@ -119,7 +121,9 @@ public:
~GfxFontLoc();
GfxFontLoc(const GfxFontLoc &) = delete;
+ GfxFontLoc(GfxFontLoc &&) noexcept;
GfxFontLoc &operator=(const GfxFontLoc &) = delete;
+ GfxFontLoc &operator=(GfxFontLoc &&other) noexcept;
// Set the 'path' string from a GooString on the heap.
// Ownership of the object is taken.
@@ -272,11 +276,11 @@ public:
virtual int getWMode() { return 0; }
// Locate the font file for this font. If <ps> is not null, includes PS
- // printer-resident fonts. Returns NULL on failure.
- GfxFontLoc *locateFont(XRef *xref, PSOutputDev *ps);
+ // printer-resident fonts. Returns std::optional without a value on failure.
+ std::optional<GfxFontLoc> locateFont(XRef *xref, PSOutputDev *ps);
// Locate a Base-14 font file for a specified font name.
- static GfxFontLoc *locateBase14Font(const GooString *base14Name);
+ static std::optional<GfxFontLoc> locateBase14Font(const GooString *base14Name);
// Read an external or embedded font file into a buffer.
char *readEmbFontFile(XRef *xref, int *len);
@@ -308,7 +312,7 @@ protected:
static GfxFontType getFontType(XRef *xref, Dict *fontDict, Ref *embID);
void readFontDescriptor(XRef *xref, Dict *fontDict);
CharCodeToUnicode *readToUnicodeCMap(Dict *fontDict, int nBits, CharCodeToUnicode *ctu);
- static GfxFontLoc *getExternalFont(GooString *path, bool cid);
+ static std::optional<GfxFontLoc> getExternalFont(GooString *path, bool cid);
const std::string tag; // PDF font tag
const Ref id; // reference (used as unique ID)