change some APIs for accepting utf8

This commit is contained in:
Jinhao
2015-11-27 01:54:26 +08:00
parent 3b8e113745
commit 12358a5dc0
55 changed files with 517 additions and 483 deletions

View File

@@ -361,6 +361,12 @@ namespace paint
return (handle_ ? font(handle_) : font_shadow_);
}
::nana::size graphics::text_extent_size(const ::std::string& text) const
{
throw_not_utf8(text);
return text_extent_size(static_cast<std::wstring>(::nana::charset(text, ::nana::unicode::utf8)));
}
nana::size graphics::text_extent_size(const nana::char_t* text) const
{
return text_extent_size(text, nana::strlen(text));
@@ -947,6 +953,12 @@ namespace paint
}
}
void graphics::string(const point& pos, const std::string& text)
{
throw_not_utf8(text);
string(pos, static_cast<std::wstring>(::nana::charset(text, ::nana::unicode::utf8)));
}
void graphics::string(nana::point pos, const char_t* str, std::size_t len)
{
if (handle_ && str && len)