Fix kerned_font handling spaces

This commit is contained in:
Nikita Lisitsa 2022-02-16 11:33:14 +03:00
parent a52ea77e69
commit 59a0b4ef13

View file

@ -60,10 +60,15 @@ namespace psemek::ui
geom::vector<float, 2> pos{0.f, (size_[1] - baseline_offset_) * options.scale}; geom::vector<float, 2> pos{0.f, (size_[1] - baseline_offset_) * options.scale};
for (char32_t c : util::utf8_range(str)) for (char32_t c : util::utf8_range(str))
{ {
if (!supports_character(c)) char32_t cc = c;
c = unknown;
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; glyph g;
g.character = c; g.character = c;