From f807d3f9751c43bcfa0b260aeb5deca5f00761d2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 5 Jun 2022 23:51:55 +0200 Subject: [PATCH] Improve accuracy of subtitle font sizing. --- src/lib/render_text.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() + "\""; -- 2.30.2