Rearrange subtitle font management.
[dcpomatic.git] / src / lib / font.h
index ed3ecc38f3075498d2051545a38df5ab4c2382fb..c1405d0f61c81d1695c95bca5d72009f87f63e43 100644 (file)
@@ -23,6 +23,7 @@
 #define DCPOMATIC_FONT_H
 
 
+#include <dcp/array_data.h>
 #include <libcxml/cxml.h>
 #include <boost/optional.hpp>
 #include <boost/signals2.hpp>
@@ -41,12 +42,21 @@ public:
 
        explicit Font (cxml::NodePtr node);
 
+       Font (std::string id, boost::filesystem::path file)
+               : _id (id)
+               , _file (file)
+       {}
+
        void as_xml (xmlpp::Node* node);
 
        std::string id () const {
                return _id;
        }
 
+       void set_id (std::string id) {
+               _id = id;
+       }
+
        boost::optional<boost::filesystem::path> file () const {
                return _file;
        }
@@ -56,11 +66,16 @@ public:
                Changed ();
        }
 
+       boost::optional<dcp::ArrayData> data() const;
+
        boost::signals2::signal<void()> Changed;
 
 private:
-       /** Font ID, used to describe it in the subtitle content */
+       /** 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;
+       boost::optional<dcp::ArrayData> _data;
        boost::optional<boost::filesystem::path> _file;
 };