Support for underlined subtitles.
authorCarl Hetherington <cth@carlh.net>
Fri, 24 Jun 2016 12:22:02 +0000 (13:22 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 24 Jun 2016 12:22:02 +0000 (13:22 +0100)
ChangeLog
cscript
src/lib/render_subtitles.cc
src/lib/subtitle_decoder.cc

index c7dbbf3833804cd6a8ddf037ac7558f9cad4ed37..a76736a6c6a79dd30a6537754404395502d11410 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-06-24  c.hetherington  <cth@carlh.net>
+
+       * Support underlined subtitles.
+
 2016-06-22  Carl Hetherington  <cth@carlh.net>
 
        * Version 2.8.13 released.
diff --git a/cscript b/cscript
index 3c5ef9e68fd087601c1d3727a97de0c68f2faa56..379936677b71391e71ad208a7f28a244caa12d14 100644 (file)
--- a/cscript
+++ b/cscript
@@ -237,7 +237,7 @@ def dependencies(target):
         ffmpeg_options = {}
 
     return (('ffmpeg-cdist', 'aab2fb1', ffmpeg_options),
-            ('libdcp', 'e6bbf12'),
+            ('libdcp', 'fe3bb91'),
             ('libsub', '23a1a03'))
 
 def configure_options(target):
index 76aa092297d9c880a6a5949f78354d953e249e93..0e985371c050317e8cfe4f62ca5697b4a293cf27 100644 (file)
@@ -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 */
index f8f179587f6be35d85b10f0ff848a79d13639ef7..9fb66b74f6a6407d493367d7ec6b06f3dfaf55d6 100644 (file)
@@ -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),