Add add_fonts() to Piece.
[dcpomatic.git] / src / lib / player.cc
index 2aa23bc1588f66599d07482d7f64a4009589e6fe..9445d63b8cb0ce678595b705dac57fe4ca3ed981 100644 (file)
@@ -394,13 +394,7 @@ Player::get_subtitle_fonts ()
 
        list<shared_ptr<Font> > fonts;
        BOOST_FOREACH (shared_ptr<Piece> i, _pieces) {
-               BOOST_FOREACH (shared_ptr<TextContent> j, i->content->text) {
-                       /* XXX: things may go wrong if there are duplicate font IDs
-                          with different font files.
-                       */
-                       list<shared_ptr<Font> > f = j->fonts ();
-                       copy (f.begin(), f.end(), back_inserter (fonts));
-               }
+               i->add_fonts (fonts);
        }
 
        return fonts;