Font (std::string id, boost::filesystem::path file)
: _id (id)
- , _file (file)
- {}
+ {
+ _content.file = file;
+ }
Font (std::string id, dcp::ArrayData data)
: _id (id)
- , _data (data)
- {}
+ {
+ _content.data = data;
+ }
+
+ Font(Font const& other);
+ Font& operator=(Font const& other);
void as_xml (xmlpp::Node* node);
}
boost::optional<boost::filesystem::path> file () const {
- return _file;
+ return _content.file;
}
void set_file (boost::filesystem::path file) {
- _file = file;
+ _content.file = file;
Changed ();
}
*/
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 family name or an ID from some DCP font XML.
*/
std::string _id;
- boost::optional<dcp::ArrayData> _data;
- boost::optional<boost::filesystem::path> _file;
+ Content _content;
};