+
+ std::string id () const {
+ return _id;
+ }
+
+ void set_id (std::string id) {
+ _id = id;
+ }
+
+ boost::optional<boost::filesystem::path> file () const {
+ return _content.file;
+ }
+
+ void set_file (boost::filesystem::path file) {
+ _content.file = file;
+ Changed ();
+ }
+
+ /** @return the data set passed to the dcp::ArrayData constructor,
+ * otherwise the contents of _file, otherwise boost::none.
+ */
+ boost::optional<dcp::ArrayData> data() const;
+
+ /** The actual TTF/OTF font data, as either a filename or the raw data itself */
+ struct Content
+ {
+ boost::optional<dcp::ArrayData> data;
+ boost::optional<boost::filesystem::path> file;
+ };
+
+ Content content() const {
+ return _content;
+ }
+
+ boost::signals2::signal<void()> Changed;
+
+private:
+ /** Font ID, used to describe it in the subtitle content; could be either a
+ * font family name or an ID from some DCP font XML.
+ */
+ std::string _id;
+ Content _content;