2 Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 DCP-o-matic is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef DCPOMATIC_FONT_H
22 #define DCPOMATIC_FONT_H
24 #include "font_files.h"
25 #include <libcxml/cxml.h>
26 #include <boost/optional.hpp>
27 #include <boost/signals2.hpp>
28 #include <boost/filesystem.hpp>
37 Font (cxml::NodePtr node);
39 void as_xml (xmlpp::Node* node);
41 std::string id () const {
45 boost::optional<boost::filesystem::path> file (FontFiles::Variant variant) const {
46 return _files.get (variant);
49 void set_file (FontFiles::Variant variant, boost::filesystem::path file) {
50 _files.set (variant, file);
54 FontFiles files () const {
58 void set_files (FontFiles files) {
63 boost::signals2::signal<void()> Changed;
66 /** Font ID, used to describe it in the subtitle content */
71 bool operator!= (Font const & a, Font const & b);
72 bool operator== (Font const & a, Font const & b);