summaryrefslogtreecommitdiff
path: root/src/lib/player_subtitles.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-08-23 18:08:59 +0100
committerCarl Hetherington <cth@carlh.net>2015-08-23 18:08:59 +0100
commitea8d9e93091cd54d252b3c4069d1dba7060e4f75 (patch)
treee158c2b16215cf5de2b7a59e3ab8d377a03600a3 /src/lib/player_subtitles.cc
parent13b2078ca72921b20719374a07561a6167c77f70 (diff)
Use the correct font to render subtitles in preview / burn-in (#663).
Diffstat (limited to 'src/lib/player_subtitles.cc')
-rw-r--r--src/lib/player_subtitles.cc41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/lib/player_subtitles.cc b/src/lib/player_subtitles.cc
new file mode 100644
index 000000000..da5714349
--- /dev/null
+++ b/src/lib/player_subtitles.cc
@@ -0,0 +1,41 @@
+/*
+ Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "player_subtitles.h"
+#include "font.h"
+#include <boost/foreach.hpp>
+
+using std::list;
+using boost::shared_ptr;
+
+void
+PlayerSubtitles::add_fonts (list<shared_ptr<Font> > fonts_)
+{
+ BOOST_FOREACH (shared_ptr<Font> i, fonts_) {
+ bool got = false;
+ BOOST_FOREACH (shared_ptr<Font> j, fonts) {
+ if (i->file() == j->file()) {
+ got = true;
+ }
+ }
+ if (!got) {
+ fonts.push_back (i);
+ }
+ }
+}