X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ffont.h;h=c165fea9fedcb30b7c5083f5c36725d99e7c5647;hb=cc76b517f6a74f813ae38137bdc88ff3bafa6dd9;hp=7009555c44a1b297fdee256fa00159ea570588fb;hpb=53551fe5c592d812554bf7245006e9c675632701;p=dcpomatic.git diff --git a/src/lib/font.h b/src/lib/font.h index 7009555c4..c165fea9f 100644 --- a/src/lib/font.h +++ b/src/lib/font.h @@ -20,27 +20,54 @@ #ifndef DCPOMATIC_FONT_H #define DCPOMATIC_FONT_H +#include "font_files.h" #include #include +#include #include #include class Font { public: - Font (std::string id_) - : id (id_) {} + Font (std::string id) + : _id (id) {} Font (cxml::NodePtr node); void as_xml (xmlpp::Node* node); - - /** Font ID */ - std::string id; - boost::optional file; + + std::string id () const { + return _id; + } + + boost::optional file (FontFiles::Variant variant) const { + return _files.get (variant); + } + + void set_file (FontFiles::Variant variant, boost::filesystem::path file) { + _files.set (variant, file); + Changed (); + } + + FontFiles files () const { + return _files; + } + + void set_files (FontFiles files) { + _files = files; + Changed (); + } + + boost::signals2::signal Changed; + +private: + /** Font ID, used to describe it in the subtitle content */ + std::string _id; + FontFiles _files; }; -bool -operator!= (Font const & a, Font const & b); +bool operator!= (Font const & a, Font const & b); +bool operator== (Font const & a, Font const & b); #endif