summaryrefslogtreecommitdiff
path: root/src/lib/string_text.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-06-01 13:03:38 +0200
committerCarl Hetherington <cth@carlh.net>2022-06-07 17:01:06 +0200
commit5a820bb8fae34591be5ac6d19a73461b9dab532a (patch)
tree098e2dc959b6df0fefa62b2976976afc9f81b96b /src/lib/string_text.h
parent9a7b67aee32a40539f29bc2d7017edd4a4f65f11 (diff)
Rearrange subtitle font management.
With this change each subtitle coming out of the player has a reference to a dcpomatic::Font that belongs to the TextContent. This hopefully solves a few problems which all basically stemmed from the fact that previously the decoders/player were deciding what the font ID in the output DCP would be - they can't do that properly.
Diffstat (limited to 'src/lib/string_text.h')
-rw-r--r--src/lib/string_text.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/lib/string_text.h b/src/lib/string_text.h
index 887224d53..8c505f36a 100644
--- a/src/lib/string_text.h
+++ b/src/lib/string_text.h
@@ -23,22 +23,29 @@
#define DCPOMATIC_STRING_TEXT_H
+#include "font.h"
#include <dcp/subtitle_string.h>
-/** A wrapper for SubtitleString which allows us to include settings that are not
- * applicable to true DCP subtitles. For example, we can set outline width for burn-in
- * but this cannot be specified in DCP XML.
+/** A wrapper for SubtitleString which allows us to:
+ *
+ * - include settings that are not applicable to true DCP subtitles.
+ * For example, we can set outline width for burn-in but this cannot be specified in DCP XML.
+ *
+ * - specify the font by referring to a Font object from the content we came from, rather than
+ * having to use a DCP ID like in dcp::SubtitleString.
*/
class StringText : public dcp::SubtitleString
{
public:
- StringText (dcp::SubtitleString dcp_, int outline_width_)
+ StringText (dcp::SubtitleString dcp_, int outline_width_, std::shared_ptr<dcpomatic::Font> font_)
: dcp::SubtitleString (dcp_)
, outline_width (outline_width_)
+ , font (font_)
{}
int outline_width;
+ std::shared_ptr<dcpomatic::Font> font;
};