diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-06-05 23:51:55 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-06-05 23:51:55 +0200 |
| commit | f807d3f9751c43bcfa0b260aeb5deca5f00761d2 (patch) | |
| tree | 13a8e1433ab079023ad49bc3626e18ec863f70fb /src/lib/render_text.cc | |
| parent | 6fa6f0a7ca116c6cf5dc5b8d2e8ed3a0fd4a6127 (diff) | |
Improve accuracy of subtitle font sizing.
Diffstat (limited to 'src/lib/render_text.cc')
| -rw-r--r-- | src/lib/render_text.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/render_text.cc b/src/lib/render_text.cc index 0c14b00c4..e0eb3da7b 100644 --- a/src/lib/render_text.cc +++ b/src/lib/render_text.cc @@ -99,7 +99,7 @@ marked_up (list<StringText> subtitles, int target_height, float fade_factor, str if (subtitle.underline()) { span += "underline=\"single\" "; } - span += "size=\"" + dcp::raw_convert<string>(subtitle.size_in_pixels(target_height) * pixels_to_1024ths_point) + "\" "; + span += "size=\"" + dcp::raw_convert<string>(lrintf(subtitle.size_in_pixels(target_height) * pixels_to_1024ths_point)) + "\" "; /* Between 1-65535 inclusive, apparently... */ span += "alpha=\"" + dcp::raw_convert<string>(int(floor(fade_factor * 65534)) + 1) + "\" "; span += "color=\"#" + subtitle.colour().to_rgb_string() + "\""; |
