diff --git a/desktop_version/src/Font.cpp b/desktop_version/src/Font.cpp index 4926aae1..a681fab5 100644 --- a/desktop_version/src/Font.cpp +++ b/desktop_version/src/Font.cpp @@ -901,7 +901,7 @@ void print( } int print_wrap( - const uint32_t flags, + uint32_t flags, const int x, int y, const std::string& text, @@ -912,18 +912,28 @@ int print_wrap( int maxwidth /*= -1*/ ) { + PrintFlags pf = decode_print_flags(flags); + if (pf.font_sel == NULL) + { + return y; + } + if (linespacing == -1) { linespacing = 10; } - linespacing = SDL_max(linespacing, loc::get_langmeta()->font_h); + linespacing = SDL_max(linespacing, pf.font_sel->glyph_h * pf.scale); if (maxwidth == -1) { maxwidth = 304; } - // TODO look through all the flags + if (pf.border && !graphics.notextoutline && (r|g|b) != 0) + { + print_wrap(flags, x, y, text, 0, 0, 0, linespacing, maxwidth); + flags &= ~PR_BOR; + } const char* str = text.c_str(); // This could fit 64 non-BMP characters onscreen, should be plenty diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index 7ea2dace..ba63a23f 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -1827,18 +1827,16 @@ void Graphics::drawtrophytext(void) break; } - /* These were `bprint` before */ - // TODO: add PR_COLORGLYPH_BRI(brightness) | PR_BOR short lines; if (top_text != NULL) { font::string_wordwrap(top_text, 304, &lines); - PrintWrap(-1, 11-(lines-1)*5, top_text, temp, temp2, temp3, true); + font::print_wrap(PR_CEN | PR_COLORGLYPH_BRI(brightness) | PR_BOR, -1, 11-(lines-1)*5, top_text, temp, temp2, temp3); } if (bottom_text != NULL) { font::string_wordwrap(bottom_text, 304, &lines); - PrintWrap(-1, 221-(lines-1)*5, bottom_text, temp, temp2, temp3, true); + font::print_wrap(PR_CEN | PR_COLORGLYPH_BRI(brightness) | PR_BOR, -1, 221-(lines-1)*5, bottom_text, temp, temp2, temp3); } } diff --git a/desktop_version/src/RoomnameTranslator.cpp b/desktop_version/src/RoomnameTranslator.cpp index b814337c..e00ccb48 100644 --- a/desktop_version/src/RoomnameTranslator.cpp +++ b/desktop_version/src/RoomnameTranslator.cpp @@ -75,7 +75,7 @@ namespace roomname_translator const char* first_part = "Unexplained room names are "; font::print(PR_BOR | PR_FONT_8X8, 0, 60, first_part, 255,255,255); - font::print(PR_BOR | PR_FONT_8X8, graphics.len(first_part), 60, "cyan.", 64, 255, 255-help.glow); + font::print(PR_BOR | PR_FONT_8X8, font::len(PR_FONT_8X8, first_part), 60, "cyan.", 64, 255, 255-help.glow); } else { @@ -90,7 +90,7 @@ namespace roomname_translator const char* first_part = "English room names are "; font::print(PR_BOR | PR_FONT_8X8, 0, 60, first_part, 255,255,255); - font::print(PR_BOR | PR_FONT_8X8, graphics.len(first_part), 60, "cyan.", 0, 192, 255-help.glow); + font::print(PR_BOR | PR_FONT_8X8, font::len(PR_FONT_8X8, first_part), 60, "cyan.", 0, 192, 255-help.glow); } font::print(PR_BOR | PR_FONT_8X8, 0, 80, "KEYS:", 255,255,255); if (expl_mode)