Fix warning from pango about letter spacing not being an integer.
authorCarl Hetherington <cth@carlh.net>
Mon, 24 Jun 2024 20:36:08 +0000 (22:36 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 24 Jun 2024 20:36:08 +0000 (22:36 +0200)
src/lib/render_text.cc

index 41652d32de9aaaf214acce97838ab8aafb1c0e23..3c3d4eed70f3f720b4ad0c990612684e9a55c2d6 100644 (file)
@@ -148,7 +148,7 @@ marked_up(vector<StringText> subtitles, int target_height, float fade_factor, st
                        int dummy;
                        layout->get_pixel_size(space_width, dummy);
                        auto spacing = ((i.space_before() * i.size_in_pixels(target_height) - space_width) / 2) * pixels_to_1024ths_point;
-                       out += make_span(i, " ", "letter_spacing=\"" + dcp::raw_convert<string>(spacing) + "\"");
+                       out += make_span(i, " ", "letter_spacing=\"" + dcp::raw_convert<string>(std::round(spacing)) + "\"");
                }
 
                out += make_span(i, i.text(), {});