Cleanup: make a temporary for the content list.
[dcpomatic.git] / src / lib / font.cc
index a2dc1945f009a8facb973bd5eec19d51f256e373..375427d93f71d57897da277f392b668dfce4f6d9 100644 (file)
 
 #include "dcpomatic_assert.h"
 #include "font.h"
-#include "warnings.h"
-DCPOMATIC_DISABLE_WARNINGS
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
 
 
 using std::string;
+using boost::optional;
 using namespace dcpomatic;
 
 
@@ -69,3 +70,19 @@ dcpomatic::operator!= (Font const & a, Font const & b)
 {
        return !(a == b);
 }
+
+
+optional<dcp::ArrayData>
+Font::data () const
+{
+       if (_data) {
+               return _data;
+       }
+
+       if (_file) {
+               return dcp::ArrayData(*_file);
+       }
+
+       return {};
+}
+