summaryrefslogtreecommitdiff
path: root/src/lib/subtitle_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-06-10 11:07:44 +0100
committerCarl Hetherington <cth@carlh.net>2016-06-10 11:07:44 +0100
commite69de121d28bd4ebe55b06123fa340c19838cd19 (patch)
treeaf95f068a875d38b6abb628ac75189a779346710 /src/lib/subtitle_decoder.cc
parent71f9ae33ffbbc1b99594ac5d9a6d6cd6721061f4 (diff)
Fix positioning of SubRip.
Diffstat (limited to 'src/lib/subtitle_decoder.cc')
-rw-r--r--src/lib/subtitle_decoder.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/subtitle_decoder.cc b/src/lib/subtitle_decoder.cc
index b7d03b591..2866dee5c 100644
--- a/src/lib/subtitle_decoder.cc
+++ b/src/lib/subtitle_decoder.cc
@@ -151,14 +151,19 @@ SubtitleDecoder::give_text (ContentTimePeriod period, sub::Subtitle const & subt
BOOST_FOREACH (sub::Line i, subtitle.lines) {
BOOST_FOREACH (sub::Block j, i.blocks) {
+ if (!j.font_size.specified()) {
+ /* Fallback default font size if none other has been specified */
+ j.font_size.set_points (48);
+ }
+
float v_position;
dcp::VAlign v_align;
if (needs_placement) {
DCPOMATIC_ASSERT (i.vertical_position.line);
- /* This 0.878 is an arbitrary value to lift the bottom sub off the bottom
+ /* This 0.122 is an arbitrary value to lift the bottom sub off the bottom
of the screen a bit to a pleasing degree.
*/
- v_position = 0.878 + i.vertical_position.line.get() * 1.5 / 22;
+ v_position = 0.122 + i.vertical_position.line.get() * 1.2 * j.font_size.proportional (72 * 11);
v_align = dcp::VALIGN_BOTTOM;
} else {
DCPOMATIC_ASSERT (i.vertical_position.proportional);
@@ -180,11 +185,6 @@ SubtitleDecoder::give_text (ContentTimePeriod period, sub::Subtitle const & subt
}
}
- if (!j.font_size.specified()) {
- /* Fallback default font size if none other has been specified */
- j.font_size.set_points (72);
- }
-
out.push_back (
dcp::SubtitleString (
string(TEXT_FONT_ID),