Posted by: nanaproject | June 18, 2012

Introduce to The Support of Bidirectional Language

This update(0.2.4) introduced the basic support of bidirectional language into Nana C++ Library.

The vision of selected text is not continuous during different directional languages, because
the vision direction is same with the direction of language.

In some situations, the text is displayed in unexpected direction due to algorithm. For
example. If the text “Bidi example: ” is removed, the new text is begin with an Arabic word
and the display is

The display is unexcepted, because the text is begin with an Arabic word, the sentence is
treated as Right-to-Left. In the situation, we should adjust the direction with implicit
directional marks character.

nana::string text = STR(“مرحبا means Hello in Arabic.”);
text.insert(0, 1, nana::unicode_bidi::LRM);

Insert a LRM(left-to-right mark) character to make the algorithm treat the text as left-to-


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: