- i.set_in (dcp::Time(period.from.seconds() - _period.from.seconds(), vfr));
- i.set_out (dcp::Time(period.to.seconds() - _period.from.seconds(), vfr));
- asset->add (make_shared<dcp::SubtitleString>(i));
+ i.set_in (dcp::Time(period.from.seconds() - _period.from.seconds(), tcr));
+ i.set_out (dcp::Time(period.to.seconds() - _period.from.seconds(), tcr));
+ i.set_v_position(convert_vertical_position(i, film()->interop() ? dcp::SubtitleStandard::INTEROP : dcp::SubtitleStandard::SMPTE_2014));
+ auto sub = make_shared<dcp::SubtitleString>(i);
+ /* i.font is a shared_ptr<Font> which uniquely identifies the font we want,
+ * though if we are Interop we can only have one font, so we'll use the chosen
+ * one instead.
+ */
+ auto font = film()->interop() ? chosen_interop_font : i.font;
+ /* We can get the corresponding ID from fonts */
+ auto const font_id_to_use = fonts.get(font);
+ /* Give this subtitle the correct font ID */
+ sub->set_font(font_id_to_use);
+ asset->add(sub);
+ /* Make sure the asset LoadFonts the font we just asked for */
+ asset->ensure_font(font_id_to_use, font->data().get_value_or(_default_font));