X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ffont.h;h=24d8ed2bb93103027795c838a3b800ad1668b5c0;hb=203ae58ace6f8ff2acddb15f299d0f6dc82ff7f8;hp=b2ae86daff328d208a1e5c59d4f6b2ae83fe4b2f;hpb=f77ec143719c86ddbf098bff6d19fe2a159b8c3e;p=dcpomatic.git diff --git a/src/lib/font.h b/src/lib/font.h index b2ae86daf..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,15 +18,22 @@ */ + #ifndef DCPOMATIC_FONT_H #define DCPOMATIC_FONT_H + +#include #include #include #include #include #include + +namespace dcpomatic { + + class Font { public: @@ -35,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; } @@ -50,15 +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