use UTF-8 for string representation

This commit is contained in:
Jinhao
2015-12-31 01:09:52 +08:00
parent 0a396c12c2
commit a42ebe19b4
38 changed files with 182 additions and 416 deletions

View File

@@ -405,8 +405,8 @@ namespace paint
::GetTextExtentExPoint(handle_->context, str, static_cast<int>(len), 0, 0, dx, &extents);
sz.width = dx[end - 1] - (begin ? dx[begin - 1] : 0);
unsigned tab_pixels = handle_->string.tab_length * handle_->string.whitespace_pixels;
const nana::char_t * pend = str + end;
for(const nana::char_t * p = str + begin; p != pend; ++p)
const wchar_t * pend = str + end;
for(const wchar_t * p = str + begin; p != pend; ++p)
{
if(*p == '\t')
sz.width += tab_pixels;
@@ -906,7 +906,7 @@ namespace paint
return *this;
}
unsigned graphics::bidi_string(const nana::point& pos, const char_t * str, std::size_t len)
unsigned graphics::bidi_string(const nana::point& pos, const wchar_t * str, std::size_t len)
{
auto moved_pos = pos;
unicode_bidi bidi;