summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-06-24 13:22:02 +0100
committerCarl Hetherington <cth@carlh.net>2016-06-24 13:22:02 +0100
commitd1fa523a3d7991e5e17938f7c019a71c3041b1e6 (patch)
tree2dd76d00ce3f84682c821baf8eb4df1766e19efc /src
parent7f56a1cdba8dc7409817a112ad88042f4b1e5493 (diff)
Support for underlined subtitles.
Diffstat (limited to 'src')
-rw-r--r--src/lib/render_subtitles.cc14
-rw-r--r--src/lib/subtitle_decoder.cc1
2 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/render_subtitles.cc b/src/lib/render_subtitles.cc
index 76aa09229..0e985371c 100644
--- a/src/lib/render_subtitles.cc
+++ b/src/lib/render_subtitles.cc
@@ -201,6 +201,7 @@ render_line (list<dcp::SubtitleString> subtitles, list<shared_ptr<Font> > fonts,
string marked_up;
bool italic = false;
bool bold = false;
+ bool underline = false;
BOOST_FOREACH (dcp::SubtitleString const & i, subtitles) {
if (i.italic() != italic) {
if (i.italic()) {
@@ -220,6 +221,15 @@ render_line (list<dcp::SubtitleString> subtitles, list<shared_ptr<Font> > fonts,
bold = i.bold ();
}
+ if (i.underline() != underline) {
+ if (i.underline()) {
+ marked_up += "<u>";
+ } else {
+ marked_up += "</u>";
+ }
+ underline = i.underline ();
+ }
+
marked_up += i.text ();
}
@@ -231,6 +241,10 @@ render_line (list<dcp::SubtitleString> subtitles, list<shared_ptr<Font> > fonts,
marked_up += "</b>";
}
+ if (underline) {
+ marked_up += "</u>";
+ }
+
layout->set_markup (marked_up);
/* Compute fade factor */
diff --git a/src/lib/subtitle_decoder.cc b/src/lib/subtitle_decoder.cc
index f8f179587..9fb66b74f 100644
--- a/src/lib/subtitle_decoder.cc
+++ b/src/lib/subtitle_decoder.cc
@@ -195,6 +195,7 @@ SubtitleDecoder::give_text (ContentTimePeriod period, sub::Subtitle const & subt
string(TEXT_FONT_ID),
j.italic,
j.bold,
+ j.underline,
/* force the colour to whatever is configured */
content()->colour(),
j.font_size.points (72 * 11),