From 8d77e842e960fa8f65cf35819136883d33f61e64 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Thu, 6 Mar 2025 01:38:59 +0100 Subject: [PATCH] Fix #135097: BLF Control Characters in When Wrapping With 4da5377e17 control characters are shown as space characters. But word wrapping code will use the codepoint from the glyph if available, which means a soft wrap on space instead of a hard wrap on line feed. Just oversight, no need to use the glyph for that. In fact we always want to deal with the character, not the visual representation of it. Pull Request: https://projects.blender.org/blender/blender/pulls/135541 --- source/blender/blenfont/intern/blf_font.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenfont/intern/blf_font.cc b/source/blender/blenfont/intern/blf_font.cc index 7e4d0f9bcac..dfa9ec61443 100644 --- a/source/blender/blenfont/intern/blf_font.cc +++ b/source/blender/blenfont/intern/blf_font.cc @@ -1287,7 +1287,7 @@ static void blf_font_wrap_apply(FontBLF *font, g = blf_glyph_from_utf8_and_step(font, gc, g_prev, str, str_len, &i, &pen_x); const ft_pix advance_x = g ? g->advance_x : 0; - const uint codepoint = g ? g->c : BLI_str_utf8_as_unicode_safe(&str[i_curr]); + const uint codepoint = BLI_str_utf8_as_unicode_safe(&str[i_curr]); /** * Implementation Detail (utf8).