- /* We must escape some things, otherwise they might confuse our subtitle
- renderer (which uses entities and some HTML-esque markup to do bold/italic etc.)
- */
- string text = subtitle.text();
- boost::algorithm::replace_all(text, "&", "&");
- boost::algorithm::replace_all(text, "<", "<");
- boost::algorithm::replace_all(text, ">", ">");
- subtitle.set_text (text);
-
- /* Set any forced appearance */
- if (content()->colour()) {
- subtitle.set_colour(*content()->colour());
- }
- if (content()->effect_colour()) {
- subtitle.set_effect_colour(*content()->effect_colour());
- }
- if (content()->effect()) {
- subtitle.set_effect(*content()->effect());
- }
- if (content()->fade_in()) {
- subtitle.set_fade_up_time(dcp::Time(content()->fade_in()->seconds(), 1000));
- }
- if (content()->fade_out()) {
- subtitle.set_fade_down_time (dcp::Time(content()->fade_out()->seconds(), 1000));
- }
+ auto string_text = StringText(
+ subtitle,
+ content()->outline_width(),
+ content()->get_font(subtitle.font().get_value_or("")),
+ valign_standard
+ );
+ string_text.set_text(escape_text(string_text.text()));
+ set_forced_appearance(content(), string_text);
+ string_texts.push_back(string_text);