From 59a0b4ef13b19b792d9fbbfc82d5615cf9164855 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Wed, 16 Feb 2022 11:33:14 +0300 Subject: [PATCH] Fix kerned_font handling spaces --- libs/ui/source/kerned_font.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libs/ui/source/kerned_font.cpp b/libs/ui/source/kerned_font.cpp index 41247016..3a983cef 100644 --- a/libs/ui/source/kerned_font.cpp +++ b/libs/ui/source/kerned_font.cpp @@ -60,10 +60,15 @@ namespace psemek::ui geom::vector pos{0.f, (size_[1] - baseline_offset_) * options.scale}; for (char32_t c : util::utf8_range(str)) { - if (!supports_character(c)) - c = unknown; + char32_t cc = c; - auto const & data = glyphs_.at(c); + if (!supports_character(c)) + cc = unknown; + + if (std::isspace(c)) + cc = ' '; + + auto const & data = glyphs_.at(cc); glyph g; g.character = c;