X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ffont.h;h=24d8ed2bb93103027795c838a3b800ad1668b5c0;hb=8b9888ed8247109dc3c09492302e865fa4731460;hp=cb18e4798b6e7b29ef1863ddc8216a6c759431e1;hpb=c6871fe8617b3de03662b7630355059393bf8043;p=dcpomatic.git diff --git a/src/lib/font.h b/src/lib/font.h index cb18e4798..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,16 +18,22 @@ */ + #ifndef DCPOMATIC_FONT_H #define DCPOMATIC_FONT_H -#include "font_files.h" + +#include #include #include #include #include #include + +namespace dcpomatic { + + class Font { public: @@ -36,39 +42,53 @@ 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; } - boost::optional file (FontFiles::Variant variant) const { - return _files.get (variant); + void set_id (std::string id) { + _id = id; } - void set_file (FontFiles::Variant variant, boost::filesystem::path file) { - _files.set (variant, file); - Changed (); - } - - FontFiles files () const { - return _files; + boost::optional file () const { + return _file; } - void set_files (FontFiles files) { - _files = files; + void set_file (boost::filesystem::path file) { + _file = file; 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; - FontFiles _files; + boost::optional _data; + boost::optional _file; }; + bool operator!= (Font const & a, Font const & b); bool operator== (Font const & a, Font const & b); + +} + #endif