/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
/** @file src/font.h
- * @brief Font class
+ * @brief Font class.
*/
-#include "types.h"
-#include "subtitle.h"
-#include <boost/shared_ptr.hpp>
-#include <boost/optional.hpp>
-#include <list>
-
-namespace cxml {
- class Node;
-}
+#include "asset.h"
namespace dcp {
/** @class Font
- * @brief Helper class for parsing subtitle XML.
+ * @brief A (truetype) font asset for subtitles in a DCP.
*/
-class Font
+class Font : public Asset
{
public:
- Font ()
- : size (0)
- {}
-
- Font (boost::shared_ptr<const cxml::Node> node);
- Font (std::list<boost::shared_ptr<Font> > const & font_nodes);
-
- std::string text;
- boost::optional<std::string> id;
- int size;
- boost::optional<bool> italic;
- boost::optional<Color> color;
- boost::optional<Effect> effect;
- boost::optional<Color> effect_color;
+ Font (boost::filesystem::path file);
- std::list<boost::shared_ptr<Subtitle> > subtitle_nodes;
- std::list<boost::shared_ptr<Font> > font_nodes;
- std::list<boost::shared_ptr<Text> > text_nodes;
+private:
+ std::string pkl_type (Standard standard) const;
};
}