41 const std::string text =
"Alle Spieler erhalten das gleiche Einkommen in regelmäßigen Abständen. Alles andere Einkommen ist deaktiviert.\n\nInspiriert vom gleichnamigen 'Earth 2150' Spielmodus.";
44 BOOST_REQUIRE(
renderer.set_text(text,
true));
46 const auto configure = [&](
int width) {
52 .set_alignment(PANGO_ALIGN_LEFT)
53 .set_maximum_width(width)
54 .set_maximum_height(-1,
true)
55 .set_ellipse_mode(PANGO_ELLIPSIZE_NONE)
56 .set_characters_per_line(0);
59 const auto measure_and_get_size = [&](
int width) {
64 const auto lines_at = [&](
int width) {
69 for(
int width : {420, 400, 399, 398}) {
70 const auto size = measure_and_get_size(width);
71 const auto wrapped_at_width = lines_at(width);
72 const auto wrapped_at_size = lines_at(size.x);
73 BOOST_TEST(wrapped_at_size == wrapped_at_width,
"wrap at " << width <<
" changes at " << size.x);
BOOST_AUTO_TEST_CASE(pango_text_wraps_at_maximum_width)