summaryrefslogtreecommitdiff
path: root/src/ssa_reader.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-06-20 22:22:01 +0100
committerCarl Hetherington <cth@carlh.net>2016-06-20 22:22:01 +0100
commit6f1af34ae95586281f1632ceb87cc95784ccff28 (patch)
tree3c9b0881e8173786542ea5ddb9330a9ba0fb3691 /src/ssa_reader.cc
parent5a77646bf70c5fdfc39210035a7c3c3de43e89ed (diff)
Fix bold and newlines (in some cases) in SSA.
Diffstat (limited to 'src/ssa_reader.cc')
-rw-r--r--src/ssa_reader.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/ssa_reader.cc b/src/ssa_reader.cc
index 74d497a..eb85dea 100644
--- a/src/ssa_reader.cc
+++ b/src/ssa_reader.cc
@@ -239,6 +239,10 @@ SSAReader::parse_line (RawSubtitle base, string line)
current.italic = true;
} else if (style == "\\i0" || style == "\\i") {
current.italic = false;
+ } else if (style == "\\b1") {
+ current.bold = true;
+ } else if (style == "\\b0") {
+ current.bold = false;
} else if (style == "\\an1" || style == "\\an2" || style == "\\an3") {
current.vertical_position.reference = sub::BOTTOM_OF_SCREEN;
} else if (style == "\\an4" || style == "\\an5" || style == "\\an6") {
@@ -253,9 +257,11 @@ SSAReader::parse_line (RawSubtitle base, string line)
}
break;
case BACKSLASH:
- if ((c == 'n' || c == 'N') && !current.text.empty ()) {
- subs.push_back (current);
- current.text = "";
+ if (c == 'n' || c == 'N') {
+ if (!current.text.empty ()) {
+ subs.push_back (current);
+ current.text = "";
+ }
/* Move down one line (1.2 times the font size) */
if (current.vertical_position.reference.get() == BOTTOM_OF_SCREEN) {
current.vertical_position.proportional = current.vertical_position.proportional.get() - line_size;