diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-07-19 20:10:45 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-07-19 23:45:23 +0100 |
| commit | 0e4a58abdc78f84478031acdc0acb95f5cb9a2a6 (patch) | |
| tree | 2b20b3f38ad09ee2c161a0612f0b7a4c65983d06 /src/lib/render_text.cc | |
| parent | 6b4059b815eec61ff953918694f5b6fbe010a1a0 (diff) | |
Finish PlayerSubtitles -> PlayerText and SubtitleString -> PlainText.
Diffstat (limited to 'src/lib/render_text.cc')
| -rw-r--r-- | src/lib/render_text.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/render_text.cc b/src/lib/render_text.cc index 673078347..77a8036e8 100644 --- a/src/lib/render_text.cc +++ b/src/lib/render_text.cc @@ -51,11 +51,11 @@ static FcConfig* fc_config = 0; static list<pair<FontFiles, string> > fc_config_fonts; string -marked_up (list<SubtitleString> subtitles, int target_height, float fade_factor) +marked_up (list<PlainText> subtitles, int target_height, float fade_factor) { string out; - BOOST_FOREACH (SubtitleString const & i, subtitles) { + BOOST_FOREACH (PlainText const & i, subtitles) { out += "<span "; if (i.italic()) { out += "style=\"italic\" "; @@ -91,7 +91,7 @@ set_source_rgba (Cairo::RefPtr<Cairo::Context> context, dcp::Colour colour, floa * at the same time and with the same fade in/out. */ static PositionImage -render_line (list<SubtitleString> subtitles, list<shared_ptr<Font> > fonts, dcp::Size target, DCPTime time, int frame_rate) +render_line (list<PlainText> subtitles, list<shared_ptr<Font> > fonts, dcp::Size target, DCPTime time, int frame_rate) { /* XXX: this method can only handle italic / bold changes mid-line, nothing else yet. @@ -365,12 +365,12 @@ render_line (list<SubtitleString> subtitles, list<shared_ptr<Font> > fonts, dcp: * @param frame_rate DCP frame rate. */ list<PositionImage> -render_text (list<SubtitleString> subtitles, list<shared_ptr<Font> > fonts, dcp::Size target, DCPTime time, int frame_rate) +render_text (list<PlainText> subtitles, list<shared_ptr<Font> > fonts, dcp::Size target, DCPTime time, int frame_rate) { - list<SubtitleString> pending; + list<PlainText> pending; list<PositionImage> images; - BOOST_FOREACH (SubtitleString const & i, subtitles) { + BOOST_FOREACH (PlainText const & i, subtitles) { if (!pending.empty() && fabs (i.v_position() - pending.back().v_position()) > 1e-4) { images.push_back (render_line (pending, fonts, target, time, frame_rate)); pending.clear (); |
