diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-11-18 10:56:42 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-11-21 20:09:28 +0100 |
| commit | 323b8cbb0b95297fbd027ffdc4ea5003b59ef25f (patch) | |
| tree | 9d558917b9a6ad488fc127293fba2b903c329d2b /src/lib/reel_writer.h | |
| parent | b9f949d688b6e9563f6350286bbbc3f169b1b9fe (diff) | |
Fix subtitle vertical position (#2367).
Previously we would not account for the differences in what vertical
position means between Interop and SMPTE. For interop, vertical
position is the distance from the reference point to the text
baseline, whereas for SMPTE it is the distance from the reference
point to the top/middle/bottom of the subtitle (depending on the
reference).
This caused differences between the preview and the DCP for some
cases (notably, using SRT/SSA and making Interop DCPs, or converting
Interop DCP subs to SMPTE, or vice versa).
Diffstat (limited to 'src/lib/reel_writer.h')
| -rw-r--r-- | src/lib/reel_writer.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/reel_writer.h b/src/lib/reel_writer.h index e2c713cc5..d5b531f41 100644 --- a/src/lib/reel_writer.h +++ b/src/lib/reel_writer.h @@ -26,6 +26,7 @@ #include "font_id_map.h" #include "player_text.h" #include "referenced_reel_asset.h" +#include "render_text.h" #include "types.h" #include "weak_film.h" #include <dcp/atmos_asset_writer.h> @@ -121,6 +122,7 @@ private: std::set<DCPTextTrack> ensure_closed_captions ) const; void create_reel_markers (std::shared_ptr<dcp::Reel> reel) const; + float convert_vertical_position(StringText const& subtitle, dcp::Standard to) const; dcpomatic::DCPTimePeriod _period; /** the first picture frame index that does not already exist in our MXF */ @@ -147,5 +149,7 @@ private: std::shared_ptr<dcp::AtmosAsset> _atmos_asset; std::shared_ptr<dcp::AtmosAssetWriter> _atmos_asset_writer; + mutable FontMetrics _font_metrics; + static int const _info_size; }; |
