diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-19 22:11:25 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-06-19 22:11:25 +0100 |
| commit | 2ddb0b6bf8087cb1ef3ad3a3a185c55e406c07bb (patch) | |
| tree | f98aa0fd49e0a3ce99b20c433257a0ee6f985276 | |
| parent | 1aa877613d49306b5026a5471edaf51ba3921889 (diff) | |
Render bold subtitles correctly in preview / burn-in.
| -rw-r--r-- | ChangeLog | 2 | ||||
| -rw-r--r-- | src/lib/render_subtitles.cc | 14 |
2 files changed, 16 insertions, 0 deletions
@@ -1,5 +1,7 @@ 2016-06-19 Carl Hetherington <cth@carlh.net> + * Fix preview of bold subtitles. + * Updated pt_BR translation from Max M. Fuhlendorf. * Version 2.8.11 released. diff --git a/src/lib/render_subtitles.cc b/src/lib/render_subtitles.cc index 74762a64a..76aa09229 100644 --- a/src/lib/render_subtitles.cc +++ b/src/lib/render_subtitles.cc @@ -200,6 +200,7 @@ render_line (list<dcp::SubtitleString> subtitles, list<shared_ptr<Font> > fonts, string marked_up; bool italic = false; + bool bold = false; BOOST_FOREACH (dcp::SubtitleString const & i, subtitles) { if (i.italic() != italic) { if (i.italic()) { @@ -210,6 +211,15 @@ render_line (list<dcp::SubtitleString> subtitles, list<shared_ptr<Font> > fonts, italic = i.italic (); } + if (i.bold() != bold) { + if (i.bold()) { + marked_up += "<b>"; + } else { + marked_up += "</b>"; + } + bold = i.bold (); + } + marked_up += i.text (); } @@ -217,6 +227,10 @@ render_line (list<dcp::SubtitleString> subtitles, list<shared_ptr<Font> > fonts, marked_up += "</i>"; } + if (bold) { + marked_up += "</b>"; + } + layout->set_markup (marked_up); /* Compute fade factor */ |
