From: Carl Hetherington Date: Sun, 5 Jun 2022 21:51:55 +0000 (+0200) Subject: Improve accuracy of subtitle font sizing. X-Git-Tag: v2.16.14~40 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=f807d3f9751c43bcfa0b260aeb5deca5f00761d2 Improve accuracy of subtitle font sizing. --- 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 subtitles, int target_height, float fade_factor, str if (subtitle.underline()) { span += "underline=\"single\" "; } - span += "size=\"" + dcp::raw_convert(subtitle.size_in_pixels(target_height) * pixels_to_1024ths_point) + "\" "; + span += "size=\"" + dcp::raw_convert(lrintf(subtitle.size_in_pixels(target_height) * pixels_to_1024ths_point)) + "\" "; /* Between 1-65535 inclusive, apparently... */ span += "alpha=\"" + dcp::raw_convert(int(floor(fade_factor * 65534)) + 1) + "\" "; span += "color=\"#" + subtitle.colour().to_rgb_string() + "\"";