Browse Source

Move unicode conversion function to correct namespace

master
C. J. Howard 1 year ago
parent
commit
fa4215bfd5
2 changed files with 4 additions and 5 deletions
  1. +2
    -3
      src/scene/text.cpp
  2. +2
    -2
      src/type/unicode/convert.cpp

+ 2
- 3
src/scene/text.cpp View File

@ -20,8 +20,8 @@
#include "scene/text.hpp"
#include "render/vertex-attribute.hpp"
#include "math/vector-operators.hpp"
#include "type/unicode/convert.hpp"
#include <cstddef>
#include <codecvt>
namespace scene {
@ -151,8 +151,7 @@ void text::set_content(const std::string& content)
content_u8 = content;
// Convert UTF-8 content to UTF-32
std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> convert;
content_u32 = convert.from_bytes(content_u8.c_str());
content_u32 = type::unicode::u32(content_u8);
// Update text in VBO
update_content();

+ 2
- 2
src/type/unicode/convert.cpp View File

@ -20,7 +20,7 @@
#include "type/unicode/convert.hpp"
#include <codecvt>
namespace font {
namespace type {
namespace unicode {
std::u32string u32(const std::string& u8)
@ -36,4 +36,4 @@ std::string u8(const std::u32string& u32)
}
} // namespace unicode
} // namespace font
} // namespace type

Loading…
Cancel
Save