summaryrefslogtreecommitdiff
path: root/src/parse/subtitle.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-01-22 19:59:07 +0000
committerCarl Hetherington <cth@carlh.net>2015-01-22 19:59:07 +0000
commit305c00f13c929478de39123008d93b52ed2ec7ca (patch)
tree782fce23c14185378ede55d0f5393f2024fddaff /src/parse/subtitle.cc
parent14e4eac6689b5ffe3542d45ad62708507efcd791 (diff)
parent6986647a7ec79fe1a83da96c50bbf414dda859c5 (diff)
Merge branch 'master' of ssh://main.carlh.net/home/carl/git/libdcp
Diffstat (limited to 'src/parse/subtitle.cc')
-rw-r--r--src/parse/subtitle.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/parse/subtitle.cc b/src/parse/subtitle.cc
index 56222c97..8c53bd68 100644
--- a/src/parse/subtitle.cc
+++ b/src/parse/subtitle.cc
@@ -147,7 +147,8 @@ Subtitle::fade_time (shared_ptr<const cxml::Node> node, string name, optional<in
}
Text::Text (shared_ptr<const cxml::Node> node, optional<int> tcr)
- : v_align (CENTER)
+ : v_align (VERTICAL_CENTER)
+ , h_align (HORIZONTAL_CENTER)
{
/* Vertical position */
text = node->content ();
@@ -166,6 +167,15 @@ Text::Text (shared_ptr<const cxml::Node> node, optional<int> tcr)
v_align = string_to_valign (v.get ());
}
+ /* Horizontal alignment */
+ optional<string> h = node->optional_string_attribute ("HAlign");
+ if (!h) {
+ h = node->optional_string_attribute ("Halign");
+ }
+ if (h) {
+ h_align = string_to_halign (h.get ());
+ }
+
list<cxml::NodePtr> f = node->node_children ("Font");
for (list<cxml::NodePtr>::iterator i = f.begin(); i != f.end(); ++i) {
font_nodes.push_back (shared_ptr<Font> (new Font (*i, tcr)));