X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ffont.h;h=12a14aba4e74086dee82c93d3a6464dd6159dee7;hb=8eedbed6e1f5b59e9714d7f857f486d8cf5f9434;hp=55c4249cc9b07361b38b5a7b29c03523ceb85aed;hpb=bb2924236bc100d6f98b7778bae31aeee48637fa;p=dcpomatic.git diff --git a/src/lib/font.h b/src/lib/font.h index 55c4249cc..12a14aba4 100644 --- a/src/lib/font.h +++ b/src/lib/font.h @@ -44,13 +44,18 @@ public: 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); @@ -63,11 +68,11 @@ public: } boost::optional file () const { - return _file; + return _content.file; } void set_file (boost::filesystem::path file) { - _file = file; + _content.file = file; Changed (); } @@ -76,6 +81,17 @@ public: */ boost::optional data() const; + /** The actual TTF/OTF font data, as either a filename or the raw data itself */ + struct Content + { + boost::optional data; + boost::optional file; + }; + + Content content() const { + return _content; + } + boost::signals2::signal Changed; private: @@ -83,8 +99,7 @@ private: * font family name or an ID from some DCP font XML. */ std::string _id; - boost::optional _data; - boost::optional _file; + Content _content; };