projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a comment.
[dcpomatic.git]
/
src
/
lib
/
font.h
diff --git
a/src/lib/font.h
b/src/lib/font.h
index b2ae86daff328d208a1e5c59d4f6b2ae83fe4b2f..55c4249cc9b07361b38b5a7b29c03523ceb85aed 100644
(file)
--- a/
src/lib/font.h
+++ b/
src/lib/font.h
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2014-20
15
Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-20
23
Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
@@
-18,15
+18,22
@@
*/
*/
+
#ifndef DCPOMATIC_FONT_H
#define DCPOMATIC_FONT_H
#ifndef DCPOMATIC_FONT_H
#define DCPOMATIC_FONT_H
+
+#include <dcp/array_data.h>
#include <libcxml/cxml.h>
#include <boost/optional.hpp>
#include <boost/signals2.hpp>
#include <boost/filesystem.hpp>
#include <string>
#include <libcxml/cxml.h>
#include <boost/optional.hpp>
#include <boost/signals2.hpp>
#include <boost/filesystem.hpp>
#include <string>
+
+namespace dcpomatic {
+
+
class Font
{
public:
class Font
{
public:
@@
-35,12
+42,26
@@
public:
explicit Font (cxml::NodePtr node);
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 as_xml (xmlpp::Node* node);
std::string id () const {
return _id;
}
+ void set_id (std::string id) {
+ _id = id;
+ }
+
boost::optional<boost::filesystem::path> file () const {
return _file;
}
boost::optional<boost::filesystem::path> file () const {
return _file;
}
@@
-50,15
+71,27
@@
public:
Changed ();
}
Changed ();
}
+ /** @return the data set passed to the dcp::ArrayData constructor,
+ * otherwise the contents of _file, otherwise boost::none.
+ */
+ boost::optional<dcp::ArrayData> data() const;
+
boost::signals2::signal<void()> Changed;
private:
boost::signals2::signal<void()> 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;
std::string _id;
+ boost::optional<dcp::ArrayData> _data;
boost::optional<boost::filesystem::path> _file;
};
boost::optional<boost::filesystem::path> _file;
};
+
bool operator!= (Font const & a, Font const & b);
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
#endif