add a namespace nana::utf for UTF-8 character processing
This commit is contained in:
@@ -348,7 +348,7 @@ namespace API
|
||||
text.erase(pos, 1);
|
||||
if(shortkey == 0 && pos < text.length())
|
||||
{
|
||||
shortkey = text.at(pos);
|
||||
shortkey = utf::char_at(text.c_str() + pos, 0, nullptr);
|
||||
if(shortkey == '&') //This indicates the text contains "&&", it means the symbol have to be ignored.
|
||||
shortkey = 0;
|
||||
else if(skpos)
|
||||
|
||||
@@ -258,7 +258,9 @@ namespace nana{ namespace drawerbase
|
||||
if(shortkey)
|
||||
{
|
||||
unsigned off_w = (shortkey_pos ? graph.text_extent_size(mbstr.c_str(), static_cast<unsigned>(shortkey_pos)).width : 0);
|
||||
nana::size shortkey_size = graph.text_extent_size(to_wstring(mbstr.c_str() + shortkey_pos), 1);
|
||||
|
||||
wchar_t keystr[2] = {nana::utf::char_at(mbstr.c_str() + shortkey_pos, 0, 0), 0};
|
||||
auto shortkey_size = graph.text_extent_size(keystr, 1);
|
||||
|
||||
unsigned ascent, descent, inleading;
|
||||
graph.text_metrics(ascent, descent, inleading);
|
||||
|
||||
Reference in New Issue
Block a user