Doxygen tweaks.
[libdcp.git] / src / font.cc
index 5a568a63e3fabcf679c4a47447975deea2707209..cbfb999a47ef6be4db642c802ae79f6da92e45d9 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    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.cc
+ *  @brief Font class.
+ */
+
 #include "font.h"
-#include "xml.h"
-#include "text.h"
-#include <libcxml/cxml.h>
 
 using std::string;
-using std::list;
-using boost::shared_ptr;
-using boost::optional;
+
 using namespace dcp;
 
-Font::Font (shared_ptr<const cxml::Node> node)
+Font::Font (boost::filesystem::path file)
+       : Asset (file)
 {
-       text = node->content ();
-       
-       id = node->optional_string_attribute ("Id").get_value_or ("");
-       size = node->optional_number_attribute<int64_t> ("Size").get_value_or (0);
-       italic = node->optional_bool_attribute ("Italic");
-       optional<string> c = node->optional_string_attribute ("Color");
-       if (c) {
-               color = Color (c.get ());
-       }
-       optional<string> const e = node->optional_string_attribute ("Effect");
-       if (e) {
-               effect = string_to_effect (e.get ());
-       }
-       c = node->optional_string_attribute ( "EffectColor");
-       if (c) {
-               effect_color = Color (c.get ());
-       }
-       subtitle_nodes = type_children<Subtitle> (node, "Subtitle");
-       font_nodes = type_children<Font> (node, "Font");
-       text_nodes = type_children<Text> (node, "Text");
+
 }
 
-Font::Font (list<shared_ptr<Font> > const & font_nodes)
-       : size (0)
-       , italic (false)
-       , color ("FFFFFFFF")
-       , effect_color ("FFFFFFFF")
+string
+Font::pkl_type (Standard) const
 {
-       for (list<shared_ptr<Font> >::const_iterator i = font_nodes.begin(); i != font_nodes.end(); ++i) {
-               if (!(*i)->id.empty ()) {
-                       id = (*i)->id;
-               }
-               if ((*i)->size != 0) {
-                       size = (*i)->size;
-               }
-               if ((*i)->italic) {
-                       italic = (*i)->italic.get ();
-               }
-               if ((*i)->color) {
-                       color = (*i)->color.get ();
-               }
-               if ((*i)->effect) {
-                       effect = (*i)->effect.get ();
-               }
-               if ((*i)->effect_color) {
-                       effect_color = (*i)->effect_color.get ();
-               }
-       }
+       return "application/ttf";
 }