X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ffont.h;h=24d8ed2bb93103027795c838a3b800ad1668b5c0;hb=67fa57cc3b626fd111582f4954fd848981c792d9;hp=5876bf8a46052cbbbd75ad2adb941a581b2c7029;hpb=f41818f14369f170475b7f2bde1a2dd856517b14;p=dcpomatic.git diff --git a/src/lib/font.h b/src/lib/font.h index 5876bf8a4..24d8ed2bb 100644 --- a/src/lib/font.h +++ b/src/lib/font.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2015 Carl Hetherington + Copyright (C) 2014-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,17 +18,22 @@ */ + #ifndef DCPOMATIC_FONT_H #define DCPOMATIC_FONT_H + +#include #include #include #include #include #include + namespace dcpomatic { + class Font { public: @@ -37,12 +42,26 @@ public: explicit Font (cxml::NodePtr node); + Font (std::string id, boost::filesystem::path file) + : _id (id) + , _file (file) + {} + + Font (std::string id, dcp::ArrayData data) + : _id (id) + , _data (data) + {} + void as_xml (xmlpp::Node* node); std::string id () const { return _id; } + void set_id (std::string id) { + _id = id; + } + boost::optional file () const { return _file; } @@ -52,17 +71,24 @@ public: Changed (); } + boost::optional data() const; + boost::signals2::signal 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 _data; boost::optional _file; }; + bool operator!= (Font const & a, Font const & b); bool operator== (Font const & a, Font const & b); + } #endif